Permalink
Browse files

Console message changes.

  • Loading branch information...
1 parent c3330c1 commit 17e6cef9a777d6bfcfaaff13013963df5adc0ba5 nierajsingh committed Feb 21, 2014
@@ -60,4 +60,28 @@
*/
public static final String TITLE_SELF_SIGNED_PROMPT_USER = "Failed to connect";
+
+ /*
+ * Console messages
+ */
+ public static final String CONSOLE_RESTARTING_APP = "Restarting application";
+
+ public static final String CONSOLE_DEPLOYING_APP = "Deploying application";
+
+ public static final String CONSOLE_GENERATING_ARCHIVE = "Generating application archive";
+
+ public static final String CONSOLE_PROCESSING_PAYLOAD = "Processing payload...";
+
+ public static final String CONSOLE_APP_STOPPED = "Application stopped.";
+
+ public static final String CONSOLE_PRE_STAGING_MESSAGE = "Staging application";
+
+ public static final String CONSOLE_APP_PUSH_MESSAGE = "Pushing application to Cloud Foundry server";
+
+ public static final String CONSOLE_STILL_WAITING_FOR_APPLICAITON_TO_START = "Still waiting for applicaiton to start...";
+
+ public static final String CONSOLE_WAITING_FOR_APPLICATION_TO_START = "Waiting for application to start...";
+
+ public static final String CONSOLE_STOPPING_APPLICATION = "Stopping application";
+
}
@@ -119,10 +119,7 @@
private static final String ERROR_NO_CLOUD_APPLICATION_FOUND = "No cloud module specified when attempting to update application instance stats.";
- private static final String PRE_STAGING_MESSAGE = "Staging application";
-
- private static final String APP_PUSH_MESSAGE = "Pushing application to Cloud Foundry server";
-
+
private CloudFoundryOperations client;
private RefreshHandler refreshHandler;
@@ -1917,7 +1914,7 @@ public boolean onProgress(String status) {
}
else {
- printlnToConsole(appModule, "\nProcessing payload...", false, false, monitor);
+ printlnToConsole(appModule, '\n' + Messages.CONSOLE_PROCESSING_PAYLOAD, false, false, monitor);
client.uploadApplication(appName, applicationArchive, new UploadStatusCallback() {
public void onProcessMatchedResources(int length) {
@@ -2020,7 +2017,7 @@ public StartOrDeployOperation(boolean waitForDeployment, boolean incrementalPubl
@Override
protected String getOperationName() {
- return "Starting application";
+ return Messages.CONSOLE_DEPLOYING_APP;
}
protected CloudFoundryApplicationModule prepareForDeployment(IProgressMonitor monitor) throws CoreException {
@@ -2062,7 +2059,7 @@ protected void performDeployment(CloudFoundryApplicationModule appModule, IProgr
if (!modules[0].isExternal()) {
- printlnToConsole(appModule, "Generating application archive", false, true, monitor);
+ printlnToConsole(appModule, Messages.CONSOLE_GENERATING_ARCHIVE , false, true, monitor);
final ApplicationArchive applicationArchive = generateApplicationArchiveFile(
appModule.getDeploymentInfo(), appModule, modules, server, monitor);
@@ -2099,7 +2096,7 @@ protected void performDeployment(CloudFoundryApplicationModule appModule, IProgr
final CloudFoundryApplicationModule appModuleFin = appModule;
// Now push the application resources to the server
- printlnToConsole(appModule, APP_PUSH_MESSAGE, false, true, monitor);
+ printlnToConsole(appModule, Messages.CONSOLE_APP_PUSH_MESSAGE, false, true, monitor);
new BehaviourRequest<Void>(NLS.bind("Pushing the application {0} ", deploymentName)) {
@Override
@@ -2324,7 +2321,7 @@ protected void performDeployment(CloudFoundryApplicationModule appModule, IProgr
// logs or refreshing app instance stats after an app has
// started).
- printlnToConsole(cloudModule, PRE_STAGING_MESSAGE, false, true, monitor);
+ printlnToConsole(cloudModule, Messages.CONSOLE_PRE_STAGING_MESSAGE, false, true, monitor);
new BehaviourRequest<Void>(NLS.bind("Starting application {0}", deploymentName)) {
@Override
@@ -2407,7 +2404,7 @@ protected Void doRun(final CloudFoundryOperations client, SubMonitor progress)
@Override
protected String getOperationName() {
- return "Restarting application";
+ return Messages.CONSOLE_RESTARTING_APP;
}
}
@@ -2453,7 +2450,7 @@ protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws
server.setModuleState(modules, IServer.STATE_STOPPED);
succeeded = true;
- printlnToConsole(appModule, "Application stopped.", true, false, monitor);
+ printlnToConsole(appModule, Messages.CONSOLE_APP_STOPPED, true, false, monitor);
CloudFoundryPlugin.getCallback().stopApplicationConsole(cloudModule, cloudServer);
// If succeeded, stop all Caldecott tunnels if the app is
@@ -2474,7 +2471,7 @@ protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws
@Override
protected String getOperationName() {
- return "Stopping application";
+ return Messages.CONSOLE_STOPPING_APPLICATION;
}
}
@@ -14,6 +14,7 @@
import java.util.List;
import org.cloudfoundry.ide.eclipse.internal.server.core.CloudFoundryServer;
+import org.cloudfoundry.ide.eclipse.internal.server.core.Messages;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.SWT;
@@ -73,7 +74,7 @@ protected String reachedMaximumErrors(CoreException ce) {
// Schedule next logs after too many failed attempts to fetch staging
// logs
scheduleNextContent = true;
- return "Failed to fetch staging contents from: " + getFilePath();
+ return null;
}
protected int getMaximumErrorCount() {
@@ -102,7 +103,7 @@ protected String getMessageOnRetry(CoreException ce, int currentAttemptsRemainin
// stream, therefore
// the first RETRY attempt will always be maximum error count - 1.
if (currentAttemptsRemaining == getMaximumErrorCount() - 1) {
- return "Waiting for application to start...";
+ return Messages.CONSOLE_WAITING_FOR_APPLICATION_TO_START + '\n';
}
else if (currentAttemptsRemaining > 0) {
// Append progress dot
@@ -114,7 +115,7 @@ else if (currentAttemptsRemaining > 0) {
}
}
else if (currentAttemptsRemaining == 0) {
- return "Still waiting for applicaiton to start...";
+ return '\n' + Messages.CONSOLE_STILL_WAITING_FOR_APPLICAITON_TO_START;
}
}
return null;

0 comments on commit 17e6cef

Please sign in to comment.