summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2019-10-16 03:08:25 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-16 03:08:25 +0000
commitf8c2fbed7eeec18b77bfebeb9c10dc85ecf3ad93 (patch)
treea8b0452f1aa468ce5c23b267c1b4436183221fa6 /docs
parente5e6bcaefdc1f4694297d5e3302ea69b6210f3d9 (diff)
Update git submodules
* Update docs/submodules/vfc/nfvo/lcm.git from branch 'master' to e825014df1fdfa6afb7bb265b18ee95b5729bd0f - Merge "Update ns fault management interface serializer" - Update ns fault management interface serializer Change-Id: Ic6fff9ed5245a94c0be7046c94ad8abea9963f24 Issue-ID: VFC-1551 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'docs')
m---------docs/submodules/vfc/nfvo/lcm.git0
1 files changed, 0 insertions, 0 deletions
diff --git a/docs/submodules/vfc/nfvo/lcm.git b/docs/submodules/vfc/nfvo/lcm.git
-Subproject 430c96c6ac4d8f07bc39a50e7dc9735ce899e97
+Subproject e825014df1fdfa6afb7bb265b18ee95b5729bd0
#n27'>27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
/*-
 * ============LICENSE_START=======================================================
 *  Copyright (C) 2023-2024 Nordix Foundation.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 * ============LICENSE_END=========================================================
 */

package org.onap.policy.clamp.acm.participant.sim.main.handler;

import org.onap.policy.clamp.acm.participant.intermediary.api.CompositionDto;
import org.onap.policy.clamp.acm.participant.intermediary.api.CompositionElementDto;
import org.onap.policy.clamp.acm.participant.intermediary.api.InstanceElementDto;
import org.onap.policy.clamp.acm.participant.intermediary.api.ParticipantIntermediaryApi;
import org.onap.policy.clamp.acm.participant.intermediary.api.impl.AcElementListenerV2;
import org.onap.policy.models.base.PfModelException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Component;

/**
 * This class handles implementation of automationCompositionElement updates.
 */
@ConditionalOnExpression("'${element.handler:AcElementHandlerV2}' == 'AcElementHandlerV2'")
@Component
public class AutomationCompositionElementHandlerV2 extends AcElementListenerV2 {

    private static final Logger LOGGER = LoggerFactory.getLogger(AutomationCompositionElementHandlerV2.class);

    private final SimulatorService simulatorService;

    public AutomationCompositionElementHandlerV2(ParticipantIntermediaryApi intermediaryApi,
        SimulatorService simulatorService) {
        super(intermediaryApi);
        this.simulatorService = simulatorService;
    }

    /**
     * Handle a deploy on a automation composition element.
     *
     * @param compositionElement the information of the Automation Composition Definition Element
     * @param instanceElement the information of the Automation Composition Instance Element
     * @throws PfModelException from Policy framework
     */
    @Override
    public void deploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
            throws PfModelException {
        LOGGER.debug("deploy call compositionElement: {}, instanceElement: {}", compositionElement, instanceElement);
        simulatorService.deploy(instanceElement.instanceId(), instanceElement.elementId());
    }

    /**
     * Handle a automation composition element state change.
     *
     * @param compositionElement the information of the Automation Composition Definition Element
     * @param instanceElement the information of the Automation Composition Instance Element
     * @throws PfModelException from Policy framework
     */
    @Override
    public void undeploy(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
            throws PfModelException {
        LOGGER.debug("undeploy call compositionElement: {}, instanceElement: {}", compositionElement, instanceElement);
        simulatorService.undeploy(instanceElement.instanceId(), instanceElement.elementId());
    }

    @Override
    public void lock(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
            throws PfModelException {
        LOGGER.debug("lock call compositionElement: {}, instanceElement: {}", compositionElement, instanceElement);
        simulatorService.lock(instanceElement.instanceId(), instanceElement.elementId());
    }

    @Override
    public void unlock(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
            throws PfModelException {
        LOGGER.debug("unlock call compositionElement: {}, instanceElement: {}", compositionElement, instanceElement);
        simulatorService.unlock(instanceElement.instanceId(), instanceElement.elementId());
    }

    @Override
    public void delete(CompositionElementDto compositionElement, InstanceElementDto instanceElement)
            throws PfModelException {
        LOGGER.debug("delete call compositionElement: {}, instanceElement: {}", compositionElement, instanceElement);
        simulatorService.delete(instanceElement.instanceId(), instanceElement.elementId());
    }

    @Override
    public void update(CompositionElementDto compositionElement, InstanceElementDto instanceElement,
                       InstanceElementDto instanceElementUpdated) throws PfModelException {
        LOGGER.debug("update call compositionElement: {}, instanceElement: {}, instanceElementUpdated: {}",
                compositionElement, instanceElement, instanceElementUpdated);
        simulatorService.update(instanceElement.instanceId(), instanceElement.elementId());
    }

    @Override
    public void prime(CompositionDto composition) throws PfModelException {
        LOGGER.debug("prime call composition: {}", composition);
        simulatorService.prime(composition.compositionId());
    }

    @Override
    public void deprime(CompositionDto composition) throws PfModelException {
        LOGGER.debug("deprime call composition: {}", composition);
        simulatorService.deprime(composition.compositionId());
    }

    @Override
    public void migrate(CompositionElementDto compositionElement, CompositionElementDto compositionElementTarget,
                        InstanceElementDto instanceElement, InstanceElementDto instanceElementMigrate)
            throws PfModelException {
        LOGGER.debug("migrate call compositionElement: {}, compositionElementTarget: {}, instanceElement: {},"
                        + " instanceElementMigrate: {}",
                compositionElement, compositionElementTarget, instanceElement, instanceElementMigrate);
        simulatorService.migrate(instanceElement.instanceId(), instanceElement.elementId());
    }
}