Search in sources :

Example 36 with IResource

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

the class OpenShiftSpringBootPublishController method publishFinish.

@Override
public void publishFinish(IProgressMonitor monitor) throws CoreException {
    if (!hasRsync()) {
        return;
    }
    super.publishFinish(monitor);
    final File localFolder = getLocalFolder();
    final IResource resource = OpenShiftServerUtils.getResource(getServer(), monitor);
    syncUp(localFolder, resource);
    loadPodPathIfEmpty(resource);
}
Also used : File(java.io.File) IResource(com.openshift.restclient.model.IResource)

Example 37 with IResource

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

the class OpenShiftSpringBootPublishController method createRsync.

@Override
protected RSync createRsync(IServer server, final IProgressMonitor monitor) throws CoreException {
    final IResource resource = OpenShiftServerUtils.getResourceChecked(server, monitor);
    IPath podPath = new Path(OpenShiftServerUtils.getOrLoadPodPath(server, resource)).append(POD_BASE_PATH);
    return OpenShiftServerUtils.createRSync(resource, podPath.toString(), server);
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) IResource(com.openshift.restclient.model.IResource)

Example 38 with IResource

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

the class OpenShiftPublishController method publishFinish.

@Override
public void publishFinish(IProgressMonitor monitor) throws CoreException {
    if (!hasRsync()) {
        return;
    }
    super.publishFinish(monitor);
    final File localFolder = getLocalFolder();
    final IResource resource = OpenShiftServerUtils.getResource(getServer(), monitor);
    syncUp(localFolder, resource);
    deleteDoDeployMarkers(localFolder);
    loadPodPathIfEmpty(resource);
}
Also used : File(java.io.File) IResource(com.openshift.restclient.model.IResource)

Example 39 with IResource

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

the class OpenShiftLaunchController method waitForDeploymentConfigReady.

protected boolean waitForDeploymentConfigReady(IServer server, IProgressMonitor monitor) throws CoreException {
    monitor.subTask("Waiting for deployment configs to become available...");
    Connection connection = OpenShiftServerUtils.getConnectionChecked(server);
    IResource resource = OpenShiftServerUtils.getResourceChecked(server, connection, monitor);
    long timeout = System.currentTimeMillis() + WAIT_FOR_DEPLOYMENTCONFIG_TIMEOUT;
    while ((ResourceUtils.getDeploymentConfigFor(resource, connection)) == null) {
        if (!sleep(RECHECK_DELAY, timeout, monitor)) {
            return false;
        }
    }
    return true;
}
Also used : Connection(org.jboss.tools.openshift.core.connection.Connection) IResource(com.openshift.restclient.model.IResource)

Example 40 with IResource

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

the class OpenShiftResourceDocumentProvider method createDocument.

@Override
protected IDocument createDocument(Object element) throws CoreException {
    OpenShiftResourceInput input = getInput(element);
    Document document = null;
    if (input != null) {
        IResource resource = input.getResource();
        document = new Document(resource.toJson());
    }
    return document;
}
Also used : Document(org.eclipse.jface.text.Document) IDocument(org.eclipse.jface.text.IDocument) IResource(com.openshift.restclient.model.IResource)

Aggregations

IResource (com.openshift.restclient.model.IResource)101 Test (org.junit.Test)32 Connection (org.jboss.tools.openshift.core.connection.Connection)27 IProject (com.openshift.restclient.model.IProject)14 IStatus (org.eclipse.core.runtime.IStatus)12 Collection (java.util.Collection)10 ServerResourceViewModel (org.jboss.tools.openshift.internal.ui.server.ServerResourceViewModel)9 IReplicationController (com.openshift.restclient.model.IReplicationController)8 IService (com.openshift.restclient.model.IService)8 ArrayList (java.util.ArrayList)8 CoreException (org.eclipse.core.runtime.CoreException)8 IDeploymentConfig (com.openshift.restclient.model.IDeploymentConfig)7 Status (org.eclipse.core.runtime.Status)7 ISelection (org.eclipse.jface.viewers.ISelection)7 OpenShiftException (com.openshift.restclient.OpenShiftException)6 ResourceKind (com.openshift.restclient.ResourceKind)6 IPod (com.openshift.restclient.model.IPod)6 List (java.util.List)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)6 IBuildConfig (com.openshift.restclient.model.IBuildConfig)5