use of org.iobserve.planning.systemadaptation.SystemadaptationFactory in project iobserve-analysis by research-iobserve.
the class AssemblyContextActionFactory method generateAllocateAction.
/**
* Create an allocation action.
*
* @param runtimeNode
* node to be allocated
* @param reDeploymentNode
* node to be deployed
* @return returns the allocation action
*/
public static AllocateAction generateAllocateAction(final ComponentNode runtimeNode, final ComponentNode reDeploymentNode) {
final SystemadaptationFactory factory = SystemadaptationFactory.eINSTANCE;
final AllocateAction action = factory.createAllocateAction();
// Allcotaion has no runtime component
// AssemblyContextActionFactory.setSourceAssemblyContext(action,
// runtimeNode.getAssemblyContextID());
final org.palladiosimulator.pcm.system.System reDeplSystem = ActionFactory.getRedeploymentModels().getSystemModel();
action.setSourceAssemblyContext(ActionFactory.getAssemblyContext(reDeploymentNode.getAssemblyContextID(), reDeplSystem));
final Allocation reDeplAllocation = ActionFactory.getRedeploymentModels().getAllocationModel();
action.setNewAllocationContext(ActionFactory.getAllocationContext(reDeploymentNode.getAllocationContextID(), reDeplAllocation));
return action;
}
use of org.iobserve.planning.systemadaptation.SystemadaptationFactory in project iobserve-analysis by research-iobserve.
the class ResourceContainerActionFactory method createAcquireAction.
/**
* Create a acquire action.
*
* @param reDeploymentServer
* the node where components can be deployed on
* @return the action
*/
public static AcquireAction createAcquireAction(final DeploymentNode reDeploymentServer) {
final SystemadaptationFactory factory = SystemadaptationFactory.eINSTANCE;
final AcquireAction action = factory.createAcquireAction();
final ResourceEnvironment reDeplResEnvModel = ActionFactory.getRedeploymentModels().getResourceEnvironmentModel();
final ResourceContainer resourceContainer = ActionFactory.getResourceContainer(reDeploymentServer.getResourceContainerID(), reDeplResEnvModel);
action.setSourceResourceContainer(resourceContainer);
return action;
}
use of org.iobserve.planning.systemadaptation.SystemadaptationFactory in project iobserve-analysis by research-iobserve.
the class AssemblyContextActionFactory method generateDeallocateAction.
/**
* Create a deallocation action.
*
* @param runtimeNode
* node to be deallocated
* @return returns the deallocation action
*/
public static DeallocateAction generateDeallocateAction(final ComponentNode runtimeNode) {
final SystemadaptationFactory factory = SystemadaptationFactory.eINSTANCE;
final DeallocateAction action = factory.createDeallocateAction();
AssemblyContextActionFactory.setSourceAssemblyContext(action, runtimeNode.getAssemblyContextID());
final Allocation runAllocation = ActionFactory.getRuntimeModels().getAllocationModel();
action.setOldAllocationContext(ActionFactory.getAllocationContext(runtimeNode.getAllocationContextID(), runAllocation));
return action;
}
use of org.iobserve.planning.systemadaptation.SystemadaptationFactory in project iobserve-analysis by research-iobserve.
the class ResourceContainerActionFactory method createReplicateAction.
/**
* Create replicate action.
*
* @param runtimeServer
* source server
* @param reDeploymentServer
* target server
* @return the action
*/
public static ReplicateAction createReplicateAction(final DeploymentNode runtimeServer, final DeploymentNode reDeploymentServer) {
final SystemadaptationFactory factory = SystemadaptationFactory.eINSTANCE;
final ReplicateAction action = factory.createReplicateAction();
ResourceContainerActionFactory.setSourceResourceContainer(action, runtimeServer.getResourceContainerID());
final Allocation runtimeAllocModel = ActionFactory.getRuntimeModels().getAllocationModel();
for (final ComponentNode component : runtimeServer.getContainingComponents()) {
final AllocationContext oldAllocationContext = ActionFactory.getAllocationContext(component.getAllocationContextID(), runtimeAllocModel);
action.getSourceAllocationContext().add(oldAllocationContext);
}
final Allocation reDeplAllocModel = ActionFactory.getRedeploymentModels().getAllocationModel();
for (final ComponentNode component : reDeploymentServer.getContainingComponents()) {
final AllocationContext newAllocationContext = ActionFactory.getAllocationContext(component.getAllocationContextID(), reDeplAllocModel);
action.getSourceAllocationContext().add(newAllocationContext);
}
final ResourceEnvironment resEnvModel = ActionFactory.getRedeploymentModels().getResourceEnvironmentModel();
final ResourceContainer newResourceContainer = ActionFactory.getResourceContainer(reDeploymentServer.getResourceContainerID(), resEnvModel);
action.setNewResourceContainer(newResourceContainer);
return action;
}
use of org.iobserve.planning.systemadaptation.SystemadaptationFactory in project iobserve-analysis by research-iobserve.
the class ResourceContainerActionFactory method createTerminateAction.
/**
* Create a terminate action.
*
* @param runtimeServer
* the node going to be terminated
* @return the action
*/
public static TerminateAction createTerminateAction(final DeploymentNode runtimeServer) {
final SystemadaptationFactory factory = SystemadaptationFactory.eINSTANCE;
final TerminateAction action = factory.createTerminateAction();
ResourceContainerActionFactory.setSourceResourceContainer(action, runtimeServer.getResourceContainerID());
return action;
}
Aggregations