Search in sources :

Example 1 with SystemadaptationFactory

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;
}
Also used : Allocation(org.palladiosimulator.pcm.allocation.Allocation) SystemadaptationFactory(org.iobserve.planning.systemadaptation.SystemadaptationFactory) AllocateAction(org.iobserve.planning.systemadaptation.AllocateAction)

Example 2 with SystemadaptationFactory

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;
}
Also used : AcquireAction(org.iobserve.planning.systemadaptation.AcquireAction) ResourceEnvironment(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment) SystemadaptationFactory(org.iobserve.planning.systemadaptation.SystemadaptationFactory) ResourceContainer(org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)

Example 3 with SystemadaptationFactory

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;
}
Also used : Allocation(org.palladiosimulator.pcm.allocation.Allocation) SystemadaptationFactory(org.iobserve.planning.systemadaptation.SystemadaptationFactory) DeallocateAction(org.iobserve.planning.systemadaptation.DeallocateAction)

Example 4 with SystemadaptationFactory

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;
}
Also used : AllocationContext(org.palladiosimulator.pcm.allocation.AllocationContext) ResourceEnvironment(org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment) Allocation(org.palladiosimulator.pcm.allocation.Allocation) SystemadaptationFactory(org.iobserve.planning.systemadaptation.SystemadaptationFactory) ComponentNode(org.iobserve.analysis.data.graph.ComponentNode) ReplicateAction(org.iobserve.planning.systemadaptation.ReplicateAction) ResourceContainer(org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)

Example 5 with SystemadaptationFactory

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;
}
Also used : TerminateAction(org.iobserve.planning.systemadaptation.TerminateAction) SystemadaptationFactory(org.iobserve.planning.systemadaptation.SystemadaptationFactory)

Aggregations

SystemadaptationFactory (org.iobserve.planning.systemadaptation.SystemadaptationFactory)5 Allocation (org.palladiosimulator.pcm.allocation.Allocation)3 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)2 ResourceEnvironment (org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment)2 ComponentNode (org.iobserve.analysis.data.graph.ComponentNode)1 AcquireAction (org.iobserve.planning.systemadaptation.AcquireAction)1 AllocateAction (org.iobserve.planning.systemadaptation.AllocateAction)1 DeallocateAction (org.iobserve.planning.systemadaptation.DeallocateAction)1 ReplicateAction (org.iobserve.planning.systemadaptation.ReplicateAction)1 TerminateAction (org.iobserve.planning.systemadaptation.TerminateAction)1 AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)1