]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/jsch/SshTarget.java
2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.jsch
;
20 import com
.jcraft
.jsch
.Session
;
21 import com
.jcraft
.jsch
.UserInfo
;
23 public class SshTarget
{
25 private Integer port
= 22;
27 private UserInfo userInfo
= new SimpleUserInfo();
29 private Boolean usePrivateKey
= true;
30 private File localPrivateKey
= new File(System
.getProperty("user.home")
31 + File
.separator
+ ".ssh" + File
.separator
+ "id_rsa");
34 private transient Session session
;
36 public String
getHost() {
40 public void setHost(String host
) {
44 public Integer
getPort() {
48 public void setPort(Integer port
) {
52 public String
getUser() {
56 public void setUser(String user
) {
60 public UserInfo
getUserInfo() {
64 public void setUserInfo(UserInfo userInfo
) {
65 this.userInfo
= userInfo
;
68 public void setLocalPrivateKey(File localPrivateKey
) {
69 this.localPrivateKey
= localPrivateKey
;
72 public File
getLocalPrivateKey() {
73 return localPrivateKey
;
76 public Boolean
getUsePrivateKey() {
80 public void setUsePrivateKey(Boolean usePrivateKey
) {
81 this.usePrivateKey
= usePrivateKey
;
84 public String
toString() {
85 return getUser() + "@" + getHost() + ":" + getPort();
88 public synchronized Session
getSession() {
92 public synchronized void setSession(Session session
) {
93 this.session
= session
;