From 6db7be0682309f9f0101540b48f79ab9093b9cb1 Mon Sep 17 00:00:00 2001 From: erbel <johannes.erbel@cs.uni-goettingen.de> Date: Wed, 22 May 2019 13:40:55 +0200 Subject: [PATCH] Checkstyle Refactor --- build.gradle | 69 +-- .../build.gradle | 35 +- .../rwm/mocci/connector/ComponentManager.java | 151 +++--- .../rwm/mocci/connector/ConnectorFactory.java | 58 +- .../connector/DatagathererConnector.java | 122 ++--- .../connector/DataprocessorConnector.java | 123 ++--- .../MonitorablepropertyConnector.java | 39 +- .../OcciresultproviderConnector.java | 26 +- .../connector/ResultproviderConnector.java | 188 +++---- .../mocci/connector/ResultproviderHelper.java | 62 ++- .../connector/ResultproviderSimulation.java | 42 +- .../rwm/mocci/connector/SensorConnector.java | 202 +++---- .../cs/rwm/mocci/connector/package-info.java | 20 + de.ugoe.cs.rwm.mocci.connector/build.gradle | 33 +- .../rwm/mocci/connector/ComponentManager.java | 193 ++++--- .../rwm/mocci/connector/ConnectorFactory.java | 55 +- .../connector/DatagathererConnector.java | 93 ++-- .../connector/DataprocessorConnector.java | 93 ++-- .../MonitorablepropertyConnector.java | 39 +- .../OcciresultproviderConnector.java | 26 +- .../connector/ResultproviderConnector.java | 146 +++-- .../rwm/mocci/connector/SensorConnector.java | 227 ++++---- .../cs/rwm/mocci/connector/package-info.java | 20 + de.ugoe.cs.rwm.mocci.model.edit/build.gradle | 29 - .../provider/DatagathererItemProvider.java | 84 ++- .../provider/ResultproviderItemProvider.java | 85 ++- .../provider/SensorItemProvider.java | 82 ++- de.ugoe.cs.rwm.mocci.model/build.gradle | 27 - .../monitoring/impl/DatagathererImpl.java | 28 +- .../impl/MonitoringPackageImpl.java | 287 +++++----- .../monitoring/impl/ResultproviderImpl.java | 28 +- .../src-gen/monitoring/impl/SensorImpl.java | 28 +- .../monitoring/util/MonitoringValidator.java | 502 ++++++++++++------ .../java/de/ugoe/cs/rwm/mocci/AbsScaler.java | 1 + .../cs/rwm/mocci/RegistryAndLoggerSetup.java | 1 - .../ugoe/cs/rwm/mocci/ResolveProxyTest.java | 1 + 36 files changed, 1531 insertions(+), 1714 deletions(-) create mode 100644 de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java create mode 100644 de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java diff --git a/build.gradle b/build.gradle index c626d02..58789b6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,33 +1,14 @@ -// Apply the java-library plugin to add support for Java Library -apply plugin: 'eclipse' -apply plugin: 'java' -apply plugin: 'checkstyle' apply plugin: 'findbugs' -apply plugin: 'maven' apply plugin: "com.github.psxpaul.execfork" apply plugin: 'jacoco' apply plugin: 'com.github.johnrengelman.shadow' ext{ - //dependencies tocciVersion = '1.0.1' docciVersion = '1.0.1' cocciVersion = '1.0.0' } -subprojects { - apply plugin: 'java' - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - - -} - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - - buildscript { repositories { maven { @@ -40,6 +21,41 @@ buildscript { } } + +allprojects { + apply plugin: 'java' + apply plugin: 'eclipse' + apply plugin: 'maven' + + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + + repositories { + + mavenCentral() + maven { + url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/" + } + maven { + url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/" + } + } +} + +configure([project(':de.ugoe.cs.rwm.mocci.connector'), project(':de.ugoe.cs.rwm.mocci.connector.dummy'), rootProject]) { + apply plugin: 'checkstyle' + + checkstyle { + toolVersion = '8.2' + configFile = rootProject.file('config/checkstyle/checkstyle.xml') + configProperties = [ + 'checkstyle.cache.file': "${buildDir}/checkstyle.cache", + ] + ignoreFailures = false + showViolations = true + } +} + sourceSets { startMartServer { resources { @@ -50,21 +66,6 @@ sourceSets { eclipse.classpath.file.beforeMerged{ classpath -> classpath.entries.clear() } -// In this section you declare where to find the dependencies of your project -repositories { - // Use jcenter for resolving your dependencies. - // You can declare any Maven/Ivy/file repository here. - //mavenLocal() - mavenCentral() - jcenter() - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/" - } - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/" - } -} - dependencies { //occiware compile group: 'org.eclipse.cmf.occi', name: 'core', version: '1.0.0' diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/build.gradle b/de.ugoe.cs.rwm.mocci.connector.dummy/build.gradle index 65d47fc..95649a6 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/build.gradle +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/build.gradle @@ -1,49 +1,18 @@ -// Apply the java-library plugin to add support for Java Library -apply plugin : 'eclipse' -apply plugin: 'java' -apply plugin: 'maven' - - -// In this section you declare where to find the dependencies of your project -repositories { - // Use jcenter for resolving your dependencies. - // You can declare any Maven/Ivy/file repository here. - //mavenLocal() - mavenCentral() - - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/" - } - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/" - } -} - dependencies { - -//Require-Bundle: org.eclipse.core.runtime, -// org.eclipse.emf.ecore;visibility:=reexport, - - //org.eclipse.ocl.examples.codegen;visibility:=reexport, - //Nexus compile group: 'org.eclipse.ocl', name: 'pivot', version: '1.3.0' - //compile group: 'de.ugoe.cs.rwm.wocci', name: 'model', version: '1.0.0' //occiware compile group: 'org.eclipse.cmf.occi', name: 'core', version: '1.0.0' compile group: 'org.modmacao.occi', name: 'platform', version: '1.0.0' compile group: 'org.modmacao', name: 'cm', version: '1.0.0' compile group: 'org.modmacao.core', name: 'connector', version : '1.0.0' compile group: 'commons-io', name: 'commons-io', version: '2.6' - - - + //maven compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' - compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore', version: '2.15.0' + compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore', version: '2.15.0' compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore.xmi', version: '2.15.0' - testCompile group: 'junit', name: 'junit', version: '4.12' } diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java index 3b8d3e1..501c243 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java @@ -1,161 +1,142 @@ -package de.ugoe.cs.rwm.mocci.connector; +/** + * Copyright (c) 2018-2019 University of Goettingen + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de> + */ -import java.util.LinkedList; -import java.util.List; +package de.ugoe.cs.rwm.mocci.connector; -import org.eclipse.cmf.occi.core.Link; -import org.eclipse.cmf.occi.core.MixinBase; -import org.modmacao.cm.ConfigurationManagementTool; -import org.modmacao.cm.ansible.AnsibleCMTool; import org.modmacao.occi.platform.Component; import org.modmacao.occi.platform.Status; - public class ComponentManager { private Component comp; - + public ComponentManager(Component comp) { this.comp = comp; } - public void undeploy() { - switch(comp.getOcciComponentState().getValue()) { - - case Status.ACTIVE_VALUE: - - comp.stop(); - comp.setOcciComponentState(Status.UNDEPLOYED); - break; + switch (comp.getOcciComponentState().getValue()) { + case Status.ACTIVE_VALUE: - case Status.INACTIVE_VALUE: - comp.setOcciComponentState(Status.UNDEPLOYED); - break; - + comp.stop(); + comp.setOcciComponentState(Status.UNDEPLOYED); + break; - case Status.DEPLOYED_VALUE: - comp.setOcciComponentState(Status.UNDEPLOYED); - break; + case Status.INACTIVE_VALUE: + comp.setOcciComponentState(Status.UNDEPLOYED); + break; + case Status.DEPLOYED_VALUE: + comp.setOcciComponentState(Status.UNDEPLOYED); + break; - case Status.ERROR_VALUE: - comp.setOcciComponentState(Status.UNDEPLOYED); - break; + case Status.ERROR_VALUE: + comp.setOcciComponentState(Status.UNDEPLOYED); + break; - default: - break; + default: + break; } } + // End of user code // Start of user code Publisher_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ - public void deploy() - { - int status = -1; + public void deploy() { // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.UNDEPLOYED_VALUE: comp.setOcciComponentState(Status.DEPLOYED); break; - + default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ - public void configure() - { - int status = -1; + public void configure() { // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.DEPLOYED_VALUE: - comp.setOcciComponentState(Status.INACTIVE); + comp.setOcciComponentState(Status.INACTIVE); break; - + default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ - public void start() - { - int status = -1; + public void start() { // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.INACTIVE_VALUE: - comp.setOcciComponentState(Status.ACTIVE); + comp.setOcciComponentState(Status.ACTIVE); break; - case Status.UNDEPLOYED_VALUE: - comp.setOcciComponentState(Status.ERROR); - break; + comp.setOcciComponentState(Status.ERROR); + break; default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ - public void stop() - { - int status = -1; + public void stop() { // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.ACTIVE_VALUE: - + comp.setOcciComponentState(Status.INACTIVE); - + break; default: break; -} + } } // End of user code - - private boolean assertCompsStatusEquals(List<Component> components, Status status) { - for (Component component: components) { - if (component.getOcciComponentState().getValue() != status.getValue()) { - return false; - } - } - return true; -} - -} \ No newline at end of file + +} \ No newline at end of file diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java index c9f4312..3f587b6 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java @@ -1,33 +1,29 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Thu Jan 03 13:17:39 CET 2019 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ -package de.ugoe.cs.rwm.mocci.connector; -import monitoring.Dataprocessor; +package de.ugoe.cs.rwm.mocci.connector; /** - * Connector EFactory for the OCCI extension: - * - name: monitoring - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# + * Connector EFactory for the OCCI extension: - name: monitoring - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# */ -public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl -{ +public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl { /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: sensor - * - title: Sensor Component + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: sensor - title: Sensor + * Component */ @Override public monitoring.Sensor createSensor() { @@ -35,10 +31,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: datagatherer - * - title: DataGatherer Resource + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: datagatherer - title: + * DataGatherer Resource */ @Override public monitoring.Datagatherer createDatagatherer() { @@ -46,10 +41,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: processor - * - title: Processor Resource + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: processor - title: Processor + * Resource */ @Override public monitoring.Dataprocessor createDataprocessor() { @@ -57,10 +51,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: publisher - * - title: Publisher Resource + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: publisher - title: Publisher + * Resource */ @Override public monitoring.Resultprovider createResultprovider() { @@ -68,22 +61,19 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: martpublisher - * - title: MartPublisher Mixin + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: martpublisher - title: + * MartPublisher Mixin */ @Override public monitoring.Occiresultprovider createOcciresultprovider() { return new OcciresultproviderConnector(); } - /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: monitoringproperty - * - title: MonitoringProperty Component + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: monitoringproperty - title: + * MonitoringProperty Component */ @Override public monitoring.Monitorableproperty createMonitorableproperty() { diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java index a645fc4..1cbfc63 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java @@ -1,33 +1,30 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 19 10:30:40 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.modmacao.occi.platform.Status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: datagatherer - * - title: DataGatherer Resource + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: datagatherer - title: + * DataGatherer Resource */ -public class DatagathererConnector extends monitoring.impl.DatagathererImpl -{ +public class DatagathererConnector extends monitoring.impl.DatagathererImpl { /** * Initialize the logger. */ @@ -37,8 +34,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl /** * Constructs a datagatherer connector. */ - DatagathererConnector() - { + DatagathererConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } @@ -46,14 +42,13 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl // // OCCI CRUD callback operations. // - + // Start of user code DatagathererocciCreate /** * Called when this Datagatherer instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -64,8 +59,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl * Called when this Datagatherer instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -76,8 +70,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl * Called when this Datagatherer instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -88,8 +81,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl * Called when this Datagatherer instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); // TODO: Implement this callback or remove this method. } @@ -101,128 +93,116 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl // Start of user code Datagatherer_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { LOGGER.debug("Action configure() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.DEPLOYED_VALUE: - this.setOcciComponentState(Status.INACTIVE); + this.setOcciComponentState(Status.INACTIVE); break; - + default: break; } } + // End of user code // Start of user code Datagatherer_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.UNDEPLOYED_VALUE: this.setOcciComponentState(Status.DEPLOYED); break; - + default: break; } } + // End of user code // Start of user code Datagatherer_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.ACTIVE_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.INACTIVE_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.DEPLOYED_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.ERROR_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; default: break; -} + } } + // End of user code // Start of user code Datagatherer_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); setOcciComponentState(Status.INACTIVE); } + // End of user code // Start of user code Datagatherer_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { LOGGER.debug("Action start() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.INACTIVE_VALUE: - this.setOcciComponentState(Status.ACTIVE); + this.setOcciComponentState(Status.ACTIVE); break; - case Status.UNDEPLOYED_VALUE: - this.setOcciComponentState(Status.ACTIVE); - break; + this.setOcciComponentState(Status.ACTIVE); + break; default: break; - - } + + } } // End of user code - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java index 4271abf..460c502 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java @@ -1,34 +1,30 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 19 10:30:40 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; -import org.eclipse.cmf.occi.core.AttributeState; import org.modmacao.occi.platform.Status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: processor - * - title: Processor Resource + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: processor - title: Processor + * Resource */ -public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl -{ +public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl { /** * Initialize the logger. */ @@ -38,8 +34,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl /** * Constructs a processor connector. */ - DataprocessorConnector() - { + DataprocessorConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } @@ -47,14 +42,13 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl // // OCCI CRUD callback operations. // - + // Start of user code ProcessorocciCreate /** * Called when this Processor instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -65,8 +59,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl * Called when this Processor instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -77,8 +70,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl * Called when this Processor instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -89,8 +81,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl * Called when this Processor instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); // TODO: Implement this callback or remove this method. } @@ -102,128 +93,116 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl // Start of user code Processor_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { LOGGER.debug("Action configure() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.DEPLOYED_VALUE: - this.setOcciComponentState(Status.INACTIVE); + this.setOcciComponentState(Status.INACTIVE); break; - + default: break; } } + // End of user code // Start of user code Processor_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.UNDEPLOYED_VALUE: this.setOcciComponentState(Status.DEPLOYED); break; - + default: break; } } + // End of user code // Start of user code Processor_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.ACTIVE_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.INACTIVE_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.DEPLOYED_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.ERROR_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; default: break; -} + } } + // End of user code // Start of user code Processor_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); setOcciComponentState(Status.INACTIVE); } + // End of user code // Start of user code Processor_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { LOGGER.debug("Action start() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.INACTIVE_VALUE: - this.setOcciComponentState(Status.ACTIVE); + this.setOcciComponentState(Status.ACTIVE); break; - case Status.UNDEPLOYED_VALUE: - this.setOcciComponentState(Status.ACTIVE); - break; + this.setOcciComponentState(Status.ACTIVE); + break; default: break; - - } + + } } // End of user code - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java index ac8d9a6..eac5d69 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java @@ -1,32 +1,29 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Thu Jan 03 13:17:39 CET 2019 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: monitoringproperty - * - title: MonitoringProperty Component + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: monitoringproperty - title: + * MonitoringProperty Component */ -public class MonitorablepropertyConnector extends monitoring.impl.MonitorablepropertyImpl -{ +public class MonitorablepropertyConnector extends monitoring.impl.MonitorablepropertyImpl { /** * Initialize the logger. */ @@ -36,8 +33,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro /** * Constructs a monitoringproperty connector. */ - MonitorablepropertyConnector() - { + MonitorablepropertyConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } @@ -45,14 +41,13 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro // // OCCI CRUD callback operations. // - + // Start of user code MonitoringpropertyocciCreate /** * Called when this Monitoringproperty instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -63,8 +58,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro * Called when this Monitoringproperty instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -75,8 +69,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro * Called when this Monitoringproperty instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -87,8 +80,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro * Called when this Monitoringproperty instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); // TODO: Implement this callback or remove this method. } @@ -98,7 +90,4 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro // Monitoringproperty actions. // - - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java index 6b2ec51..41a4cd0 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java @@ -1,32 +1,29 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Thu Jan 03 13:17:39 CET 2019 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: martpublisher - * - title: MartPublisher Mixin + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: martpublisher - title: + * MartPublisher Mixin */ -public class OcciresultproviderConnector extends monitoring.impl.OcciresultproviderImpl -{ +public class OcciresultproviderConnector extends monitoring.impl.OcciresultproviderImpl { /** * Initialize the logger. */ @@ -36,15 +33,10 @@ public class OcciresultproviderConnector extends monitoring.impl.Occiresultprovi /** * Constructs a martpublisher connector. */ - OcciresultproviderConnector() - { + OcciresultproviderConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } // End of user code - - - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java index 22a8150..09d832d 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java @@ -1,80 +1,62 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 19 10:30:40 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; -import java.util.LinkedList; -import java.util.List; import java.util.NoSuchElementException; -import org.eclipse.cmf.occi.core.AttributeState; import org.eclipse.cmf.occi.core.Link; -import org.eclipse.cmf.occi.core.MixinBase; -import org.eclipse.cmf.occi.core.Resource; -import org.eclipse.cmf.occi.core.impl.OCCIFactoryImpl; -import org.modmacao.occi.platform.Component; import org.modmacao.occi.platform.Status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import monitoring.Monitorableproperty; -import monitoring.Occiresultprovider; import monitoring.Sensor; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: publisher - * - title: Publisher Resource + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: publisher - title: Publisher + * Resource */ -public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl -{ +public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl { /** * Initialize the logger. */ private static Logger LOGGER = LoggerFactory.getLogger(ResultproviderConnector.class); private Thread simulation; - //private Occiresultprovider occiResProv; - + // private Occiresultprovider occiResProv; // Start of user code Publisherconnector_constructor /** * Constructs a publisher connector. */ - ResultproviderConnector() - { + ResultproviderConnector() { LOGGER.debug("Constructor called on " + this); - - + } // End of user code // // OCCI CRUD callback operations. // - - - // Start of user code PublisherocciCreate /** * Called when this Publisher instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. @@ -86,12 +68,11 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl * Called when this Publisher instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); - - if(this.getOcciComponentState().getValue() == Status.ACTIVE.getValue()) { - if(simulation == null) { + + if (this.getOcciComponentState().getValue() == Status.ACTIVE.getValue()) { + if (simulation == null) { ResultproviderSimulation sim = new ResultproviderSimulation(getMonProp(getSensor())); simulation = new Thread(sim); simulation.start(); @@ -106,8 +87,7 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl * Called when this Publisher instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -117,11 +97,11 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl /** * Called when this Publisher instance will be deleted. */ + @SuppressWarnings("deprecation") @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); - if(simulation!= null) { + if (simulation != null) { simulation.stop(); } // TODO: Implement this callback or remove this method. @@ -134,167 +114,155 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl // Start of user code Publisher_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { LOGGER.debug("Action configure() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.DEPLOYED_VALUE: - this.setOcciComponentState(Status.INACTIVE); + this.setOcciComponentState(Status.INACTIVE); break; - + default: break; } // TODO: Implement how to configure this publisher. } + // End of user code // Start of user code Publisher_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.UNDEPLOYED_VALUE: this.setOcciComponentState(Status.DEPLOYED); break; - + default: break; -} - + } + } // End of user code // Start of user code Publisher_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @SuppressWarnings("deprecation") @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.ACTIVE_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); - if(simulation!= null) { + if (simulation != null) { simulation.stop(); } break; - case Status.INACTIVE_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.DEPLOYED_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; - case Status.ERROR_VALUE: this.setOcciComponentState(Status.UNDEPLOYED); break; default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @SuppressWarnings("deprecation") @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); - if(simulation!= null) { + if (simulation != null) { simulation.stop(); } setOcciComponentState(Status.INACTIVE); } + // End of user code // Start of user code Publisher_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { LOGGER.debug("Action start() called on " + this); - switch(this.getOcciComponentState().getValue()) { + switch (this.getOcciComponentState().getValue()) { case Status.INACTIVE_VALUE: - this.setOcciComponentState(Status.ACTIVE); - if(simulation == null) { - ResultproviderSimulation sim = new ResultproviderSimulation(getMonProp(getSensor())); - simulation = new Thread(sim); - simulation.start(); - } + this.setOcciComponentState(Status.ACTIVE); + if (simulation == null) { + ResultproviderSimulation sim = new ResultproviderSimulation(getMonProp(getSensor())); + simulation = new Thread(sim); + simulation.start(); + } break; - case Status.UNDEPLOYED_VALUE: - this.setOcciComponentState(Status.ACTIVE); - if(simulation == null) { - ResultproviderSimulation sim = new ResultproviderSimulation(getMonProp(getSensor())); - simulation = new Thread(sim); - simulation.start(); - } - break; + this.setOcciComponentState(Status.ACTIVE); + if (simulation == null) { + ResultproviderSimulation sim = new ResultproviderSimulation(getMonProp(getSensor())); + simulation = new Thread(sim); + simulation.start(); + } + break; default: break; - - } + + } } - + // End of user code - - + private Sensor getSensor() { - for(Link link: this.getRlinks()) { - if(link.getSource() instanceof Sensor) { + for (Link link : this.getRlinks()) { + if (link.getSource() instanceof Sensor) { return ((Sensor) link.getSource()); } } throw new NoSuchElementException("No containing sensor found!"); } - + private Monitorableproperty getMonProp(Sensor sensor) { - for(Link link: sensor.getLinks()) { - if(link instanceof Monitorableproperty) { + for (Link link : sensor.getLinks()) { + if (link instanceof Monitorableproperty) { return ((Monitorableproperty) link); } } throw new NoSuchElementException("No monitorableproperty found in sensor!"); } - -} + +} diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderHelper.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderHelper.java index da357ff..0f9ca6d 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderHelper.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderHelper.java @@ -1,3 +1,14 @@ +/** + * Copyright (c) 2018-2019 University of Goettingen + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de> + */ + package de.ugoe.cs.rwm.mocci.connector; import java.io.IOException; @@ -7,43 +18,44 @@ import java.util.Properties; public final class ResultproviderHelper { Properties props; private final static String FILENAME = "resultprovider.properties"; - + public ResultproviderHelper() { loadProperties(); } - + /** * Getter method for providing the properties of this ResultProviderHelper. * Properties will be read from local file resultprovider.properties. + * * @return The properties */ public Properties getProperties() { - if (props == null) + if (props == null) { loadProperties(); - + } + return props; -} - + } + private void loadProperties() { props = new Properties(); - InputStream input = null; - - try { - input = this.getClass().getClassLoader().getResourceAsStream(FILENAME); - props.load(input); - - } catch (IOException ex) { - ex.printStackTrace(); - } finally{ - if(input!=null){ - try { - input.close(); - } catch (IOException e) { - e.printStackTrace(); + InputStream input = null; + + try { + input = this.getClass().getClassLoader().getResourceAsStream(FILENAME); + props.load(input); + + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (input != null) { + try { + input.close(); + } catch (IOException e) { + e.printStackTrace(); + } } - } - } -} - - + } + } + } diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderSimulation.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderSimulation.java index a8f560a..6f780b4 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderSimulation.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderSimulation.java @@ -1,9 +1,19 @@ +/** + * Copyright (c) 2018-2019 University of Goettingen + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de> + */ + package de.ugoe.cs.rwm.mocci.connector; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Random; import java.util.concurrent.ThreadLocalRandom; import org.eclipse.cmf.occi.core.AttributeState; @@ -13,52 +23,50 @@ import org.slf4j.LoggerFactory; import monitoring.Monitorableproperty; -public class ResultproviderSimulation implements Runnable{ +public class ResultproviderSimulation implements Runnable { private static Logger LOGGER = LoggerFactory.getLogger(ResultproviderSimulation.class); private Monitorableproperty monProp; private OCCIFactoryImpl factory = new OCCIFactoryImpl(); - private static Random random; private int interval; private List<String> results; - + public ResultproviderSimulation(Monitorableproperty monProp) { this.monProp = monProp; String property = getProperty(monProp.getMonitoringProperty()); List<String> items = new ArrayList<String>(Arrays.asList(property.split("\\s*,\\s*"))); - this.interval = Integer.parseInt(items.get(items.size()-1)); - String lastItem = items.get(items.size()-1); - items.remove(items.get(items.size()-1)); + this.interval = Integer.parseInt(items.get(items.size() - 1)); + items.remove(items.get(items.size() - 1)); this.results = items; - LOGGER.info("Creating Simulation for: " + monProp.getMonitoringProperty() + "; with values: " + results + "; and interval: " + interval); + LOGGER.info("Creating Simulation for: " + monProp.getMonitoringProperty() + "; with values: " + results + + "; and interval: " + interval); } - + @Override public void run() { - while(true) { + while (true) { try { Thread.sleep(interval); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } - + AttributeState monPropAttr = factory.createAttributeState(); monPropAttr.setName("monitoring.result"); int randomElementIndex = ThreadLocalRandom.current().nextInt(results.size()); String value = results.get(randomElementIndex); monPropAttr.setValue(value); monProp.setMonitoringResult(value); - LOGGER.info("MonProp: " + monProp.getMonitoringProperty() + ", set to: " + value + "(" +monProp.getId()+")" ); + LOGGER.info( + "MonProp: " + monProp.getMonitoringProperty() + ", set to: " + value + "(" + monProp.getId() + ")"); monProp.getAttributes().add(monPropAttr); } - + } - + private String getProperty(String monitoringProperty) { return new ResultproviderHelper().getProperties().getProperty(monitoringProperty); - + } } - - diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java index 08b97c4..0e4b6fe 100644 --- a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java @@ -1,44 +1,37 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 05 12:12:23 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import java.util.LinkedList; import java.util.List; import org.eclipse.cmf.occi.core.Link; -import org.modmacao.cm.ConfigurationManagementTool; -import org.modmacao.cm.ansible.AnsibleCMTool; -import org.modmacao.core.connector.ApplicationConnector; import org.modmacao.occi.platform.Component; import org.modmacao.occi.platform.Componentlink; import org.modmacao.occi.platform.Status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: sensor - * - title: Sensor Component + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: sensor - title: Sensor + * Component */ -public class SensorConnector extends monitoring.impl.SensorImpl -{ - - +public class SensorConnector extends monitoring.impl.SensorImpl { + /** * Initialize the logger. */ @@ -48,8 +41,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl /** * Constructs a sensor connector. */ - SensorConnector() - { + SensorConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } @@ -57,14 +49,13 @@ public class SensorConnector extends monitoring.impl.SensorImpl // // OCCI CRUD callback operations. // - + // Start of user code SensorocciCreate /** * Called when this Sensor instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -75,8 +66,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl * Called when this Sensor instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -87,8 +77,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl * Called when this Sensor instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -99,8 +88,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl * Called when this Sensor instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); // TODO: Implement this callback or remove this method. } @@ -112,224 +100,202 @@ public class SensorConnector extends monitoring.impl.SensorImpl // Start of user code Sensor_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.UNDEPLOYED_VALUE: LOGGER.debug("Fire transition(state=undeployed, action=\"deploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.deploy(); } - - setOcciAppState(Status.DEPLOYED); -} + setOcciAppState(Status.DEPLOYED); + + } } + // End of user code // Start of user code Sensor_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.ACTIVE_VALUE: LOGGER.debug("Fire transition(state=active, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.stop(); } this.stop(); - - for (Component component: this.getConnectedComponents()) { + + for (Component component : this.getConnectedComponents()) { component.undeploy(); } - setOcciAppState(Status.UNDEPLOYED); + setOcciAppState(Status.UNDEPLOYED); break; case Status.INACTIVE_VALUE: LOGGER.debug("Fire transition(state=inactive, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.undeploy(); } - - setOcciAppState(Status.UNDEPLOYED); + + setOcciAppState(Status.UNDEPLOYED); break; case Status.DEPLOYED_VALUE: LOGGER.debug("Fire transition(state=deployed, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.undeploy(); } - - setOcciAppState(Status.UNDEPLOYED); + + setOcciAppState(Status.UNDEPLOYED); break; case Status.ERROR_VALUE: LOGGER.debug("Fire transition(state=error, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.undeploy(); } - - setOcciAppState(Status.UNDEPLOYED); + + setOcciAppState(Status.UNDEPLOYED); break; default: break; -} + } } + // End of user code // Start of user code Sensor_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.ACTIVE_VALUE: LOGGER.debug("Fire transition(state=active, action=\"stop\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.stop(); } - - setOcciAppState(Status.INACTIVE); + + setOcciAppState(Status.INACTIVE); break; default: break; -} + } // TODO: Implement how to stop this sensor. } + // End of user code // Start of user code Sensor_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { - int status = -1; + public void configure() { LOGGER.debug("Action configure() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.DEPLOYED_VALUE: LOGGER.debug("Fire transition(state=deployed, action=\"configure\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.configure(); } - - - setOcciAppState(Status.INACTIVE); + + setOcciAppState(Status.INACTIVE); break; default: break; -} + } } + // End of user code // Start of user code Sensor_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { - int status = -1; + public void start() { LOGGER.debug("Action start() called on " + this); - + // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.INACTIVE_VALUE: LOGGER.debug("Fire transition(state=inactive, action=\"start\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.start(); } - - setOcciAppState(Status.ACTIVE); - break; + setOcciAppState(Status.ACTIVE); + break; case Status.UNDEPLOYED_VALUE: LOGGER.debug("Fire transition(state=undeployed, action=\"start\")..."); // First deploy components - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.deploy(); } this.deploy(); - + // then configure them - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.configure(); } this.configure(); - + // then start them - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.start(); } - setOcciAppState(Status.ACTIVE); + setOcciAppState(Status.ACTIVE); break; default: break; -} + } } + // End of user code private List<Component> getConnectedComponents() { LinkedList<Component> connectedComponents = new LinkedList<Component>(); - for (Link link: this.getLinks()) { + for (Link link : this.getLinks()) { if (link instanceof Componentlink) { connectedComponents.add((Component) link.getTarget()); } } return connectedComponents; - - } - - private boolean assertCompsStatusEquals(List<Component> components, Status status) { - for (Component component: components) { - if (component.getOcciComponentState().getValue() != status.getValue()) { - LOGGER.debug("Missmatching state of component " + component.getTitle() + " detected. " - + "Expected " + status.getName() + " but was " - + component.getOcciComponentState().getName() + "."); - return false; - } - } - return true; -} + } -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java new file mode 100644 index 0000000..0120906 --- /dev/null +++ b/de.ugoe.cs.rwm.mocci.connector.dummy/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2019 University of Goettingen. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de> + *******************************************************************************/ +/** + * + */ +/** + * Main package for mocci connector dummy. + * + * @author erbel + * + */ +package de.ugoe.cs.rwm.mocci.connector; \ No newline at end of file diff --git a/de.ugoe.cs.rwm.mocci.connector/build.gradle b/de.ugoe.cs.rwm.mocci.connector/build.gradle index 8ada62e..6647d9b 100644 --- a/de.ugoe.cs.rwm.mocci.connector/build.gradle +++ b/de.ugoe.cs.rwm.mocci.connector/build.gradle @@ -1,34 +1,6 @@ -// Apply the java-library plugin to add support for Java Library -apply plugin : 'eclipse' -apply plugin: 'java' -apply plugin: 'maven' - - -// In this section you declare where to find the dependencies of your project -repositories { - // Use jcenter for resolving your dependencies. - // You can declare any Maven/Ivy/file repository here. - //mavenLocal() - mavenCentral() - - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/" - } - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/" - } -} - dependencies { - -//Require-Bundle: org.eclipse.core.runtime, -// org.eclipse.emf.ecore;visibility:=reexport, - - //org.eclipse.ocl.examples.codegen;visibility:=reexport, - //Nexus compile group: 'org.eclipse.ocl', name: 'pivot', version: '1.3.0' - //compile group: 'de.ugoe.cs.rwm.wocci', name: 'model', version: '1.0.0' //occiware compile group: 'org.eclipse.cmf.occi', name: 'core', version: '1.0.0' compile group: 'org.modmacao.occi', name: 'platform', version: '1.0.0' @@ -37,14 +9,11 @@ dependencies { compile group: 'org.modmacao.core', name: 'connector', version : '1.0.0' compile group: 'commons-io', name: 'commons-io', version: '2.6' - - //maven compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' - compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore', version: '2.15.0' + compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore', version: '2.15.0' compile group: 'org.eclipse.emf', name: 'org.eclipse.emf.ecore.xmi', version: '2.15.0' - testCompile group: 'junit', name: 'junit', version: '4.12' } diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java index 7ec0b68..05e5f3a 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ComponentManager.java @@ -15,211 +15,206 @@ import modmacao.Installationdependency; public class ComponentManager { - private ConfigurationManagementTool cmtool = new AnsibleCMTool(); private Component comp; - + public ComponentManager(Component comp) { this.comp = comp; } - public void undeploy() { - switch(comp.getOcciComponentState().getValue()) { - - case Status.ACTIVE_VALUE: - - comp.stop(); - cmtool.undeploy(comp); - comp.setOcciComponentState(Status.UNDEPLOYED); - break; - + switch (comp.getOcciComponentState().getValue()) { - case Status.INACTIVE_VALUE: - cmtool.undeploy(comp); - comp.setOcciComponentState(Status.UNDEPLOYED); - break; + case Status.ACTIVE_VALUE: + comp.stop(); + cmtool.undeploy(comp); + comp.setOcciComponentState(Status.UNDEPLOYED); + break; - case Status.DEPLOYED_VALUE: - cmtool.undeploy(comp); - comp.setOcciComponentState(Status.UNDEPLOYED); - break; + case Status.INACTIVE_VALUE: + cmtool.undeploy(comp); + comp.setOcciComponentState(Status.UNDEPLOYED); + break; + case Status.DEPLOYED_VALUE: + cmtool.undeploy(comp); + comp.setOcciComponentState(Status.UNDEPLOYED); + break; - case Status.ERROR_VALUE: - cmtool.undeploy(comp); - comp.setOcciComponentState(Status.UNDEPLOYED); - break; + case Status.ERROR_VALUE: + cmtool.undeploy(comp); + comp.setOcciComponentState(Status.UNDEPLOYED); + break; - default: - break; + default: + break; } } + // End of user code // Start of user code Publisher_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ - public void deploy() - { + public void deploy() { int status = -1; // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.UNDEPLOYED_VALUE: - for (Component component: getInstallDependendComps()) { + for (Component component : getInstallDependendComps()) { component.deploy(); } status = cmtool.deploy(comp); - - if (status == 0 && assertCompsStatusEquals(getInstallDependendComps(), Status.DEPLOYED)) + + if (status == 0 && assertCompsStatusEquals(getInstallDependendComps(), Status.DEPLOYED)) { comp.setOcciComponentState(Status.DEPLOYED); - else + } else { comp.setOcciComponentState(Status.ERROR); + } break; default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ - public void configure() - { + public void configure() { int status = -1; // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.DEPLOYED_VALUE: - for (Component component: getInstallDependendComps()) { + for (Component component : getInstallDependendComps()) { component.configure(); } status = cmtool.configure(comp); - - if (status == 0 && assertCompsStatusEquals(getInstallDependendComps(), Status.INACTIVE)) + + if (status == 0 && assertCompsStatusEquals(getInstallDependendComps(), Status.INACTIVE)) { comp.setOcciComponentState(Status.INACTIVE); - else + } else { comp.setOcciComponentState(Status.ERROR); + } break; default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ - public void start() - { + public void start() { int status = -1; // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.INACTIVE_VALUE: - for (Component component: getExecutionDependendComps()) { + for (Component component : getExecutionDependendComps()) { component.start(); } - + status = cmtool.start(comp); - - if (status == 0 && assertCompsStatusEquals(getExecutionDependendComps(), Status.ACTIVE)) + + if (status == 0 && assertCompsStatusEquals(getExecutionDependendComps(), Status.ACTIVE)) { comp.setOcciComponentState(Status.ACTIVE); - else + } else { comp.setOcciComponentState(Status.ERROR); - - break; + } + break; case Status.UNDEPLOYED_VALUE: - for (Component component: getInstallDependendComps()) { + for (Component component : getInstallDependendComps()) { component.deploy(); } comp.deploy(); - - for (Component component: getInstallDependendComps()) { + + for (Component component : getInstallDependendComps()) { component.configure(); } comp.configure(); - - for (Component component: getExecutionDependendComps()) { + + for (Component component : getExecutionDependendComps()) { component.start(); } - + status = cmtool.start(comp); - - if (status == 0 && assertCompsStatusEquals(getExecutionDependendComps(), Status.ACTIVE)) + + if (status == 0 && assertCompsStatusEquals(getExecutionDependendComps(), Status.ACTIVE)) { comp.setOcciComponentState(Status.ACTIVE); - else + } else { comp.setOcciComponentState(Status.ERROR); + } default: break; -} + } } + // End of user code // Start of user code Publisher_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ - public void stop() - { + public void stop() { + @SuppressWarnings("unused") int status = -1; // Component State Machine. - switch(comp.getOcciComponentState().getValue()) { + switch (comp.getOcciComponentState().getValue()) { case Status.ACTIVE_VALUE: - + status = cmtool.stop(comp); - + comp.setOcciComponentState(Status.INACTIVE); - + break; default: break; -} + } } // End of user code - - private List<Component> getInstallDependendComps(){ + + private List<Component> getInstallDependendComps() { LinkedList<Component> dependendComponents = new LinkedList<Component>(); - for (Link link: comp.getLinks()) { - for (MixinBase mixin: link.getParts()) { + for (Link link : comp.getLinks()) { + for (MixinBase mixin : link.getParts()) { if (mixin instanceof Installationdependency) { dependendComponents.add((Component) link.getTarget()); break; } } } - return dependendComponents; + return dependendComponents; } - - private List<Component> getExecutionDependendComps(){ + + private List<Component> getExecutionDependendComps() { LinkedList<Component> dependendComponents = new LinkedList<Component>(); - for (Link link: comp.getLinks()) { - for (MixinBase mixin: link.getParts()) { + for (Link link : comp.getLinks()) { + for (MixinBase mixin : link.getParts()) { if (mixin instanceof Executiondependency) { dependendComponents.add((Component) link.getTarget()); break; @@ -228,14 +223,14 @@ public class ComponentManager { } return dependendComponents; } - + private boolean assertCompsStatusEquals(List<Component> components, Status status) { - for (Component component: components) { + for (Component component : components) { if (component.getOcciComponentState().getValue() != status.getValue()) { return false; } - } + } return true; -} + } -} \ No newline at end of file +} \ No newline at end of file diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java index 812be75..1a111a4 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ConnectorFactory.java @@ -1,31 +1,29 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Jan 02 16:14:48 CET 2019 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; /** - * Connector EFactory for the OCCI extension: - * - name: monitoring - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# + * Connector EFactory for the OCCI extension: - name: monitoring - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# */ -public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl -{ +public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl { /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: sensor - * - title: Sensor Component + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: sensor - title: Sensor + * Component */ @Override public monitoring.Sensor createSensor() { @@ -33,10 +31,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: datagatherer - * - title: DataGatherer Resource + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: datagatherer - title: + * DataGatherer Resource */ @Override public monitoring.Datagatherer createDatagatherer() { @@ -44,10 +41,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: processor - * - title: Processor Resource + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: processor - title: Processor + * Resource */ @Override public monitoring.Dataprocessor createDataprocessor() { @@ -55,10 +51,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: publisher - * - title: Publisher Resource + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: publisher - title: Publisher + * Resource */ @Override public monitoring.Resultprovider createResultprovider() { @@ -66,10 +61,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: monitoringproperty - * - title: MonitoringProperty Component + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: monitoringproperty - title: + * MonitoringProperty Component */ @Override public monitoring.Monitorableproperty createMonitorableproperty() { @@ -77,10 +71,9 @@ public class ConnectorFactory extends monitoring.impl.MonitoringFactoryImpl } /** - * EFactory method for OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: martpublisher - * - title: MartPublisher Mixin + * EFactory method for OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: martpublisher - title: + * MartPublisher Mixin */ @Override public monitoring.Occiresultprovider createOcciresultprovider() { diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java index f21b2b4..f424861 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DatagathererConnector.java @@ -1,43 +1,40 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 19 11:10:50 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: datagatherer - * - title: DataGatherer Resource + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: datagatherer - title: + * DataGatherer Resource */ -public class DatagathererConnector extends monitoring.impl.DatagathererImpl -{ +public class DatagathererConnector extends monitoring.impl.DatagathererImpl { /** * Initialize the logger. */ private static Logger LOGGER = LoggerFactory.getLogger(DatagathererConnector.class); private ComponentManager compMan; + // Start of user code Datagathererconnector_constructor /** * Constructs a datagatherer connector. */ - DatagathererConnector() - { + DatagathererConnector() { LOGGER.debug("Constructor called on " + this); this.compMan = new ComponentManager(this); // TODO: Implement this constructor. @@ -46,14 +43,13 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl // // OCCI CRUD callback operations. // - + // Start of user code DatagathererocciCreate /** * Called when this Datagatherer instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -64,8 +60,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl * Called when this Datagatherer instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -76,8 +71,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl * Called when this Datagatherer instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -88,8 +82,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl * Called when this Datagatherer instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); this.stop(); this.undeploy(); @@ -102,80 +95,72 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl // Start of user code Datagatherer_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); compMan.deploy(); // TODO: Implement how to deploy this datagatherer. } + // End of user code // Start of user code Datagatherer_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); compMan.stop(); // TODO: Implement how to stop this datagatherer. } + // End of user code // Start of user code Datagatherer_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { LOGGER.debug("Action start() called on " + this); compMan.start(); // TODO: Implement how to start this datagatherer. } + // End of user code // Start of user code Datagatherer_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { LOGGER.debug("Action configure() called on " + this); compMan.configure(); // TODO: Implement how to configure this datagatherer. } + // End of user code // Start of user code Datagatherer_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); compMan.undeploy(); // TODO: Implement how to undeploy this datagatherer. } // End of user code - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java index e219e5c..af7b637 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/DataprocessorConnector.java @@ -1,43 +1,40 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 19 11:10:50 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: processor - * - title: Processor Resource + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: processor - title: Processor + * Resource */ -public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl -{ +public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl { /** * Initialize the logger. */ private static Logger LOGGER = LoggerFactory.getLogger(DataprocessorConnector.class); private ComponentManager compMan; + // Start of user code Processorconnector_constructor /** * Constructs a processor connector. */ - DataprocessorConnector() - { + DataprocessorConnector() { LOGGER.debug("Constructor called on " + this); this.compMan = new ComponentManager(this); // TODO: Implement this constructor. @@ -46,14 +43,13 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl // // OCCI CRUD callback operations. // - + // Start of user code ProcessorocciCreate /** * Called when this Processor instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -64,8 +60,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl * Called when this Processor instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -76,8 +71,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl * Called when this Processor instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -88,8 +82,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl * Called when this Processor instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); this.stop(); this.undeploy(); @@ -102,81 +95,73 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl // Start of user code Processor_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); compMan.deploy(); // TODO: Implement how to deploy this processor. } + // End of user code // Start of user code Processor_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); compMan.stop(); // TODO: Implement how to stop this processor. } + // End of user code // Start of user code Processor_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { LOGGER.debug("Action start() called on " + this); compMan.start(); // TODO: Implement how to start this processor. } + // End of user code // Start of user code Processor_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { LOGGER.debug("Action configure() called on " + this); compMan.configure(); // TODO: Implement how to configure this processor. } + // End of user code // Start of user code Processor_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); compMan.undeploy(); // TODO: Implement how to undeploy this processor. } // End of user code - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java index bb67a61..05eb439 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/MonitorablepropertyConnector.java @@ -1,32 +1,29 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Jan 02 16:14:48 CET 2019 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: monitoringproperty - * - title: MonitoringProperty Component + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: monitoringproperty - title: + * MonitoringProperty Component */ -public class MonitorablepropertyConnector extends monitoring.impl.MonitorablepropertyImpl -{ +public class MonitorablepropertyConnector extends monitoring.impl.MonitorablepropertyImpl { /** * Initialize the logger. */ @@ -36,8 +33,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro /** * Constructs a monitoringproperty connector. */ - MonitorablepropertyConnector() - { + MonitorablepropertyConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } @@ -45,14 +41,13 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro // // OCCI CRUD callback operations. // - + // Start of user code MonitoringpropertyocciCreate /** * Called when this Monitoringproperty instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -63,8 +58,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro * Called when this Monitoringproperty instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -75,8 +69,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro * Called when this Monitoringproperty instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -87,8 +80,7 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro * Called when this Monitoringproperty instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); // TODO: Implement this callback or remove this method. } @@ -98,7 +90,4 @@ public class MonitorablepropertyConnector extends monitoring.impl.Monitorablepro // Monitoringproperty actions. // - - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java index 7bcf424..be84868 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/OcciresultproviderConnector.java @@ -1,32 +1,29 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Jan 02 16:14:48 CET 2019 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: martpublisher - * - title: MartPublisher Mixin + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: martpublisher - title: + * MartPublisher Mixin */ -public class OcciresultproviderConnector extends monitoring.impl.OcciresultproviderImpl -{ +public class OcciresultproviderConnector extends monitoring.impl.OcciresultproviderImpl { /** * Initialize the logger. */ @@ -36,15 +33,10 @@ public class OcciresultproviderConnector extends monitoring.impl.Occiresultprovi /** * Constructs a martpublisher connector. */ - OcciresultproviderConnector() - { + OcciresultproviderConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } // End of user code - - - - -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java index 4b5daa4..45a6b95 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/ResultproviderConnector.java @@ -1,17 +1,18 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Wed Dec 19 11:10:50 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import java.util.LinkedList; @@ -19,10 +20,8 @@ import java.util.List; import java.util.NoSuchElementException; import org.eclipse.cmf.occi.core.AttributeState; -import org.eclipse.cmf.occi.core.Configuration; import org.eclipse.cmf.occi.core.Link; import org.eclipse.cmf.occi.core.MixinBase; -import org.eclipse.cmf.occi.core.OCCIFactory; import org.eclipse.cmf.occi.core.Resource; import org.eclipse.cmf.occi.core.impl.OCCIFactoryImpl; import org.slf4j.Logger; @@ -31,18 +30,13 @@ import org.slf4j.LoggerFactory; import monitoring.Monitorableproperty; import monitoring.Occiresultprovider; import monitoring.Sensor; -import monitoring.impl.MonitoringFactoryImpl; - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: publisher - * - title: Publisher Resource + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: publisher - title: Publisher + * Resource */ -public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl -{ +public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl { /** * Initialize the logger. */ @@ -53,31 +47,28 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl private Monitorableproperty monProp; private Resource monObject; private List<AttributeState> workaround = new LinkedList<AttributeState>(); - + // Start of user code Publisherconnector_constructor /** * Constructs a publisher connector. */ - ResultproviderConnector() - { + ResultproviderConnector() { LOGGER.debug("Constructor called on " + this); this.compMan = new ComponentManager(this); } - // End of user code // // OCCI CRUD callback operations. // - + // Start of user code PublisherocciCreate /** * Called when this Publisher instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -88,8 +79,7 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl * Called when this Publisher instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -100,8 +90,7 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl * Called when this Publisher instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -112,8 +101,7 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl * Called when this Publisher instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); // TODO: Implement this callback or remove this method. this.stop(); @@ -127,44 +115,40 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl // Start of user code Publisher_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { LOGGER.debug("Action deploy() called on " + this); compMan.deploy(); // TODO: Implement how to deploy this publisher. } + // End of user code // Start of user code Publisher_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { LOGGER.debug("Action stop() called on " + this); compMan.stop(); // TODO: Implement how to stop this publisher. } + // End of user code // Start of user code Publisher_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { setRuntimeInformation(); System.out.println(this.attributes); LOGGER.debug("Action start() called on " + this); @@ -172,43 +156,39 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl removeRuntimeInformation(); System.out.println(this.attributes); } - - + // End of user code // Start of user code Publisher_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { LOGGER.debug("Action configure() called on " + this); compMan.configure(); // TODO: Implement how to configure this publisher. } + // End of user code // Start of user code Publisher_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { LOGGER.debug("Action undeploy() called on " + this); compMan.undeploy(); // TODO: Implement how to undeploy this publisher. } // End of user code - + private MixinBase getMartMixin() { - for(MixinBase mixinBase: this.getParts()) { - if(mixinBase instanceof Occiresultprovider) { + for (MixinBase mixinBase : this.getParts()) { + if (mixinBase instanceof Occiresultprovider) { LOGGER.info("MartPublisher Mixin found for Publisher:" + this.title); return mixinBase; } @@ -218,14 +198,14 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl private List<Monitorableproperty> getMonitoringProperties(Sensor sens) { LinkedList<Monitorableproperty> monProps = new LinkedList<Monitorableproperty>(); - for(Link link: sens.getLinks()) { - if(link instanceof Monitorableproperty) { + for (Link link : sens.getLinks()) { + if (link instanceof Monitorableproperty) { monProps.add((Monitorableproperty) link); } } return monProps; } - + private void setRuntimeInformation() { sensor = getSensor(); AttributeState sensorAttr = factory.createAttributeState(); @@ -234,7 +214,7 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl System.out.println("Sensor: " + sensor); this.attributes.add(sensorAttr); workaround.add(sensorAttr); - + monProp = getMonProp(sensor); AttributeState monPropAttr = factory.createAttributeState(); monPropAttr.setName("monitorable.property"); @@ -242,13 +222,13 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl System.out.println("MonProp: " + monProp); this.attributes.add(monPropAttr); workaround.add(monPropAttr); - + AttributeState monPropNameAttr = factory.createAttributeState(); monPropNameAttr.setName("monitorable.property.property"); monPropNameAttr.setValue(monProp.getMonitoringProperty()); this.attributes.add(monPropNameAttr); workaround.add(monPropNameAttr); - + monObject = monProp.getTarget(); AttributeState monObjectAttr = factory.createAttributeState(); monObjectAttr.setName("monitorable.property.target"); @@ -256,50 +236,48 @@ public class ResultproviderConnector extends monitoring.impl.ResultproviderImpl this.attributes.add(monObjectAttr); workaround.add(monObjectAttr); } - + private Sensor getSensor() { - for(Link link: this.getRlinks()) { - if(link.getSource() instanceof Sensor) { + for (Link link : this.getRlinks()) { + if (link.getSource() instanceof Sensor) { return ((Sensor) link.getSource()); } } throw new NoSuchElementException("No containing sensor found!"); } - + private Monitorableproperty getMonProp(Sensor sensor) { - for(Link link: sensor.getLinks()) { - if(link instanceof Monitorableproperty) { + for (Link link : sensor.getLinks()) { + if (link instanceof Monitorableproperty) { return ((Monitorableproperty) link); } } throw new NoSuchElementException("No monitorableproperty found in sensor!"); } - + private void removeRuntimeInformation() { - for(AttributeState work: workaround) { + for (AttributeState work : workaround) { this.attributes.remove(work); } - - } + } private String getContainingSensorLocation() { - for(Link link: this.getRlinks()) { - if(link.getSource() instanceof Sensor) { + for (Link link : this.getRlinks()) { + if (link.getSource() instanceof Sensor) { return link.getSource().getLocation(); } } return "No containing sensor found"; } - - + private Sensor getContainingSensor() { - for(Link link: this.getRlinks()) { - if(link.getSource() instanceof Sensor) { + for (Link link : this.getRlinks()) { + if (link.getSource() instanceof Sensor) { return (Sensor) link.getSource(); } } LOGGER.info("No containing Sensor found"); throw new NoSuchElementException(); } -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java index 77bd209..9516661 100644 --- a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/SensorConnector.java @@ -1,17 +1,18 @@ /** * Copyright (c) 2016-2017 Inria - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - Philippe Merle <philippe.merle@inria.fr> * - Faiez Zalila <faiez.zalila@inria.fr> * * Generated at Mon Dec 17 14:48:34 CET 2018 from platform:/resource/monitoring/model/monitoring.occie by org.eclipse.cmf.occi.core.gen.connector */ + package de.ugoe.cs.rwm.mocci.connector; import java.util.LinkedList; @@ -26,17 +27,12 @@ import org.modmacao.occi.platform.Status; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - - /** - * Connector implementation for the OCCI kind: - * - scheme: http://schemas.ugoe.cs.rwm/monitoring# - * - term: sensor - * - title: Sensor Component + * Connector implementation for the OCCI kind: - scheme: + * http://schemas.ugoe.cs.rwm/monitoring# - term: sensor - title: Sensor + * Component */ -public class SensorConnector extends monitoring.impl.SensorImpl -{ +public class SensorConnector extends monitoring.impl.SensorImpl { private ConfigurationManagementTool cmtool = new AnsibleCMTool(); /** * Initialize the logger. @@ -47,8 +43,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl /** * Constructs a sensor connector. */ - SensorConnector() - { + SensorConnector() { LOGGER.debug("Constructor called on " + this); // TODO: Implement this constructor. } @@ -56,14 +51,13 @@ public class SensorConnector extends monitoring.impl.SensorImpl // // OCCI CRUD callback operations. // - + // Start of user code SensorocciCreate /** * Called when this Sensor instance is completely created. */ @Override - public void occiCreate() - { + public void occiCreate() { LOGGER.debug("occiCreate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -74,8 +68,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl * Called when this Sensor instance must be retrieved. */ @Override - public void occiRetrieve() - { + public void occiRetrieve() { LOGGER.debug("occiRetrieve() called on " + this); // TODO: Implement this callback or remove this method. } @@ -86,8 +79,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl * Called when this Sensor instance is completely updated. */ @Override - public void occiUpdate() - { + public void occiUpdate() { LOGGER.debug("occiUpdate() called on " + this); // TODO: Implement this callback or remove this method. } @@ -98,8 +90,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl * Called when this Sensor instance will be deleted. */ @Override - public void occiDelete() - { + public void occiDelete() { LOGGER.debug("occiDelete() called on " + this); this.stop(); this.undeploy(); @@ -113,262 +104,260 @@ public class SensorConnector extends monitoring.impl.SensorImpl // Start of user code Sensor_Kind_configure_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: configure - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: configure + * - title: */ @Override - public void configure() - { + public void configure() { int status = -1; LOGGER.debug("Action configure() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.DEPLOYED_VALUE: LOGGER.debug("Fire transition(state=deployed, action=\"configure\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.configure(); } - + status = cmtool.configure(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.INACTIVE); - else + } else { setOcciAppState(Status.ERROR); + } break; default: break; -} + } } + // End of user code // Start of user code Sensor_Kind_Start_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: start - * - title: Start the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: start - + * title: Start the application. */ @Override - public void start() - { + public void start() { int status = -1; LOGGER.debug("Action start() called on " + this); - + // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.INACTIVE_VALUE: LOGGER.debug("Fire transition(state=inactive, action=\"start\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.start(); } status = cmtool.start(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.ACTIVE); - else - setOcciAppState(Status.ERROR); + } else { + setOcciAppState(Status.ERROR); + } break; - case Status.UNDEPLOYED_VALUE: LOGGER.debug("Fire transition(state=undeployed, action=\"start\")..."); // First deploy components - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.deploy(); } this.deploy(); - + // then configure them - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.configure(); } this.configure(); - + // then start them - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.start(); } status = cmtool.start(this); - - if (status == 0) + + if (status == 0) { setOcciAppState(Status.ACTIVE); - else + } else { setOcciAppState(Status.ERROR); + } break; default: break; -} + } } + // End of user code // Start of user code Sensor_Kind_Stop_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: stop - * - title: Stop the application. + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: stop - + * title: Stop the application. */ @Override - public void stop() - { + public void stop() { int status = -1; LOGGER.debug("Action stop() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.ACTIVE_VALUE: LOGGER.debug("Fire transition(state=active, action=\"stop\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.stop(); } status = cmtool.stop(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.INACTIVE); - else - setOcciAppState(Status.ERROR); + } else { + setOcciAppState(Status.ERROR); + } break; default: break; -} + } // TODO: Implement how to stop this sensor. } + // End of user code // Start of user code Sensor_Kind_deploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: deploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: deploy - + * title: */ @Override - public void deploy() - { + public void deploy() { int status = -1; LOGGER.debug("Action deploy() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.UNDEPLOYED_VALUE: LOGGER.debug("Fire transition(state=undeployed, action=\"deploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.deploy(); } - + status = cmtool.deploy(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.DEPLOYED); - else + } else { setOcciAppState(Status.ERROR); + } break; default: break; -} + } } + // End of user code // Start of user code Sensor_Kind_undeploy_action /** - * Implement OCCI action: - * - scheme: http://schemas.modmacao.org/occi/platform/component/action# - * - term: undeploy - * - title: + * Implement OCCI action: - scheme: + * http://schemas.modmacao.org/occi/platform/component/action# - term: undeploy + * - title: */ @Override - public void undeploy() - { + public void undeploy() { int status = -1; LOGGER.debug("Action undeploy() called on " + this); // Application State Machine. - switch(getOcciAppState().getValue()) { + switch (getOcciAppState().getValue()) { case Status.ACTIVE_VALUE: LOGGER.debug("Fire transition(state=active, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.stop(); } this.stop(); - - for (Component component: this.getConnectedComponents()) { + + for (Component component : this.getConnectedComponents()) { component.undeploy(); } status = cmtool.undeploy(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.UNDEPLOYED); - else + } else { setOcciAppState(Status.ERROR); + } break; case Status.INACTIVE_VALUE: LOGGER.debug("Fire transition(state=inactive, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.undeploy(); } status = cmtool.undeploy(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.UNDEPLOYED); - else + } else { setOcciAppState(Status.ERROR); + } break; case Status.DEPLOYED_VALUE: LOGGER.debug("Fire transition(state=deployed, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.undeploy(); } status = cmtool.undeploy(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.UNDEPLOYED); - else + } else { setOcciAppState(Status.ERROR); + } break; case Status.ERROR_VALUE: LOGGER.debug("Fire transition(state=error, action=\"undeploy\")..."); - for (Component component: this.getConnectedComponents()) { + for (Component component : this.getConnectedComponents()) { component.undeploy(); } status = cmtool.undeploy(this); - if (status == 0) + if (status == 0) { setOcciAppState(Status.UNDEPLOYED); - else + } else { setOcciAppState(Status.ERROR); + } break; default: break; -} + } } // End of user code - + private List<Component> getConnectedComponents() { LinkedList<Component> connectedComponents = new LinkedList<Component>(); - for (Link link: this.getLinks()) { + for (Link link : this.getLinks()) { if (link instanceof Componentlink) { connectedComponents.add((Component) link.getTarget()); } } return connectedComponents; - + } - - + /* - private boolean assertCompsStatusEquals(List<Component> components, Status status) { - for (Component component: components) { - if (component.getOcciComponentState().getValue() != status.getValue()) { - LOGGER.debug("Missmatching state of component " + component.getTitle() + " detected. " - + "Expected " + status.getName() + " but was " - + component.getOcciComponentState().getName() + "."); - return false; - } - } - return true; -}*/ + * private boolean assertCompsStatusEquals(List<Component> components, Status + * status) { for (Component component: components) { if + * (component.getOcciComponentState().getValue() != status.getValue()) { + * LOGGER.debug("Missmatching state of component " + component.getTitle() + + * " detected. " + "Expected " + status.getName() + " but was " + + * component.getOcciComponentState().getName() + "."); return false; } } return + * true; } + */ -} +} diff --git a/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java new file mode 100644 index 0000000..36ab687 --- /dev/null +++ b/de.ugoe.cs.rwm.mocci.connector/src-gen/de/ugoe/cs/rwm/mocci/connector/package-info.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright (c) 2019 University of Goettingen. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - Johannes Erbel <johannes.erbel@cs.uni-goettingen.de> + *******************************************************************************/ +/** + * + */ +/** + * Main package for mocci connector. + * + * @author erbel + * + */ +package de.ugoe.cs.rwm.mocci.connector; \ No newline at end of file diff --git a/de.ugoe.cs.rwm.mocci.model.edit/build.gradle b/de.ugoe.cs.rwm.mocci.model.edit/build.gradle index 82189e3..4819b85 100644 --- a/de.ugoe.cs.rwm.mocci.model.edit/build.gradle +++ b/de.ugoe.cs.rwm.mocci.model.edit/build.gradle @@ -1,34 +1,10 @@ -// Apply the java-library plugin to add support for Java Library -apply plugin : 'eclipse' -apply plugin: 'java' -apply plugin: 'maven' - - -// In this section you declare where to find the dependencies of your project repositories { - // Use jcenter for resolving your dependencies. - // You can declare any Maven/Ivy/file repository here. - //mavenLocal() - mavenCentral() maven { url "http://www.jabylon.org/maven/" } - - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/" - } - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/" - } } dependencies { - -//Require-Bundle: org.eclipse.core.runtime, -// org.eclipse.emf.ecore;visibility:=reexport, - - //org.eclipse.ocl.examples.codegen;visibility:=reexport, - //Nexus compile group: 'org.eclipse.ocl', name: 'pivot', version: '1.3.0' compile group: 'org.eclipse.cmf.occi', name: 'core', version: '1.0.0' @@ -40,14 +16,9 @@ dependencies { //maven compile group: 'org.eclipse.emf', name: 'edit', version: '2.9.0' - - - - testCompile group: 'junit', name: 'junit', version: '4.12' } - sourceSets { main { java { diff --git a/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/DatagathererItemProvider.java b/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/DatagathererItemProvider.java index bb7282e..53e872d 100644 --- a/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/DatagathererItemProvider.java +++ b/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/DatagathererItemProvider.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,39 +12,30 @@ */ package monitoring.provider; - import java.util.Collection; import java.util.List; -import monitoring.Datagatherer; -import monitoring.MonitoringFactory; -import monitoring.MonitoringPackage; - import org.eclipse.cmf.occi.core.OCCIPackage; - import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; - import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - import org.modmacao.occi.platform.provider.ComponentItemProvider; +import monitoring.Datagatherer; +import monitoring.MonitoringFactory; + /** - * This is the item provider adapter for a {@link monitoring.Datagatherer} object. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This is the item provider adapter for a {@link monitoring.Datagatherer} + * object. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public class DatagathererItemProvider extends ComponentItemProvider { /** - * This constructs an instance from a factory and a notifier. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This constructs an instance from a factory and a notifier. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public DatagathererItemProvider(AdapterFactory adapterFactory) { @@ -52,9 +43,9 @@ public class DatagathererItemProvider extends ComponentItemProvider { } /** - * This returns the property descriptors for the adapted class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This returns the property descriptors for the adapted class. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -67,9 +58,8 @@ public class DatagathererItemProvider extends ComponentItemProvider { } /** - * This returns Datagatherer.gif. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This returns Datagatherer.gif. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -78,25 +68,23 @@ public class DatagathererItemProvider extends ComponentItemProvider { } /** - * This returns the label text for the adapted class. - * <!-- begin-user-doc --> + * This returns the label text for the adapted class. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override public String getText(Object object) { - String label = ((Datagatherer)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Datagatherer_type") : - getString("_UI_Datagatherer_type") + " " + label; + String label = ((Datagatherer) object).getId(); + return label == null || label.length() == 0 ? getString("_UI_Datagatherer_type") + : getString("_UI_Datagatherer_type") + " " + label; } - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This handles model notifications by calling {@link #updateChildren} to update + * any cached children and by creating a viewer notification, which it passes to + * {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -106,31 +94,27 @@ public class DatagathererItemProvider extends ComponentItemProvider { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * <!-- begin-user-doc --> + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing + * the children that can be created under this object. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors.add - (createChildParameter - (OCCIPackage.Literals.ENTITY__PARTS, - MonitoringFactory.eINSTANCE.createOcciresultprovider())); + newChildDescriptors.add(createChildParameter(OCCIPackage.Literals.ENTITY__PARTS, + MonitoringFactory.eINSTANCE.createOcciresultprovider())); - newChildDescriptors.add - (createChildParameter - (OCCIPackage.Literals.RESOURCE__LINKS, - MonitoringFactory.eINSTANCE.createMonitorableproperty())); + newChildDescriptors.add(createChildParameter(OCCIPackage.Literals.RESOURCE__LINKS, + MonitoringFactory.eINSTANCE.createMonitorableproperty())); } /** - * Return the resource locator for this item provider's resources. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Return the resource locator for this item provider's resources. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override diff --git a/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/ResultproviderItemProvider.java b/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/ResultproviderItemProvider.java index c5332a8..cfab511 100644 --- a/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/ResultproviderItemProvider.java +++ b/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/ResultproviderItemProvider.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,39 +12,30 @@ */ package monitoring.provider; - import java.util.Collection; import java.util.List; -import monitoring.MonitoringFactory; -import monitoring.MonitoringPackage; -import monitoring.Resultprovider; - import org.eclipse.cmf.occi.core.OCCIPackage; - import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; - import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - import org.modmacao.occi.platform.provider.ComponentItemProvider; +import monitoring.MonitoringFactory; +import monitoring.Resultprovider; + /** - * This is the item provider adapter for a {@link monitoring.Resultprovider} object. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This is the item provider adapter for a {@link monitoring.Resultprovider} + * object. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public class ResultproviderItemProvider extends ComponentItemProvider { /** - * This constructs an instance from a factory and a notifier. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This constructs an instance from a factory and a notifier. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public ResultproviderItemProvider(AdapterFactory adapterFactory) { @@ -52,9 +43,9 @@ public class ResultproviderItemProvider extends ComponentItemProvider { } /** - * This returns the property descriptors for the adapted class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This returns the property descriptors for the adapted class. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -67,9 +58,9 @@ public class ResultproviderItemProvider extends ComponentItemProvider { } /** - * This returns Resultprovider.gif. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This returns Resultprovider.gif. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ @Override @@ -78,25 +69,23 @@ public class ResultproviderItemProvider extends ComponentItemProvider { } /** - * This returns the label text for the adapted class. - * <!-- begin-user-doc --> + * This returns the label text for the adapted class. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override public String getText(Object object) { - String label = ((Resultprovider)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Resultprovider_type") : - getString("_UI_Resultprovider_type") + " " + label; + String label = ((Resultprovider) object).getId(); + return label == null || label.length() == 0 ? getString("_UI_Resultprovider_type") + : getString("_UI_Resultprovider_type") + " " + label; } - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This handles model notifications by calling {@link #updateChildren} to update + * any cached children and by creating a viewer notification, which it passes to + * {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -106,31 +95,27 @@ public class ResultproviderItemProvider extends ComponentItemProvider { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * <!-- begin-user-doc --> + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing + * the children that can be created under this object. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors.add - (createChildParameter - (OCCIPackage.Literals.ENTITY__PARTS, - MonitoringFactory.eINSTANCE.createOcciresultprovider())); + newChildDescriptors.add(createChildParameter(OCCIPackage.Literals.ENTITY__PARTS, + MonitoringFactory.eINSTANCE.createOcciresultprovider())); - newChildDescriptors.add - (createChildParameter - (OCCIPackage.Literals.RESOURCE__LINKS, - MonitoringFactory.eINSTANCE.createMonitorableproperty())); + newChildDescriptors.add(createChildParameter(OCCIPackage.Literals.RESOURCE__LINKS, + MonitoringFactory.eINSTANCE.createMonitorableproperty())); } /** - * Return the resource locator for this item provider's resources. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Return the resource locator for this item provider's resources. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override diff --git a/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/SensorItemProvider.java b/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/SensorItemProvider.java index 4f61c46..3402dac 100644 --- a/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/SensorItemProvider.java +++ b/de.ugoe.cs.rwm.mocci.model.edit/src-gen/monitoring/provider/SensorItemProvider.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,39 +12,30 @@ */ package monitoring.provider; - import java.util.Collection; import java.util.List; -import monitoring.MonitoringFactory; -import monitoring.MonitoringPackage; -import monitoring.Sensor; - import org.eclipse.cmf.occi.core.OCCIPackage; - import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; - import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - import org.modmacao.occi.platform.provider.ApplicationItemProvider; +import monitoring.MonitoringFactory; +import monitoring.Sensor; + /** * This is the item provider adapter for a {@link monitoring.Sensor} object. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public class SensorItemProvider extends ApplicationItemProvider { /** - * This constructs an instance from a factory and a notifier. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This constructs an instance from a factory and a notifier. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public SensorItemProvider(AdapterFactory adapterFactory) { @@ -52,9 +43,9 @@ public class SensorItemProvider extends ApplicationItemProvider { } /** - * This returns the property descriptors for the adapted class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This returns the property descriptors for the adapted class. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -67,9 +58,8 @@ public class SensorItemProvider extends ApplicationItemProvider { } /** - * This returns Sensor.gif. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This returns Sensor.gif. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -78,25 +68,23 @@ public class SensorItemProvider extends ApplicationItemProvider { } /** - * This returns the label text for the adapted class. - * <!-- begin-user-doc --> + * This returns the label text for the adapted class. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override public String getText(Object object) { - String label = ((Sensor)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Sensor_type") : - getString("_UI_Sensor_type") + " " + label; + String label = ((Sensor) object).getId(); + return label == null || label.length() == 0 ? getString("_UI_Sensor_type") + : getString("_UI_Sensor_type") + " " + label; } - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This handles model notifications by calling {@link #updateChildren} to update + * any cached children and by creating a viewer notification, which it passes to + * {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -106,31 +94,27 @@ public class SensorItemProvider extends ApplicationItemProvider { } /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * <!-- begin-user-doc --> + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing + * the children that can be created under this object. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); - newChildDescriptors.add - (createChildParameter - (OCCIPackage.Literals.ENTITY__PARTS, - MonitoringFactory.eINSTANCE.createOcciresultprovider())); + newChildDescriptors.add(createChildParameter(OCCIPackage.Literals.ENTITY__PARTS, + MonitoringFactory.eINSTANCE.createOcciresultprovider())); - newChildDescriptors.add - (createChildParameter - (OCCIPackage.Literals.RESOURCE__LINKS, - MonitoringFactory.eINSTANCE.createMonitorableproperty())); + newChildDescriptors.add(createChildParameter(OCCIPackage.Literals.RESOURCE__LINKS, + MonitoringFactory.eINSTANCE.createMonitorableproperty())); } /** - * Return the resource locator for this item provider's resources. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Return the resource locator for this item provider's resources. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override diff --git a/de.ugoe.cs.rwm.mocci.model/build.gradle b/de.ugoe.cs.rwm.mocci.model/build.gradle index f18630a..cd2857a 100644 --- a/de.ugoe.cs.rwm.mocci.model/build.gradle +++ b/de.ugoe.cs.rwm.mocci.model/build.gradle @@ -1,11 +1,6 @@ -// Apply the java-library plugin to add support for Java Library -apply plugin : 'eclipse' -apply plugin: 'java' -apply plugin: 'maven' apply plugin: 'org.standardout.bnd-platform' //apply plugin: 'osgi' - buildscript { repositories { jcenter() @@ -15,27 +10,7 @@ buildscript { } } - -// In this section you declare where to find the dependencies of your project -repositories { - // Use jcenter for resolving your dependencies. - // You can declare any Maven/Ivy/file repository here. - //mavenLocal() - mavenCentral() - - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/thirdparty/" - } - maven { - url "https://nexus.informatik.uni-goettingen.de/content/repositories/rwm/" - } -} - dependencies { - - //platform 'de.ugoe.cs.rwm.wocci:model:1.0.0' - - //Nexus compile group: 'org.eclipse.ocl', name: 'pivot', version: '1.3.0' //occiware @@ -92,8 +67,6 @@ eclipse { } } - - uploadArchives { repositories { mavenDeployer { diff --git a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/DatagathererImpl.java b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/DatagathererImpl.java index 2222d68..e94b127 100644 --- a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/DatagathererImpl.java +++ b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/DatagathererImpl.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,28 +12,22 @@ */ package monitoring.impl; -import monitoring.Datagatherer; -import monitoring.MonitoringPackage; - -import org.eclipse.emf.common.notify.Notification; - import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - import org.modmacao.occi.platform.impl.ComponentImpl; +import monitoring.Datagatherer; +import monitoring.MonitoringPackage; + /** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Datagatherer</b></em>'. - * <!-- end-user-doc --> + * <!-- begin-user-doc --> An implementation of the model object + * '<em><b>Datagatherer</b></em>'. <!-- end-user-doc --> * * @generated */ public class DatagathererImpl extends ComponentImpl implements Datagatherer { /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ protected DatagathererImpl() { @@ -41,8 +35,8 @@ public class DatagathererImpl extends ComponentImpl implements Datagatherer { } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -50,4 +44,4 @@ public class DatagathererImpl extends ComponentImpl implements Datagatherer { return MonitoringPackage.Literals.DATAGATHERER; } -} //DatagathererImpl +} // DatagathererImpl diff --git a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/MonitoringPackageImpl.java b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/MonitoringPackageImpl.java index fcbecc7..243f2dc 100644 --- a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/MonitoringPackageImpl.java +++ b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/MonitoringPackageImpl.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,20 +12,7 @@ */ package monitoring.impl; -import monitoring.Datagatherer; -import monitoring.Dataprocessor; -import monitoring.Gatheringservice; -import monitoring.Monitorableproperty; -import monitoring.MonitoringFactory; -import monitoring.MonitoringPackage; -import monitoring.Occiresultprovider; -import monitoring.Resultprovider; -import monitoring.Sensor; - -import monitoring.util.MonitoringValidator; - import org.eclipse.cmf.occi.core.OCCIPackage; - import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; @@ -33,77 +20,85 @@ import org.eclipse.emf.ecore.EGenericType; import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EValidator; - import org.eclipse.emf.ecore.impl.EPackageImpl; - import org.modmacao.occi.platform.PlatformPackage; +import monitoring.Datagatherer; +import monitoring.Dataprocessor; +import monitoring.Monitorableproperty; +import monitoring.MonitoringFactory; +import monitoring.MonitoringPackage; +import monitoring.Occiresultprovider; +import monitoring.Resultprovider; +import monitoring.Sensor; +import monitoring.util.MonitoringValidator; + /** - * <!-- begin-user-doc --> - * An implementation of the model <b>Package</b>. - * <!-- end-user-doc --> + * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- + * end-user-doc --> + * * @generated */ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPackage { /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EClass sensorEClass = null; /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EClass datagathererEClass = null; /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EClass dataprocessorEClass = null; /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EClass resultproviderEClass = null; /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EClass monitorablepropertyEClass = null; /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EClass occiresultproviderEClass = null; /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private EDataType stringEDataType = null; /** * Creates an instance of the model <b>Package</b>, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - * <p>Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the + * package package URI value. + * <p> + * Note: the correct way to create the package is via the static factory method + * {@link #init init()}, which also performs initialization of the package, or + * returns the registered package, if one already exists. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * * @see org.eclipse.emf.ecore.EPackage.Registry * @see monitoring.MonitoringPackage#eNS_URI * @see #init() @@ -114,29 +109,36 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private static boolean isInited = false; /** - * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * Creates, registers, and initializes the <b>Package</b> for this model, and + * for any others upon which it depends. + * + * <p> + * This method is used to initialize {@link MonitoringPackage#eINSTANCE} when + * that field is accessed. Clients should not invoke it directly. Instead, they + * should simply access that field to obtain the package. <!-- begin-user-doc + * --> <!-- end-user-doc --> * - * <p>This method is used to initialize {@link MonitoringPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static MonitoringPackage init() { - if (isInited) return (MonitoringPackage)EPackage.Registry.INSTANCE.getEPackage(MonitoringPackage.eNS_URI); + if (isInited) { + return (MonitoringPackage) EPackage.Registry.INSTANCE.getEPackage(MonitoringPackage.eNS_URI); + } // Obtain or create and register package - MonitoringPackageImpl theMonitoringPackage = (MonitoringPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MonitoringPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MonitoringPackageImpl()); + MonitoringPackageImpl theMonitoringPackage = (MonitoringPackageImpl) (EPackage.Registry.INSTANCE + .get(eNS_URI) instanceof MonitoringPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) + : new MonitoringPackageImpl()); isInited = true; @@ -151,156 +153,169 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac theMonitoringPackage.initializePackageContents(); // Register package validator - EValidator.Registry.INSTANCE.put - (theMonitoringPackage, - new EValidator.Descriptor() { - public EValidator getEValidator() { - return MonitoringValidator.INSTANCE; - } - }); + EValidator.Registry.INSTANCE.put(theMonitoringPackage, new EValidator.Descriptor() { + @Override + public EValidator getEValidator() { + return MonitoringValidator.INSTANCE; + } + }); // Mark meta-data to indicate it can't be changed theMonitoringPackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(MonitoringPackage.eNS_URI, theMonitoringPackage); return theMonitoringPackage; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EClass getSensor() { return sensorEClass; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EClass getDatagatherer() { return datagathererEClass; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EClass getDataprocessor() { return dataprocessorEClass; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EClass getResultprovider() { return resultproviderEClass; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EClass getMonitorableproperty() { return monitorablepropertyEClass; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EAttribute getMonitorableproperty_MonitoringProperty() { - return (EAttribute)monitorablepropertyEClass.getEStructuralFeatures().get(0); + return (EAttribute) monitorablepropertyEClass.getEStructuralFeatures().get(0); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EAttribute getMonitorableproperty_MonitoringResult() { - return (EAttribute)monitorablepropertyEClass.getEStructuralFeatures().get(1); + return (EAttribute) monitorablepropertyEClass.getEStructuralFeatures().get(1); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EOperation getMonitorableproperty__TargetConstraint__DiagnosticChain_Map() { return monitorablepropertyEClass.getEOperations().get(0); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EClass getOcciresultprovider() { return occiresultproviderEClass; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EAttribute getOcciresultprovider_ResultProviderEndpoint() { - return (EAttribute)occiresultproviderEClass.getEStructuralFeatures().get(0); + return (EAttribute) occiresultproviderEClass.getEStructuralFeatures().get(0); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EOperation getOcciresultprovider__AppliesConstraint__DiagnosticChain_Map() { return occiresultproviderEClass.getEOperations().get(0); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public EDataType getString() { return stringEDataType; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ + @Override public MonitoringFactory getMonitoringFactory() { - return (MonitoringFactory)getEFactoryInstance(); + return (MonitoringFactory) getEFactoryInstance(); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private boolean isCreated = false; /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Creates the meta-model objects for the package. This method is guarded to + * have no affect on any invocation but its first. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * * @generated */ public void createPackageContents() { - if (isCreated) return; + if (isCreated) { + return; + } isCreated = true; // Create classes and their features @@ -326,21 +341,23 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ private boolean isInitialized = false; /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Complete the initialization of the package and its meta-model. This method is + * guarded to have no affect on any invocation but its first. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public void initializePackageContents() { - if (isInitialized) return; + if (isInitialized) { + return; + } isInitialized = true; // Initialize package @@ -349,8 +366,9 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac setNsURI(eNS_URI); // Obtain other dependent packages - PlatformPackage thePlatformPackage = (PlatformPackage)EPackage.Registry.INSTANCE.getEPackage(PlatformPackage.eNS_URI); - OCCIPackage theOCCIPackage = (OCCIPackage)EPackage.Registry.INSTANCE.getEPackage(OCCIPackage.eNS_URI); + PlatformPackage thePlatformPackage = (PlatformPackage) EPackage.Registry.INSTANCE + .getEPackage(PlatformPackage.eNS_URI); + OCCIPackage theOCCIPackage = (OCCIPackage) EPackage.Registry.INSTANCE.getEPackage(OCCIPackage.eNS_URI); // Create type parameters @@ -367,17 +385,26 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac // Initialize classes, features, and operations; add parameters initEClass(sensorEClass, Sensor.class, "Sensor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(datagathererEClass, Datagatherer.class, "Datagatherer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(datagathererEClass, Datagatherer.class, "Datagatherer", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); - initEClass(dataprocessorEClass, Dataprocessor.class, "Dataprocessor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(dataprocessorEClass, Dataprocessor.class, "Dataprocessor", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); - initEClass(resultproviderEClass, Resultprovider.class, "Resultprovider", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(resultproviderEClass, Resultprovider.class, "Resultprovider", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); - initEClass(monitorablepropertyEClass, Monitorableproperty.class, "Monitorableproperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getMonitorableproperty_MonitoringProperty(), this.getString(), "monitoringProperty", null, 1, 1, Monitorableproperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getMonitorableproperty_MonitoringResult(), this.getString(), "monitoringResult", null, 0, 1, Monitorableproperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(monitorablepropertyEClass, Monitorableproperty.class, "Monitorableproperty", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getMonitorableproperty_MonitoringProperty(), this.getString(), "monitoringProperty", null, 1, 1, + Monitorableproperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getMonitorableproperty_MonitoringResult(), this.getString(), "monitoringResult", null, 0, 1, + Monitorableproperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - EOperation op = initEOperation(getMonitorableproperty__TargetConstraint__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "targetConstraint", 0, 1, IS_UNIQUE, IS_ORDERED); + EOperation op = initEOperation(getMonitorableproperty__TargetConstraint__DiagnosticChain_Map(), + ecorePackage.getEBoolean(), "targetConstraint", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); EGenericType g1 = createEGenericType(ecorePackage.getEMap()); EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); @@ -386,10 +413,14 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac g1.getETypeArguments().add(g2); addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); - initEClass(occiresultproviderEClass, Occiresultprovider.class, "Occiresultprovider", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getOcciresultprovider_ResultProviderEndpoint(), this.getString(), "resultProviderEndpoint", null, 1, 1, Occiresultprovider.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(occiresultproviderEClass, Occiresultprovider.class, "Occiresultprovider", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getOcciresultprovider_ResultProviderEndpoint(), this.getString(), "resultProviderEndpoint", null, + 1, 1, Occiresultprovider.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - op = initEOperation(getOcciresultprovider__AppliesConstraint__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "appliesConstraint", 0, 1, IS_UNIQUE, IS_ORDERED); + op = initEOperation(getOcciresultprovider__AppliesConstraint__DiagnosticChain_Map(), ecorePackage.getEBoolean(), + "appliesConstraint", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); g1 = createEGenericType(ecorePackage.getEMap()); g2 = createEGenericType(ecorePackage.getEJavaObject()); @@ -411,29 +442,15 @@ public class MonitoringPackageImpl extends EPackageImpl implements MonitoringPac /** * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ protected void createEcoreAnnotations() { - String source = "http://www.eclipse.org/emf/2002/Ecore"; - addAnnotation - (this, - source, - new String[] { - }); - addAnnotation - (monitorablepropertyEClass, - source, - new String[] { - "constraints", "targetConstraint" - }); - addAnnotation - (occiresultproviderEClass, - source, - new String[] { - "constraints", "appliesConstraint" - }); + String source = "http://www.eclipse.org/emf/2002/Ecore"; + addAnnotation(this, source, new String[] {}); + addAnnotation(monitorablepropertyEClass, source, new String[] { "constraints", "targetConstraint" }); + addAnnotation(occiresultproviderEClass, source, new String[] { "constraints", "appliesConstraint" }); } -} //MonitoringPackageImpl +} // MonitoringPackageImpl diff --git a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/ResultproviderImpl.java b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/ResultproviderImpl.java index 1ccbd2e..801e096 100644 --- a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/ResultproviderImpl.java +++ b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/ResultproviderImpl.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,28 +12,22 @@ */ package monitoring.impl; -import monitoring.MonitoringPackage; -import monitoring.Resultprovider; - -import org.eclipse.emf.common.notify.Notification; - import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - import org.modmacao.occi.platform.impl.ComponentImpl; +import monitoring.MonitoringPackage; +import monitoring.Resultprovider; + /** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Resultprovider</b></em>'. - * <!-- end-user-doc --> + * <!-- begin-user-doc --> An implementation of the model object + * '<em><b>Resultprovider</b></em>'. <!-- end-user-doc --> * * @generated */ public class ResultproviderImpl extends ComponentImpl implements Resultprovider { /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ protected ResultproviderImpl() { @@ -41,8 +35,8 @@ public class ResultproviderImpl extends ComponentImpl implements Resultprovider } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -50,4 +44,4 @@ public class ResultproviderImpl extends ComponentImpl implements Resultprovider return MonitoringPackage.Literals.RESULTPROVIDER; } -} //ResultproviderImpl +} // ResultproviderImpl diff --git a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/SensorImpl.java b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/SensorImpl.java index 7967a30..b80c474 100644 --- a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/SensorImpl.java +++ b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/impl/SensorImpl.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -12,28 +12,22 @@ */ package monitoring.impl; -import monitoring.MonitoringPackage; -import monitoring.Sensor; - -import org.eclipse.emf.common.notify.Notification; - import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - import org.modmacao.occi.platform.impl.ApplicationImpl; +import monitoring.MonitoringPackage; +import monitoring.Sensor; + /** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Sensor</b></em>'. - * <!-- end-user-doc --> + * <!-- begin-user-doc --> An implementation of the model object + * '<em><b>Sensor</b></em>'. <!-- end-user-doc --> * * @generated */ public class SensorImpl extends ApplicationImpl implements Sensor { /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ protected SensorImpl() { @@ -41,8 +35,8 @@ public class SensorImpl extends ApplicationImpl implements Sensor { } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override @@ -50,4 +44,4 @@ public class SensorImpl extends ApplicationImpl implements Sensor { return MonitoringPackage.Literals.SENSOR; } -} //SensorImpl +} // SensorImpl diff --git a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/util/MonitoringValidator.java b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/util/MonitoringValidator.java index 1df82fa..1ca3e81 100644 --- a/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/util/MonitoringValidator.java +++ b/de.ugoe.cs.rwm.mocci.model/src-gen/monitoring/util/MonitoringValidator.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * - William Piers <william.piers@obeo.fr> * - Philippe Merle <philippe.merle@inria.fr> @@ -14,42 +14,40 @@ package monitoring.util; import java.util.Map; -import monitoring.*; - import org.eclipse.cmf.occi.core.util.OCCIValidator; - import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EOperation; import org.eclipse.emf.ecore.EPackage; - import org.eclipse.emf.ecore.util.EObjectValidator; -import org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil; +import monitoring.Datagatherer; +import monitoring.Dataprocessor; +import monitoring.Monitorableproperty; +import monitoring.MonitoringPackage; +import monitoring.Occiresultprovider; +import monitoring.Resultprovider; +import monitoring.Sensor; /** - * <!-- begin-user-doc --> - * The <b>Validator</b> for the model. - * <!-- end-user-doc --> + * <!-- begin-user-doc --> The <b>Validator</b> for the model. <!-- end-user-doc + * --> + * * @see monitoring.MonitoringPackage * @generated */ public class MonitoringValidator extends EObjectValidator { /** - * The cached model package - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public static final MonitoringValidator INSTANCE = new MonitoringValidator(); /** - * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() + * source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() + * codes} from this package. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @see org.eclipse.emf.common.util.Diagnostic#getSource() * @see org.eclipse.emf.common.util.Diagnostic#getCode() * @generated @@ -57,49 +55,53 @@ public class MonitoringValidator extends EObjectValidator { public static final String DIAGNOSTIC_SOURCE = "monitoring"; /** - * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Target Constraint' of 'Monitorableproperty'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for + * constraint 'Target Constraint' of 'Monitorableproperty'. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * * @generated */ public static final int MONITORABLEPROPERTY__TARGET_CONSTRAINT = 1; /** - * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Applies Constraint' of 'Occiresultprovider'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for + * constraint 'Applies Constraint' of 'Occiresultprovider'. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * * @generated */ public static final int OCCIRESULTPROVIDER__APPLIES_CONSTRAINT = 2; /** - * A constant with a fixed name that can be used as the base value for additional hand written constants. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * A constant with a fixed name that can be used as the base value for + * additional hand written constants. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 2; /** - * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. - * <!-- begin-user-doc --> + * A constant with a fixed name that can be used as the base value for + * additional hand written constants in a derived class. <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; /** - * The cached base package validator. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * The cached base package validator. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ protected OCCIValidator occiValidator; /** - * Creates an instance of the switch. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ public MonitoringValidator() { @@ -108,204 +110,371 @@ public class MonitoringValidator extends EObjectValidator { } /** - * Returns the package of this validator switch. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Returns the package of this validator switch. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * * @generated */ @Override protected EPackage getEPackage() { - return MonitoringPackage.eINSTANCE; + return MonitoringPackage.eINSTANCE; } /** * Calls <code>validateXXX</code> for the corresponding classifier of the model. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override - protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) { + protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, + Map<Object, Object> context) { switch (classifierID) { - case MonitoringPackage.SENSOR: - return validateSensor((Sensor)value, diagnostics, context); - case MonitoringPackage.DATAGATHERER: - return validateDatagatherer((Datagatherer)value, diagnostics, context); - case MonitoringPackage.DATAPROCESSOR: - return validateDataprocessor((Dataprocessor)value, diagnostics, context); - case MonitoringPackage.RESULTPROVIDER: - return validateResultprovider((Resultprovider)value, diagnostics, context); - case MonitoringPackage.MONITORABLEPROPERTY: - return validateMonitorableproperty((Monitorableproperty)value, diagnostics, context); - case MonitoringPackage.OCCIRESULTPROVIDER: - return validateOcciresultprovider((Occiresultprovider)value, diagnostics, context); - case MonitoringPackage.STRING: - return validateString((String)value, diagnostics, context); - default: - return true; + case MonitoringPackage.SENSOR: + return validateSensor((Sensor) value, diagnostics, context); + case MonitoringPackage.DATAGATHERER: + return validateDatagatherer((Datagatherer) value, diagnostics, context); + case MonitoringPackage.DATAPROCESSOR: + return validateDataprocessor((Dataprocessor) value, diagnostics, context); + case MonitoringPackage.RESULTPROVIDER: + return validateResultprovider((Resultprovider) value, diagnostics, context); + case MonitoringPackage.MONITORABLEPROPERTY: + return validateMonitorableproperty((Monitorableproperty) value, diagnostics, context); + case MonitoringPackage.OCCIRESULTPROVIDER: + return validateOcciresultprovider((Occiresultprovider) value, diagnostics, context); + case MonitoringPackage.STRING: + return validateString((String) value, diagnostics, context); + default: + return true; } } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public boolean validateSensor(Sensor sensor, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(sensor, diagnostics, context)) return false; + if (!validate_NoCircularContainment(sensor, diagnostics, context)) { + return false; + } boolean result = validate_EveryMultiplicityConforms(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryDataValueConforms(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryProxyResolves(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_UniqueID(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryKeyUnique(sensor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(sensor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_IdUnique(sensor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_AttributesNameUnique(sensor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(sensor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_DifferentMixins(sensor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateResource_ResourceKindIsInParent(sensor, diagnostics, context); + if (result || diagnostics != null) { + result &= validate_EveryDataValueConforms(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryReferenceIsContained(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryBidirectionalReferenceIsPaired(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryProxyResolves(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_UniqueID(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryKeyUnique(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryMapEntryUnique(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_IdUnique(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_AttributesNameUnique(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(sensor, diagnostics, + context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_DifferentMixins(sensor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateResource_ResourceKindIsInParent(sensor, diagnostics, context); + } return result; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateDatagatherer(Datagatherer datagatherer, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(datagatherer, diagnostics, context)) return false; + public boolean validateDatagatherer(Datagatherer datagatherer, DiagnosticChain diagnostics, + Map<Object, Object> context) { + if (!validate_NoCircularContainment(datagatherer, diagnostics, context)) { + return false; + } boolean result = validate_EveryMultiplicityConforms(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryDataValueConforms(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryProxyResolves(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_UniqueID(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryKeyUnique(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_IdUnique(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_AttributesNameUnique(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_DifferentMixins(datagatherer, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateResource_ResourceKindIsInParent(datagatherer, diagnostics, context); + if (result || diagnostics != null) { + result &= validate_EveryDataValueConforms(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryReferenceIsContained(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryBidirectionalReferenceIsPaired(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryProxyResolves(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_UniqueID(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryKeyUnique(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryMapEntryUnique(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_IdUnique(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_AttributesNameUnique(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(datagatherer, diagnostics, + context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_DifferentMixins(datagatherer, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateResource_ResourceKindIsInParent(datagatherer, diagnostics, context); + } return result; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateDataprocessor(Dataprocessor dataprocessor, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(dataprocessor, diagnostics, context)) return false; + public boolean validateDataprocessor(Dataprocessor dataprocessor, DiagnosticChain diagnostics, + Map<Object, Object> context) { + if (!validate_NoCircularContainment(dataprocessor, diagnostics, context)) { + return false; + } boolean result = validate_EveryMultiplicityConforms(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryDataValueConforms(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryProxyResolves(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_UniqueID(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryKeyUnique(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_IdUnique(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_AttributesNameUnique(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_DifferentMixins(dataprocessor, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateResource_ResourceKindIsInParent(dataprocessor, diagnostics, context); + if (result || diagnostics != null) { + result &= validate_EveryDataValueConforms(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryReferenceIsContained(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryBidirectionalReferenceIsPaired(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryProxyResolves(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_UniqueID(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryKeyUnique(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryMapEntryUnique(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_IdUnique(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_AttributesNameUnique(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(dataprocessor, diagnostics, + context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_DifferentMixins(dataprocessor, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateResource_ResourceKindIsInParent(dataprocessor, diagnostics, context); + } return result; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateResultprovider(Resultprovider resultprovider, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(resultprovider, diagnostics, context)) return false; + public boolean validateResultprovider(Resultprovider resultprovider, DiagnosticChain diagnostics, + Map<Object, Object> context) { + if (!validate_NoCircularContainment(resultprovider, diagnostics, context)) { + return false; + } boolean result = validate_EveryMultiplicityConforms(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryDataValueConforms(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryProxyResolves(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_UniqueID(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryKeyUnique(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_IdUnique(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_AttributesNameUnique(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_DifferentMixins(resultprovider, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateResource_ResourceKindIsInParent(resultprovider, diagnostics, context); + if (result || diagnostics != null) { + result &= validate_EveryDataValueConforms(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryReferenceIsContained(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryBidirectionalReferenceIsPaired(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryProxyResolves(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_UniqueID(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryKeyUnique(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryMapEntryUnique(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_IdUnique(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_AttributesNameUnique(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(resultprovider, diagnostics, + context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_DifferentMixins(resultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateResource_ResourceKindIsInParent(resultprovider, diagnostics, context); + } return result; } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateMonitorableproperty(Monitorableproperty monitorableproperty, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(monitorableproperty, diagnostics, context)) return false; + public boolean validateMonitorableproperty(Monitorableproperty monitorableproperty, DiagnosticChain diagnostics, + Map<Object, Object> context) { + if (!validate_NoCircularContainment(monitorableproperty, diagnostics, context)) { + return false; + } boolean result = validate_EveryMultiplicityConforms(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryDataValueConforms(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryProxyResolves(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_UniqueID(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryKeyUnique(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_IdUnique(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_AttributesNameUnique(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateEntity_DifferentMixins(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateLink_LinkKindIsInParent(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateLink_sourceReferenceInvariant(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= occiValidator.validateLink_targetReferenceInvariant(monitorableproperty, diagnostics, context); - if (result || diagnostics != null) result &= validateMonitorableproperty_targetConstraint(monitorableproperty, diagnostics, context); + if (result || diagnostics != null) { + result &= validate_EveryDataValueConforms(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryReferenceIsContained(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryBidirectionalReferenceIsPaired(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryProxyResolves(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_UniqueID(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryKeyUnique(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryMapEntryUnique(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_IdUnique(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_AttributesNameUnique(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_KindCompatibleWithOneAppliesOfEachMixin(monitorableproperty, + diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateEntity_DifferentMixins(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateLink_LinkKindIsInParent(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateLink_sourceReferenceInvariant(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= occiValidator.validateLink_targetReferenceInvariant(monitorableproperty, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validateMonitorableproperty_targetConstraint(monitorableproperty, diagnostics, context); + } return result; } /** * Validates the targetConstraint constraint of '<em>Monitorableproperty</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateMonitorableproperty_targetConstraint(Monitorableproperty monitorableproperty, DiagnosticChain diagnostics, Map<Object, Object> context) { + public boolean validateMonitorableproperty_targetConstraint(Monitorableproperty monitorableproperty, + DiagnosticChain diagnostics, Map<Object, Object> context) { return monitorableproperty.targetConstraint(diagnostics, context); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateOcciresultprovider(Occiresultprovider occiresultprovider, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(occiresultprovider, diagnostics, context)) return false; + public boolean validateOcciresultprovider(Occiresultprovider occiresultprovider, DiagnosticChain diagnostics, + Map<Object, Object> context) { + if (!validate_NoCircularContainment(occiresultprovider, diagnostics, context)) { + return false; + } boolean result = validate_EveryMultiplicityConforms(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryDataValueConforms(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryProxyResolves(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_UniqueID(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryKeyUnique(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(occiresultprovider, diagnostics, context); - if (result || diagnostics != null) result &= validateOcciresultprovider_appliesConstraint(occiresultprovider, diagnostics, context); + if (result || diagnostics != null) { + result &= validate_EveryDataValueConforms(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryReferenceIsContained(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryBidirectionalReferenceIsPaired(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryProxyResolves(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_UniqueID(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryKeyUnique(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validate_EveryMapEntryUnique(occiresultprovider, diagnostics, context); + } + if (result || diagnostics != null) { + result &= validateOcciresultprovider_appliesConstraint(occiresultprovider, diagnostics, context); + } return result; } /** * Validates the appliesConstraint constraint of '<em>Occiresultprovider</em>'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - public boolean validateOcciresultprovider_appliesConstraint(Occiresultprovider occiresultprovider, DiagnosticChain diagnostics, Map<Object, Object> context) { + public boolean validateOcciresultprovider_appliesConstraint(Occiresultprovider occiresultprovider, + DiagnosticChain diagnostics, Map<Object, Object> context) { return occiresultprovider.appliesConstraint(diagnostics, context); } /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ public boolean validateString(String string, DiagnosticChain diagnostics, Map<Object, Object> context) { @@ -313,17 +482,18 @@ public class MonitoringValidator extends EObjectValidator { } /** - * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * Returns the resource locator that will be used to fetch messages for this + * validator's diagnostics. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ @Override public ResourceLocator getResourceLocator() { // TODO - // Specialize this to return a resource locator for messages specific to this validator. + // Specialize this to return a resource locator for messages specific to this + // validator. // Ensure that you remove @generated or mark it @generated NOT return super.getResourceLocator(); } -} //MonitoringValidator +} // MonitoringValidator diff --git a/src/main/java/de/ugoe/cs/rwm/mocci/AbsScaler.java b/src/main/java/de/ugoe/cs/rwm/mocci/AbsScaler.java index 2327815..0e81ad2 100644 --- a/src/main/java/de/ugoe/cs/rwm/mocci/AbsScaler.java +++ b/src/main/java/de/ugoe/cs/rwm/mocci/AbsScaler.java @@ -37,6 +37,7 @@ public abstract class AbsScaler { protected Connector conn; protected Path runtimePath; + @SuppressWarnings("serial") static List<String> interfaces = new ArrayList<String>() { { add("10.254.1.12"); diff --git a/src/main/java/de/ugoe/cs/rwm/mocci/RegistryAndLoggerSetup.java b/src/main/java/de/ugoe/cs/rwm/mocci/RegistryAndLoggerSetup.java index 6ea6565..f4fc1f7 100644 --- a/src/main/java/de/ugoe/cs/rwm/mocci/RegistryAndLoggerSetup.java +++ b/src/main/java/de/ugoe/cs/rwm/mocci/RegistryAndLoggerSetup.java @@ -37,7 +37,6 @@ import ossweruntime.OssweruntimePackage; public class RegistryAndLoggerSetup { - @SuppressWarnings("linelength") static String manNWid = "urn:uuid:29d78078-fb4c-47aa-a9af-b8aaf3339590"; static String manNWRuntimeId = "75a4639e-9ce7-4058-b859-8a711b0e2e7b"; static String sshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6H7Ydi45BTHid4qNppGAi5mzjbnZgt7bi6xLGmZG9CiLmhMsxOuk3Z05Nn+pmoN98qS0eY8S240PPk5VOlYqBY0vdRAwrZSHHaLdMp6I7ARNrI2KraYduweqz7ZQxPXQfwIeYx2HKQxEF2r+4//Fo4WfgdBkLuulvl/Gw3TUzJNQHvgpaiNo9+PI5CZydHnZbjUkRikS12pT+CbNKj+0QKeQztbCd41aKxDv5H0DjltVRcpPppv4dmiU/zoCAIngWLO1PPgfYWyze8Z9IoyBT7Qdg30U91TYZBuxzXR5lq7Fh64y/IZ/SjdOdSIvIuDjtmJDULRdLJzrvubrKY+YH Generated-by-Nova"; diff --git a/src/test/java/de/ugoe/cs/rwm/mocci/ResolveProxyTest.java b/src/test/java/de/ugoe/cs/rwm/mocci/ResolveProxyTest.java index c2ac595..d56110a 100644 --- a/src/test/java/de/ugoe/cs/rwm/mocci/ResolveProxyTest.java +++ b/src/test/java/de/ugoe/cs/rwm/mocci/ResolveProxyTest.java @@ -28,6 +28,7 @@ public class ResolveProxyTest { .get(de.ugoe.cs.rwm.docci.ModelUtility.getPathToResource("occi/hadoopClusterNewExtWithMem.occic")); Resource ress = de.ugoe.cs.rwm.docci.ModelUtility.loadOCCIintoEMFResource(newOCCI); + @SuppressWarnings("unused") ResourceSet resSet = ress.getResourceSet(); EList<EObject> newModel = de.ugoe.cs.rwm.docci.ModelUtility.loadOCCI(newOCCI); -- GitLab