]>
git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/jsch/SshTarget.java
58ac9cbd34cd2f3c7e0fb39a1af6e760871be4a4
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
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.
17 package org
.argeo
.slc
.jsch
;
21 import com
.jcraft
.jsch
.Session
;
22 import com
.jcraft
.jsch
.UserInfo
;
24 public class SshTarget
{
26 private Integer port
= 22;
28 private UserInfo userInfo
= new SimpleUserInfo();
30 private Boolean usePrivateKey
= true;
31 private File localPrivateKey
= new File(System
.getProperty("user.home")
32 + File
.separator
+ ".ssh" + File
.separator
+ "id_rsa");
35 private transient Session session
;
37 public String
getHost() {
41 public void setHost(String host
) {
45 public Integer
getPort() {
49 public void setPort(Integer port
) {
53 public String
getUser() {
57 public void setUser(String user
) {
61 public UserInfo
getUserInfo() {
65 public void setUserInfo(UserInfo userInfo
) {
66 this.userInfo
= userInfo
;
69 public void setLocalPrivateKey(File localPrivateKey
) {
70 this.localPrivateKey
= localPrivateKey
;
73 public File
getLocalPrivateKey() {
74 return localPrivateKey
;
77 public Boolean
getUsePrivateKey() {
81 public void setUsePrivateKey(Boolean usePrivateKey
) {
82 this.usePrivateKey
= usePrivateKey
;
85 public String
toString() {
86 return getUser() + "@" + getHost() + ":" + getPort();
89 public synchronized Session
getSession() {
93 public synchronized void setSession(Session session
) {
94 this.session
= session
;