public class ApplicationSSHSession extends Object implements IApplicationSSHSession
Modifier and Type | Class and Description |
---|---|
protected class |
ApplicationSSHSession.AbstractSnapshotSshCommand |
class |
ApplicationSSHSession.AbstractSnapshotType |
protected static class |
ApplicationSSHSession.SshCommandResponse |
Constructor and Description |
---|
ApplicationSSHSession(IApplication application,
com.jcraft.jsch.Session session)
Sets the SSH session that this application will use to connect to
OpenShift to perform some operations.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertLiveSSHSession() |
boolean |
equals(Object object) |
protected InputStream |
execCommand(String command,
com.openshift.internal.client.ApplicationSSHSession.ChannelInputStreams factory,
com.jcraft.jsch.Session session) |
protected InputStream |
execCommand(String command,
InputStream forStdIn,
com.openshift.internal.client.ApplicationSSHSession.ChannelInputStreams channelInputStream,
com.jcraft.jsch.Session session) |
IApplication |
getApplication()
Get the application associated with this ApplicationSSHSession
|
List<String> |
getEnvironmentProperties()
Get a list of properties from your OpenShift Application
|
List<IApplicationPortForwarding> |
getForwardablePorts()
Gets a list of forwardable ports for your application
|
boolean |
isConnected()
Check if the current SSH session is connected
|
boolean |
isPortFowardingStarted()
Check if port forwarding has been started
|
void |
refresh()
Refreshes the list of forwardable ports
|
List<IApplicationPortForwarding> |
refreshForwardablePorts()
Refresh the list of forwardable ports for an application
|
InputStream |
restoreDeploymentSnapshot(InputStream inputStream,
boolean hotDeploy)
Restores the given snapshot to the application that this session is bound
to.
|
InputStream |
restoreFullSnapshot(InputStream inputStream) |
InputStream |
restoreFullSnapshot(InputStream inputStream,
boolean includeGit)
Restores the given full snapshot to the application that this session is
bound to.
|
InputStream |
saveDeploymentSnapshot() |
InputStream |
saveFullSnapshot() |
void |
setSSHSession(com.jcraft.jsch.Session session)
Set the current SSH session
|
List<IApplicationPortForwarding> |
startPortForwarding()
Start forwarding available ports to this application
|
List<IApplicationPortForwarding> |
stopPortForwarding()
Stop forwarding of all ports to this application
|
String |
toString() |
public ApplicationSSHSession(IApplication application, com.jcraft.jsch.Session session)
application
- The application that this SSH session is connecting tosession
- The SSH session that is connected to the applicationpublic void setSSHSession(com.jcraft.jsch.Session session)
setSSHSession
in interface IApplicationSSHSession
session
- A new SSH session to use for the ApplicationSSHSession objectpublic IApplication getApplication()
public boolean isConnected()
isConnected
in interface IApplicationSSHSession
public boolean isPortFowardingStarted() throws OpenShiftSSHOperationException
isPortFowardingStarted
in interface IApplicationSSHSession
OpenShiftSSHOperationException
public List<IApplicationPortForwarding> startPortForwarding() throws OpenShiftSSHOperationException
startPortForwarding
in interface IApplicationSSHSession
OpenShiftSSHOperationException
public List<IApplicationPortForwarding> stopPortForwarding() throws OpenShiftSSHOperationException
stopPortForwarding
in interface IApplicationSSHSession
OpenShiftSSHOperationException
public List<IApplicationPortForwarding> refreshForwardablePorts() throws OpenShiftSSHOperationException
refreshForwardablePorts
in interface IApplicationSSHSession
OpenShiftSSHOperationException
public List<IApplicationPortForwarding> getForwardablePorts() throws OpenShiftSSHOperationException
getForwardablePorts
in interface IApplicationSSHSession
OpenShiftSSHOperationException
public List<String> getEnvironmentProperties() throws OpenShiftSSHOperationException
getEnvironmentProperties
in interface IApplicationSSHSession
OpenShiftSSHOperationException
public InputStream saveFullSnapshot()
public InputStream restoreFullSnapshot(InputStream inputStream)
public InputStream restoreFullSnapshot(InputStream inputStream, boolean includeGit)
true
for includeGit will also activate
the snapshot (and having the page reflecting the changes in the
snapshot). It only works though if the snapshot has a /git/ folder with
content.inputStream
- the snapshotincludeGit
- will activate the new snapshot given the snapshot includes a
/git folderTarFileUtils.hasGitFolder(InputStream)
,
saveFullSnapshot()
public InputStream saveDeploymentSnapshot()
public InputStream restoreDeploymentSnapshot(InputStream inputStream, boolean hotDeploy) throws OpenShiftException
inputStream
- the snapshothotDeploy
- will not restart the application if true
OpenShiftException
saveDeploymentSnapshot()
public void refresh() throws OpenShiftException
OpenShiftException
protected void assertLiveSSHSession()
protected InputStream execCommand(String command, com.openshift.internal.client.ApplicationSSHSession.ChannelInputStreams factory, com.jcraft.jsch.Session session) throws OpenShiftSSHOperationException
OpenShiftSSHOperationException
protected InputStream execCommand(String command, InputStream forStdIn, com.openshift.internal.client.ApplicationSSHSession.ChannelInputStreams channelInputStream, com.jcraft.jsch.Session session) throws OpenShiftSSHOperationException
command
- The remote command to run on the serversshMsgChannelData
- sshStream
- The ssh stream to useOpenShiftSSHOperationException
Copyright © 2014 JBoss by Red Hat. All rights reserved.