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

Improved Dummy States

parent 88c7c68d
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
package de.ugoe.cs.rwm.mocci.connector; package de.ugoe.cs.rwm.mocci.connector;
import org.modmacao.occi.platform.Status;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -109,8 +110,15 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl ...@@ -109,8 +110,15 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void configure() public void configure()
{ {
LOGGER.debug("Action configure() called on " + this); LOGGER.debug("Action configure() called on " + this);
switch(this.getOcciComponentState().getValue()) {
// TODO: Implement how to configure this datagatherer.
case Status.DEPLOYED_VALUE:
this.setOcciComponentState(Status.INACTIVE);
break;
default:
break;
}
} }
// End of user code // End of user code
// Start of user code Datagatherer_Kind_deploy_action // Start of user code Datagatherer_Kind_deploy_action
...@@ -124,8 +132,15 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl ...@@ -124,8 +132,15 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void deploy() public void deploy()
{ {
LOGGER.debug("Action deploy() called on " + this); LOGGER.debug("Action deploy() called on " + this);
switch(this.getOcciComponentState().getValue()) {
// TODO: Implement how to deploy this datagatherer. case Status.UNDEPLOYED_VALUE:
this.setOcciComponentState(Status.DEPLOYED);
break;
default:
break;
}
} }
// End of user code // End of user code
// Start of user code Datagatherer_Kind_undeploy_action // Start of user code Datagatherer_Kind_undeploy_action
...@@ -139,8 +154,30 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl ...@@ -139,8 +154,30 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void undeploy() public void undeploy()
{ {
LOGGER.debug("Action undeploy() called on " + this); LOGGER.debug("Action undeploy() called on " + this);
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;
// TODO: Implement how to undeploy this datagatherer. case Status.ERROR_VALUE:
this.setOcciComponentState(Status.UNDEPLOYED);
break;
default:
break;
}
} }
// End of user code // End of user code
// Start of user code Datagatherer_Kind_Stop_action // Start of user code Datagatherer_Kind_Stop_action
...@@ -154,8 +191,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl ...@@ -154,8 +191,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void stop() public void stop()
{ {
LOGGER.debug("Action stop() called on " + this); LOGGER.debug("Action stop() called on " + this);
setOcciComponentState(Status.INACTIVE);
// TODO: Implement how to stop this datagatherer.
} }
// End of user code // End of user code
// Start of user code Datagatherer_Kind_Start_action // Start of user code Datagatherer_Kind_Start_action
...@@ -169,8 +205,21 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl ...@@ -169,8 +205,21 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void start() public void start()
{ {
LOGGER.debug("Action start() called on " + this); LOGGER.debug("Action start() called on " + this);
switch(this.getOcciComponentState().getValue()) {
case Status.INACTIVE_VALUE:
this.setOcciComponentState(Status.ACTIVE);
break;
// TODO: Implement how to start this datagatherer. case Status.UNDEPLOYED_VALUE:
this.setOcciComponentState(Status.ACTIVE);
break;
default:
break;
}
} }
// End of user code // End of user code
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
package de.ugoe.cs.rwm.mocci.connector; package de.ugoe.cs.rwm.mocci.connector;
import org.eclipse.cmf.occi.core.AttributeState; import org.eclipse.cmf.occi.core.AttributeState;
import org.modmacao.occi.platform.Status;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -110,8 +111,15 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl ...@@ -110,8 +111,15 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void configure() public void configure()
{ {
LOGGER.debug("Action configure() called on " + this); LOGGER.debug("Action configure() called on " + this);
switch(this.getOcciComponentState().getValue()) {
// TODO: Implement how to configure this processor.
case Status.DEPLOYED_VALUE:
this.setOcciComponentState(Status.INACTIVE);
break;
default:
break;
}
} }
// End of user code // End of user code
// Start of user code Processor_Kind_deploy_action // Start of user code Processor_Kind_deploy_action
...@@ -125,8 +133,15 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl ...@@ -125,8 +133,15 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void deploy() public void deploy()
{ {
LOGGER.debug("Action deploy() called on " + this); LOGGER.debug("Action deploy() called on " + this);
switch(this.getOcciComponentState().getValue()) {
// TODO: Implement how to deploy this processor. case Status.UNDEPLOYED_VALUE:
this.setOcciComponentState(Status.DEPLOYED);
break;
default:
break;
}
} }
// End of user code // End of user code
// Start of user code Processor_Kind_undeploy_action // Start of user code Processor_Kind_undeploy_action
...@@ -140,8 +155,30 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl ...@@ -140,8 +155,30 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void undeploy() public void undeploy()
{ {
LOGGER.debug("Action undeploy() called on " + this); LOGGER.debug("Action undeploy() called on " + this);
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;
// TODO: Implement how to undeploy this processor. default:
break;
}
} }
// End of user code // End of user code
// Start of user code Processor_Kind_Stop_action // Start of user code Processor_Kind_Stop_action
...@@ -155,8 +192,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl ...@@ -155,8 +192,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void stop() public void stop()
{ {
LOGGER.debug("Action stop() called on " + this); LOGGER.debug("Action stop() called on " + this);
setOcciComponentState(Status.INACTIVE);
// TODO: Implement how to stop this processor.
} }
// End of user code // End of user code
// Start of user code Processor_Kind_Start_action // Start of user code Processor_Kind_Start_action
...@@ -170,12 +206,21 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl ...@@ -170,12 +206,21 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void start() public void start()
{ {
LOGGER.debug("Action start() called on " + this); LOGGER.debug("Action start() called on " + this);
LOGGER.debug("Action start() called on " + this); switch(this.getOcciComponentState().getValue()) {
System.out.println(this.attributes); case Status.INACTIVE_VALUE:
LOGGER.debug("Action start() called on " + this); this.setOcciComponentState(Status.ACTIVE);
//this.attributes.remove(sensorlocation); break;
System.out.println(this.attributes);
case Status.UNDEPLOYED_VALUE:
this.setOcciComponentState(Status.ACTIVE);
break;
default:
break;
}
} }
// End of user code // End of user code
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment