Skip to content
Snippets Groups Projects
Commit f331c68b authored by erbel's avatar erbel
Browse files

Added MonitoringProperty Mixin

parent 7cd75001
No related branches found
No related tags found
No related merge requests found
Pipeline #85452 failed
Showing
with 444 additions and 143 deletions
connection.project.dir=
connection.project.dir=de.ugoe.cs.rwm.mocci.connector
eclipse.preferences.version=1
......@@ -70,8 +70,8 @@ dependencies {
//own
compile group: 'de.ugoe.cs.rwm', name: 'cocci', version: '1.0.0'
compile group: 'de.ugoe.cs.rwm', name: 'docci', version: '1.0.0'
compile group: 'de.ugoe.cs.rwm.mocci', name: 'model', version: '1.0.0'
//compile project(':de.ugoe.cs.rwm.mocci.model')
//compile group: 'de.ugoe.cs.rwm.mocci', name: 'model', version: '1.0.0'
compile project(':de.ugoe.cs.rwm.mocci.model')
//modmacao
compile group: 'org.modmacao', name: 'core', version: '1.0.0'
compile group: 'org.modmacao', name: 'placement', version: '1.0.0'
......@@ -127,7 +127,7 @@ javadoc {
failOnError = true
}
test {
exclude 'de/ugoe/cs/rwm/mocci/live/**'
//exclude 'de/ugoe/cs/rwm/mocci/live/**'
testLogging.showStandardStreams = true
testLogging {
exceptionFormat = 'full'
......
connection.project.dir=..
connection.project.dir=../de.ugoe.cs.rwm.mocci.connector
eclipse.preferences.version=1
/de/
connection.project.dir=..
connection.project.dir=
eclipse.preferences.version=1
......@@ -9,6 +9,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Require-Bundle: org.slf4j.api,
org.eclipse.cmf.occi.core,
de.ugoe.cs.rwm.mocci.model,
org.modmacao.occi.platform
de.ugoe.cs.rwm.mocci.model
Export-Package: de.ugoe.cs.rwm.mocci.connector
......@@ -33,6 +33,7 @@ dependencies {
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', name: 'core', 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'
......
package de.ugoe.cs.rwm.mocci.connector;
import java.util.LinkedList;
import java.util.List;
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;
import modmacao.Executiondependency;
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;
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;
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:
*/
public void deploy()
{
int status = -1;
// Component State Machine.
switch(comp.getOcciComponentState().getValue()) {
case Status.UNDEPLOYED_VALUE:
for (Component component: getInstallDependendComps()) {
component.deploy();
}
status = cmtool.deploy(comp);
if (status == 0 && assertCompsStatusEquals(getInstallDependendComps(), Status.DEPLOYED))
comp.setOcciComponentState(Status.DEPLOYED);
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:
*/
public void configure()
{
int status = -1;
// Component State Machine.
switch(comp.getOcciComponentState().getValue()) {
case Status.DEPLOYED_VALUE:
for (Component component: getInstallDependendComps()) {
component.configure();
}
status = cmtool.configure(comp);
if (status == 0 && assertCompsStatusEquals(getInstallDependendComps(), Status.INACTIVE))
comp.setOcciComponentState(Status.INACTIVE);
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.
*/
public void start()
{
int status = -1;
// Component State Machine.
switch(comp.getOcciComponentState().getValue()) {
case Status.INACTIVE_VALUE:
for (Component component: getExecutionDependendComps()) {
component.start();
}
status = cmtool.start(comp);
if (status == 0 && assertCompsStatusEquals(getExecutionDependendComps(), Status.ACTIVE))
comp.setOcciComponentState(Status.ACTIVE);
else
comp.setOcciComponentState(Status.ERROR);
break;
case Status.UNDEPLOYED_VALUE:
for (Component component: getInstallDependendComps()) {
component.deploy();
}
comp.deploy();
for (Component component: getInstallDependendComps()) {
component.configure();
}
comp.configure();
for (Component component: getExecutionDependendComps()) {
component.start();
}
status = cmtool.start(comp);
if (status == 0 && assertCompsStatusEquals(getExecutionDependendComps(), Status.ACTIVE))
comp.setOcciComponentState(Status.ACTIVE);
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.
*/
public void stop()
{
int status = -1;
// Component State Machine.
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(){
LinkedList<Component> dependendComponents = new LinkedList<Component>();
for (Link link: comp.getLinks()) {
for (MixinBase mixin: link.getParts()) {
if (mixin instanceof Installationdependency) {
dependendComponents.add((Component) link.getTarget());
break;
}
}
}
return dependendComponents;
}
private List<Component> getExecutionDependendComps(){
LinkedList<Component> dependendComponents = new LinkedList<Component>();
for (Link link: comp.getLinks()) {
for (MixinBase mixin: link.getParts()) {
if (mixin instanceof Executiondependency) {
dependendComponents.add((Component) link.getTarget());
break;
}
}
}
return dependendComponents;
}
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
......@@ -10,7 +10,7 @@
* - 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
* Generated at Mon Dec 10 09:47: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;
......
......@@ -10,7 +10,7 @@
* - 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
* Generated at Mon Dec 10 09:47: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;
......@@ -31,6 +31,7 @@ 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
/**
......@@ -39,6 +40,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
DatagathererConnector()
{
LOGGER.debug("Constructor called on " + this);
this.compMan = new ComponentManager(this);
// TODO: Implement this constructor.
}
// End of user code
......@@ -109,38 +111,38 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void undeploy()
{
LOGGER.debug("Action undeploy() called on " + this);
compMan.undeploy();
// TODO: Implement how to undeploy this datagatherer.
}
// End of user code
// Start of user code Datagatherer_Kind_deploy_action
// Start of user code Datagatherer_Kind_configure_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: deploy
* - term: configure
* - title:
*/
@Override
public void deploy()
public void configure()
{
LOGGER.debug("Action deploy() called on " + this);
// TODO: Implement how to deploy this datagatherer.
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_configure_action
// Start of user code Datagatherer_Kind_Stop_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: configure
* - title:
* - term: stop
* - title: Stop the application.
*/
@Override
public void configure()
public void stop()
{
LOGGER.debug("Action configure() called on " + this);
// TODO: Implement how to configure this datagatherer.
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
......@@ -154,23 +156,23 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
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_Stop_action
// Start of user code Datagatherer_Kind_deploy_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: stop
* - title: Stop the application.
* - term: deploy
* - title:
*/
@Override
public void stop()
public void deploy()
{
LOGGER.debug("Action stop() called on " + this);
// TODO: Implement how to stop this datagatherer.
LOGGER.debug("Action deploy() called on " + this);
compMan.deploy();
// TODO: Implement how to deploy this datagatherer.
}
// End of user code
......
......@@ -10,7 +10,7 @@
* - 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
* Generated at Mon Dec 10 09:47: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;
......
......@@ -10,7 +10,7 @@
* - 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
* Generated at Mon Dec 10 09:47: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;
......@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
*/
public class ProcessorConnector extends monitoring.impl.ProcessorImpl
{
private ComponentManager compMan;
/**
* Initialize the logger.
*/
......@@ -39,6 +40,7 @@ public class ProcessorConnector extends monitoring.impl.ProcessorImpl
ProcessorConnector()
{
LOGGER.debug("Constructor called on " + this);
this.compMan = new ComponentManager(this);
// TODO: Implement this constructor.
}
// End of user code
......@@ -109,38 +111,39 @@ public class ProcessorConnector extends monitoring.impl.ProcessorImpl
public void undeploy()
{
LOGGER.debug("Action undeploy() called on " + this);
compMan.undeploy();
// TODO: Implement how to undeploy this processor.
}
// End of user code
// Start of user code Processor_Kind_deploy_action
// Start of user code Processor_Kind_configure_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: deploy
* - term: configure
* - title:
*/
@Override
public void deploy()
public void configure()
{
LOGGER.debug("Action deploy() called on " + this);
// TODO: Implement how to deploy this processor.
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_configure_action
// Start of user code Processor_Kind_Stop_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: configure
* - title:
* - term: stop
* - title: Stop the application.
*/
@Override
public void configure()
public void stop()
{
LOGGER.debug("Action configure() called on " + this);
LOGGER.debug("Action stop() called on " + this);
compMan.stop();
// TODO: Implement how to configure this processor.
// TODO: Implement how to stop this processor.
}
// End of user code
// Start of user code Processor_Kind_Start_action
......@@ -154,23 +157,23 @@ public class ProcessorConnector extends monitoring.impl.ProcessorImpl
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_Stop_action
// Start of user code Processor_Kind_deploy_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: stop
* - title: Stop the application.
* - term: deploy
* - title:
*/
@Override
public void stop()
public void deploy()
{
LOGGER.debug("Action stop() called on " + this);
// TODO: Implement how to stop this processor.
LOGGER.debug("Action deploy() called on " + this);
compMan.deploy();
// TODO: Implement how to deploy this processor.
}
// End of user code
......
......@@ -10,7 +10,7 @@
* - 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
* Generated at Mon Dec 10 09:47: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;
......@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
*/
public class PublisherConnector extends monitoring.impl.PublisherImpl
{
private ComponentManager compMan;
/**
* Initialize the logger.
*/
......@@ -39,6 +40,7 @@ public class PublisherConnector extends monitoring.impl.PublisherImpl
PublisherConnector()
{
LOGGER.debug("Constructor called on " + this);
this.compMan = new ComponentManager(this);
// TODO: Implement this constructor.
}
// End of user code
......@@ -109,38 +111,38 @@ public class PublisherConnector extends monitoring.impl.PublisherImpl
public void undeploy()
{
LOGGER.debug("Action undeploy() called on " + this);
compMan.undeploy();
// TODO: Implement how to undeploy this publisher.
}
// End of user code
// Start of user code Publisher_Kind_deploy_action
// Start of user code Publisher_Kind_configure_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: deploy
* - term: configure
* - title:
*/
@Override
public void deploy()
public void configure()
{
LOGGER.debug("Action deploy() called on " + this);
// TODO: Implement how to deploy this publisher.
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_configure_action
// Start of user code Publisher_Kind_Stop_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: configure
* - title:
* - term: stop
* - title: Stop the application.
*/
@Override
public void configure()
public void stop()
{
LOGGER.debug("Action configure() called on " + this);
// TODO: Implement how to configure this publisher.
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
......@@ -154,23 +156,23 @@ public class PublisherConnector extends monitoring.impl.PublisherImpl
public void start()
{
LOGGER.debug("Action start() called on " + this);
compMan.start();
// TODO: Implement how to start this publisher.
}
// End of user code
// Start of user code Publisher_Kind_Stop_action
// Start of user code Publisher_Kind_deploy_action
/**
* Implement OCCI action:
* - scheme: http://schemas.modmacao.org/occi/platform/component/action#
* - term: stop
* - title: Stop the application.
* - term: deploy
* - title:
*/
@Override
public void stop()
public void deploy()
{
LOGGER.debug("Action stop() called on " + this);
// TODO: Implement how to stop this publisher.
LOGGER.debug("Action deploy() called on " + this);
compMan.deploy();
// TODO: Implement how to deploy this publisher.
}
// End of user code
......
......@@ -10,7 +10,7 @@
* - 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
* Generated at Mon Dec 10 09:47: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;
......@@ -20,7 +20,6 @@ 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;
......@@ -39,7 +38,6 @@ public class SensorConnector extends monitoring.impl.SensorImpl
{
private ConfigurationManagementTool cmtool = new AnsibleCMTool();
/**
* Initialize the logger.
*/
......@@ -111,6 +109,41 @@ public class SensorConnector extends monitoring.impl.SensorImpl
// Sensor actions.
//
// 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.
*/
@Override
public void stop()
{
int status = -1;
LOGGER.debug("Action stop() called on " + this);
// Application State Machine.
switch(getOcciAppState().getValue()) {
case Status.ACTIVE_VALUE:
LOGGER.debug("Fire transition(state=active, action=\"stop\")...");
for (Component component: this.getConnectedComponents()) {
component.stop();
}
status = cmtool.stop(this);
if (status == 0 && assertCompsStatusEquals(getConnectedComponents(), Status.INACTIVE))
setOcciAppState(Status.INACTIVE);
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:
......@@ -216,41 +249,6 @@ public class SensorConnector extends monitoring.impl.SensorImpl
}
}
// 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.
*/
@Override
public void stop()
{
int status = -1;
LOGGER.debug("Action stop() called on " + this);
// Application State Machine.
switch(getOcciAppState().getValue()) {
case Status.ACTIVE_VALUE:
LOGGER.debug("Fire transition(state=active, action=\"stop\")...");
for (Component component: this.getConnectedComponents()) {
component.stop();
}
status = cmtool.stop(this);
if (status == 0 && assertCompsStatusEquals(getConnectedComponents(), Status.INACTIVE))
setOcciAppState(Status.INACTIVE);
else
setOcciAppState(Status.ERROR);
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:
......@@ -345,16 +343,7 @@ public class SensorConnector extends monitoring.impl.SensorImpl
}
}
// End of user code
private List<Component> getConnectedComponents() {
LinkedList<Component> connectedComponents = new LinkedList<Component>();
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) {
......@@ -367,6 +356,16 @@ public class SensorConnector extends monitoring.impl.SensorImpl
}
return true;
}
private List<Component> getConnectedComponents() {
LinkedList<Component> connectedComponents = new LinkedList<Component>();
for (Link link: this.getLinks()) {
if (link instanceof Componentlink) {
connectedComponents.add((Component) link.getTarget());
}
}
return connectedComponents;
}
}
......@@ -3,5 +3,6 @@
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
connection.project.dir=..
connection.project.dir=../de.ugoe.cs.rwm.mocci.connector
eclipse.preferences.version=1
......@@ -52,3 +52,8 @@ _UI_Monitoringattribute_monitoringAttributeValue_feature = Monitoring Attribute
_UI_Monitoringproperty_type = Monitoringproperty
_UI_Monitoringproperty_monitoringAttributeName_feature = Monitoring Attribute Name
_UI_Monitoringproperty_monitoringAttributeValue_feature = Monitoring Attribute Value
_UI_Monitoringproperty_monitoringPropertyName_feature = Monitoring Property Name
_UI_Monitoringproperty_monitoringPropertyValue_feature = Monitoring Property Value
_UI_Monitoringproperty_monitoringPropertyId_feature = Monitoring Property Id
_UI_Sensor_monitoringPropertyId_feature = Monitoring Property Id
_UI_Sensor_monitoringPropertyMixin_feature = Monitoring Property Mixin
......@@ -59,26 +59,27 @@ public class MonitoringpropertyItemProvider extends MixinBaseItemProvider {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addMonitoringAttributeNamePropertyDescriptor(object);
addMonitoringAttributeValuePropertyDescriptor(object);
addMonitoringPropertyNamePropertyDescriptor(object);
addMonitoringPropertyValuePropertyDescriptor(object);
addMonitoringPropertyIdPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Monitoring Attribute Name feature.
* This adds a property descriptor for the Monitoring Property Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMonitoringAttributeNamePropertyDescriptor(Object object) {
protected void addMonitoringPropertyNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Monitoringproperty_monitoringAttributeName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Monitoringproperty_monitoringAttributeName_feature", "_UI_Monitoringproperty_type"),
MonitoringPackage.Literals.MONITORINGPROPERTY__MONITORING_ATTRIBUTE_NAME,
getString("_UI_Monitoringproperty_monitoringPropertyName_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Monitoringproperty_monitoringPropertyName_feature", "_UI_Monitoringproperty_type"),
MonitoringPackage.Literals.MONITORINGPROPERTY__MONITORING_PROPERTY_NAME,
true,
false,
false,
......@@ -88,19 +89,41 @@ public class MonitoringpropertyItemProvider extends MixinBaseItemProvider {
}
/**
* This adds a property descriptor for the Monitoring Attribute Value feature.
* This adds a property descriptor for the Monitoring Property Value feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMonitoringAttributeValuePropertyDescriptor(Object object) {
protected void addMonitoringPropertyValuePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Monitoringproperty_monitoringAttributeValue_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Monitoringproperty_monitoringAttributeValue_feature", "_UI_Monitoringproperty_type"),
MonitoringPackage.Literals.MONITORINGPROPERTY__MONITORING_ATTRIBUTE_VALUE,
getString("_UI_Monitoringproperty_monitoringPropertyValue_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Monitoringproperty_monitoringPropertyValue_feature", "_UI_Monitoringproperty_type"),
MonitoringPackage.Literals.MONITORINGPROPERTY__MONITORING_PROPERTY_VALUE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Monitoring Property Id feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMonitoringPropertyIdPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Monitoringproperty_monitoringPropertyId_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Monitoringproperty_monitoringPropertyId_feature", "_UI_Monitoringproperty_type"),
MonitoringPackage.Literals.MONITORINGPROPERTY__MONITORING_PROPERTY_ID,
true,
false,
false,
......@@ -128,7 +151,7 @@ public class MonitoringpropertyItemProvider extends MixinBaseItemProvider {
*/
@Override
public String getText(Object object) {
String label = ((Monitoringproperty)object).getMonitoringAttributeName();
String label = ((Monitoringproperty)object).getMonitoringPropertyName();
return label == null || label.length() == 0 ?
getString("_UI_Monitoringproperty_type") :
getString("_UI_Monitoringproperty_type") + " " + label;
......@@ -147,8 +170,9 @@ public class MonitoringpropertyItemProvider extends MixinBaseItemProvider {
updateChildren(notification);
switch (notification.getFeatureID(Monitoringproperty.class)) {
case MonitoringPackage.MONITORINGPROPERTY__MONITORING_ATTRIBUTE_NAME:
case MonitoringPackage.MONITORINGPROPERTY__MONITORING_ATTRIBUTE_VALUE:
case MonitoringPackage.MONITORINGPROPERTY__MONITORING_PROPERTY_NAME:
case MonitoringPackage.MONITORINGPROPERTY__MONITORING_PROPERTY_VALUE:
case MonitoringPackage.MONITORINGPROPERTY__MONITORING_PROPERTY_ID:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
......
......@@ -69,6 +69,7 @@ public class SensorItemProvider extends ApplicationItemProvider {
addOcciSensorPeriodPropertyDescriptor(object);
addOcciSensorGranularityPropertyDescriptor(object);
addOcciSensorAccuracyPropertyDescriptor(object);
addMonitoringPropertyMixinPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
......@@ -205,6 +206,28 @@ public class SensorItemProvider extends ApplicationItemProvider {
null));
}
/**
* This adds a property descriptor for the Monitoring Property Mixin feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMonitoringPropertyMixinPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Sensor_monitoringPropertyMixin_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Sensor_monitoringPropertyMixin_feature", "_UI_Sensor_type"),
MonitoringPackage.Literals.SENSOR__MONITORING_PROPERTY_MIXIN,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This returns Sensor.gif.
* <!-- begin-user-doc -->
......@@ -249,6 +272,7 @@ public class SensorItemProvider extends ApplicationItemProvider {
case MonitoringPackage.SENSOR__OCCI_SENSOR_PERIOD:
case MonitoringPackage.SENSOR__OCCI_SENSOR_GRANULARITY:
case MonitoringPackage.SENSOR__OCCI_SENSOR_ACCURACY:
case MonitoringPackage.SENSOR__MONITORING_PROPERTY_MIXIN:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
......
......@@ -3,5 +3,6 @@
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment