Search in sources :

Example 21 with IReplicationController

use of com.openshift.restclient.model.IReplicationController in project jbosstools-openshift by jbosstools.

the class ScaleDeploymentHandler method getDeploymentConfig.

private IDeploymentConfig getDeploymentConfig(IResourceWrapper<?, ?> wrapper) {
    if (wrapper == null) {
        return null;
    }
    IDeploymentConfig dc = null;
    IResource wrapped = wrapper.getWrapped();
    if (wrapper instanceof IServiceWrapper) {
        // service selected
        dc = getDeploymentConfig((IServiceWrapper) wrapper);
    } else if (wrapped instanceof IPod) {
        // pod selected
        dc = getDeploymentConfig((IPod) wrapped, wrapper);
    } else if (wrapped instanceof IDeploymentConfig) {
        // deployment config selected
        // has to be tested before IReplicationController, IDeploymentConfig extends IReplicationController
        dc = (IDeploymentConfig) wrapped;
    } else if (wrapped instanceof IReplicationController) {
        // replication controller selected (deployment tab in properties)
        // has to be tested after IDeploymentConfig, IDeploymentConfig extends IReplicationController
        dc = getDeploymentConfig((IReplicationController) wrapped, wrapper);
    }
    return dc;
}
Also used : IServiceWrapper(org.jboss.tools.openshift.internal.ui.models.IServiceWrapper) IDeploymentConfig(com.openshift.restclient.model.IDeploymentConfig) IResource(com.openshift.restclient.model.IResource) IPod(com.openshift.restclient.model.IPod) IReplicationController(com.openshift.restclient.model.IReplicationController)

Aggregations

IReplicationController (com.openshift.restclient.model.IReplicationController)21 IResource (com.openshift.restclient.model.IResource)9 Connection (org.jboss.tools.openshift.core.connection.Connection)7 Test (org.junit.Test)7 IPod (com.openshift.restclient.model.IPod)6 ResourceKind (com.openshift.restclient.ResourceKind)5 IDeploymentConfig (com.openshift.restclient.model.IDeploymentConfig)5 IService (com.openshift.restclient.model.IService)5 List (java.util.List)5 Collection (java.util.Collection)4 HashMap (java.util.HashMap)4 IConnection (org.jboss.tools.openshift.common.core.connection.IConnection)4 IProject (com.openshift.restclient.model.IProject)3 IRoute (com.openshift.restclient.model.route.IRoute)3 Collections (java.util.Collections)3 Map (java.util.Map)3 CoreException (org.eclipse.core.runtime.CoreException)3 CapabilityVisitor (com.openshift.restclient.capability.CapabilityVisitor)2 ITags (com.openshift.restclient.capability.resources.ITags)2 IBuild (com.openshift.restclient.model.IBuild)2