Exemplo n.º 1
0
    @Override
    protected void uploadKey(final File sskKey) {
      new CloudConnectionTask(myProject, "Uploading SSH key", myConnectionTask.getServer()) {

        @Override
        protected Object run(CloudServerRuntimeInstance serverRuntime)
            throws ServerRuntimeException {
          ((SshKeyAwareServerRuntime) serverRuntime).addSshKey(sskKey);
          myErrorNotification.expire();
          myNotifier.showMessage(
              "SSH key was uploaded, you may <a href=\"#\">reconnect</a>",
              MessageType.INFO,
              new NotificationListener() {

                @Override
                public void hyperlinkUpdate(
                    @NotNull Notification notification, @NotNull HyperlinkEvent event) {
                  notification.expire();
                  reconnect();
                }
              });
          return null;
        }

        @Override
        protected void runtimeErrorOccurred(@NotNull String errorMessage) {
          myNotifier.showMessage(errorMessage, MessageType.ERROR);
        }
      }.performSync();
    }
Exemplo n.º 2
0
    private void redeploy() {
      final ServerConnection connection =
          ServerConnectionManager.getInstance().getOrCreateConnection(myServerRuntime.getServer());

      final RemoteServersView view = RemoteServersView.getInstance(myDeploymentTask.getProject());
      view.showServerConnection(connection);

      connection.deploy(
          myDeploymentTask,
          new ParameterizedRunnable<String>() {

            @Override
            public void run(String s) {
              view.showDeployment(connection, s);
            }
          });
    }