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 @@
*/
package de.ugoe.cs.rwm.mocci.connector;
import org.modmacao.occi.platform.Status;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -109,8 +110,15 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void configure()
{
LOGGER.debug("Action configure() called on " + this);
// TODO: Implement how to configure this datagatherer.
switch(this.getOcciComponentState().getValue()) {
case Status.DEPLOYED_VALUE:
this.setOcciComponentState(Status.INACTIVE);
break;
default:
break;
}
}
// End of user code
// Start of user code Datagatherer_Kind_deploy_action
......@@ -124,8 +132,15 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void deploy()
{
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
// Start of user code Datagatherer_Kind_undeploy_action
......@@ -139,8 +154,30 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void undeploy()
{
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
// Start of user code Datagatherer_Kind_Stop_action
......@@ -154,8 +191,7 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void stop()
{
LOGGER.debug("Action stop() called on " + this);
// TODO: Implement how to stop this datagatherer.
setOcciComponentState(Status.INACTIVE);
}
// End of user code
// Start of user code Datagatherer_Kind_Start_action
......@@ -169,8 +205,21 @@ public class DatagathererConnector extends monitoring.impl.DatagathererImpl
public void start()
{
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
......
......@@ -15,6 +15,7 @@
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;
......@@ -110,8 +111,15 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void configure()
{
LOGGER.debug("Action configure() called on " + this);
// TODO: Implement how to configure this processor.
switch(this.getOcciComponentState().getValue()) {
case Status.DEPLOYED_VALUE:
this.setOcciComponentState(Status.INACTIVE);
break;
default:
break;
}
}
// End of user code
// Start of user code Processor_Kind_deploy_action
......@@ -125,8 +133,15 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void deploy()
{
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
// Start of user code Processor_Kind_undeploy_action
......@@ -140,8 +155,30 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void undeploy()
{
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
// Start of user code Processor_Kind_Stop_action
......@@ -155,8 +192,7 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void stop()
{
LOGGER.debug("Action stop() called on " + this);
// TODO: Implement how to stop this processor.
setOcciComponentState(Status.INACTIVE);
}
// End of user code
// Start of user code Processor_Kind_Start_action
......@@ -170,12 +206,21 @@ public class DataprocessorConnector extends monitoring.impl.DataprocessorImpl
public void start()
{
LOGGER.debug("Action start() called on " + this);
LOGGER.debug("Action start() called on " + this);
switch(this.getOcciComponentState().getValue()) {
System.out.println(this.attributes);
LOGGER.debug("Action start() called on " + this);
//this.attributes.remove(sensorlocation);
System.out.println(this.attributes);
case Status.INACTIVE_VALUE:
this.setOcciComponentState(Status.ACTIVE);
break;
case Status.UNDEPLOYED_VALUE:
this.setOcciComponentState(Status.ACTIVE);
break;
default:
break;
}
}
// End of user code
......
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