All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onosproject.upgrade.UpgradeService Maven / Gradle / Ivy

There is a newer version: 2.7.0
Show newest version
/*
 * Copyright 2017-present Open Networking 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.
 */
package org.onosproject.upgrade;

import com.google.common.annotations.Beta;
import org.onosproject.core.Version;
import org.onosproject.event.ListenerService;

/**
 * Upgrade service.
 */
@Beta
public interface UpgradeService
        extends ListenerService {

    /**
     * Returns the current upgrade state.
     *
     * @return the current upgrade state
     */
    Upgrade getState();

    /**
     * Returns whether an upgrade is in progress.
     * 

* An upgrade is in progress if the upgrade {@link Upgrade.Status} is active, e.g. * {@link Upgrade.Status#INITIALIZED}, {@link Upgrade.Status#UPGRADED}, etc. * * @return indicates whether an upgrade is in progress */ boolean isUpgrading(); /** * Returns the currently active software version. *

* The returned version is representative of the version currently in control of the network. When the upgrade * transitions to the {@link Upgrade.Status#UPGRADING} state, control over the network is transferred from * {@link Upgrade#source()} nodes to {@link Upgrade#target()} nodes, and the version returned by this method * represents that change. * * @return the software version */ Version getVersion(); /** * Returns whether the local node is active. *

* The local node will be active if its {@link Version} matches the version returned by {@link #getVersion()}. * * @return indicates whether the local node is active according to its version */ boolean isLocalActive(); /** * Returns whether the local node is an upgraded node. * * @return {@code true} if the local node's version matches {@link Upgrade#target()} */ boolean isLocalUpgraded(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy