|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.util.internal.ssh.SshjTool
public class SshjTool
Licensed to jclouds, Inc. (jclouds) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. jclouds licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Nested Class Summary | |
---|---|
static class |
SshjTool.Builder
|
static interface |
SshjTool.SshAction
|
Method Summary | |
---|---|
java.lang.Object
|
SshjTool(java.util.Map map)
|
protected java.lang.Object
|
acquire(C connection)
|
protected void
|
allocatePTY(Session s)
|
static SshjTool.Builder
|
builder()
|
void
|
connect()
|
void
|
connect(int maxAttempts)
|
int
|
copyToServer(java.util.Map props, java.io.File f, java.lang.String pathAndFileOnRemoteServer)
|
int
|
createFile(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, java.io.InputStream input, long size)
|
int
|
createFile(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, java.lang.String contents)
Creates the given file with the given contents. |
int
|
createFile(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, byte[] contents)
Creates the given file with the given contents. |
void
|
disconnect()
|
int
|
execCommands(java.util.Map props, java.util.List commands)
|
int
|
execCommands(java.util.Map props, java.util.List commands, java.util.Map env)
|
int
|
execScript(java.util.Map props, java.util.List commands)
|
int
|
execScript(java.util.Map props, java.util.List commands, java.util.Map env)
This creates a script containing the user's commands, copies it to the remote server, and executes the script. |
int
|
execShell(java.util.Map props, java.util.List commands)
|
int
|
execShell(java.util.Map props, java.util.List commands, java.util.Map env)
|
int
|
execShellDirect(java.util.Map props, java.util.List commands, java.util.Map env)
|
java.lang.String
|
getHostAddress()
|
java.lang.String
|
getUsername()
|
boolean
|
isConnected()
|
protected SshjTool.SshAction
|
newSessionAction()
|
java.lang.String
|
toString()
|
int
|
transferFileFrom(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, java.lang.String pathAndFileOnLocalServer)
|
int
|
transferFileTo(java.util.Map props, java.io.InputStream input, java.lang.String pathAndFileOnRemoteServer)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Method Detail |
---|
public java.lang.Object SshjTool(java.util.Map map)
protected java.lang.Object acquire(C connection)
protected void allocatePTY(Session s)
public static SshjTool.Builder builder()
@Override public void connect()
@Override public void connect(int maxAttempts)
@Override public int copyToServer(java.util.Map props, java.io.File f, java.lang.String pathAndFileOnRemoteServer)
@Override public int createFile(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, java.io.InputStream input, long size)
@Override public int createFile(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, java.lang.String contents)
@Override public int createFile(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, byte[] contents)
@Override public void disconnect()
@Override public int execCommands(java.util.Map props, java.util.List commands)
@Override public int execCommands(java.util.Map props, java.util.List commands, java.util.Map env)
@Override public int execScript(java.util.Map props, java.util.List commands)
@Override public int execScript(java.util.Map props, java.util.List commands, java.util.Map env)
Executing commands directly is fraught with dangers! Here are other options, and their problems:
public int execShell(java.util.Map props, java.util.List commands)
public int execShell(java.util.Map props, java.util.List commands, java.util.Map env)
public int execShellDirect(java.util.Map props, java.util.List commands, java.util.Map env)
public java.lang.String getHostAddress()
public java.lang.String getUsername()
@Override public boolean isConnected()
protected SshjTool.SshAction newSessionAction()
@Override public java.lang.String toString()
@Override public int transferFileFrom(java.util.Map props, java.lang.String pathAndFileOnRemoteServer, java.lang.String pathAndFileOnLocalServer)
@Override public int transferFileTo(java.util.Map props, java.io.InputStream input, java.lang.String pathAndFileOnRemoteServer)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.