Secure iNet Factory

com.jscape.inet.ssh.authentication.requests
Class UserDataBasedRequest

java.lang.Object
  extended by com.jscape.util.task.AbstractTask
      extended by com.jscape.inet.ssh.authentication.requests.UserDataBasedRequest
All Implemented Interfaces:
AuthenticationRequest, Task, java.lang.Cloneable, java.lang.Runnable

public class UserDataBasedRequest
extends com.jscape.util.task.AbstractTask
implements AuthenticationRequest

This complex request tries to authenticate the user basing on available user information: if user data contains key pair it tries to perform "publickey" authentication. If that fails it tries to perform "password" method. If that fails this request tries to perform "keyboard-interactive" method with assumption that server asks only for user password.

Version:
1.0
Author:
Alex
See Also:
Source code

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jscape.util.task.AbstractTask
com.jscape.util.task.AbstractTask.Listener, com.jscape.util.task.AbstractTask.TaskCanceledException
 
Constructor Summary
UserDataBasedRequest()
           
UserDataBasedRequest(UserDataBasedRequest that)
           
 
Method Summary
 void cancel()
          Cancels task execution.
 java.lang.Object clone()
          Clones request instance.
 java.lang.String getBanner()
          Returns server authentication banner if any.
 java.lang.Throwable getError()
           
 long getRequestsPause()
           
 java.lang.String getServiceName()
          Returns target SSH service name.
 TransportClient getTransportSession()
          Returns underlayed SSH transport session.
 User getUser()
          Returns user to be authenticated.
 boolean isDone()
          Checks if task is done.
 boolean isSuccessful()
          Checks if request was successful.
 boolean isValid()
          Checks if all needed request parameters are set and request is ready for execution.
 void setRequestsPause(long requestsPause)
           
 void setServiceName(java.lang.String name)
          Sets target SSH service name.
 void setTransportSession(TransportClient client)
          Sets underlayed SSH transport session.
 void setUser(User user)
          Sets target user.
 
Methods inherited from class com.jscape.util.task.AbstractTask
getListener, getName, isCanceled, isStarted, resetCancel, run, setListener, waitUntilDone, waitUntilDone, waitUntilDoneOrCanceled, waitUntilStarted, waitUntilStarted
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jscape.util.task.Task
isStarted
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

UserDataBasedRequest

public UserDataBasedRequest()

UserDataBasedRequest

public UserDataBasedRequest(UserDataBasedRequest that)
Method Detail

getUser

public User getUser()
Description copied from interface: AuthenticationRequest
Returns user to be authenticated.

Specified by:
getUser in interface AuthenticationRequest
Returns:
user to be authenticated

setUser

public void setUser(User user)
Description copied from interface: AuthenticationRequest
Sets target user.

Specified by:
setUser in interface AuthenticationRequest
Parameters:
user - user to be authenticated

getServiceName

public java.lang.String getServiceName()
Description copied from interface: AuthenticationRequest
Returns target SSH service name.

Specified by:
getServiceName in interface AuthenticationRequest
Returns:
target SSH service name

setServiceName

public void setServiceName(java.lang.String name)
Description copied from interface: AuthenticationRequest
Sets target SSH service name.

Specified by:
setServiceName in interface AuthenticationRequest
Parameters:
name - target SSH service name

getTransportSession

public TransportClient getTransportSession()
Description copied from interface: AuthenticationRequest
Returns underlayed SSH transport session.

Specified by:
getTransportSession in interface AuthenticationRequest
Returns:
underlayed SSH transport session

setTransportSession

public void setTransportSession(TransportClient client)
Description copied from interface: AuthenticationRequest
Sets underlayed SSH transport session.

Specified by:
setTransportSession in interface AuthenticationRequest
Parameters:
client - underlayed SSH transport session

isSuccessful

public boolean isSuccessful()
Description copied from interface: AuthenticationRequest
Checks if request was successful.

Specified by:
isSuccessful in interface AuthenticationRequest
Returns:
true if request was successful; false otherwise

isValid

public boolean isValid()
Description copied from interface: AuthenticationRequest
Checks if all needed request parameters are set and request is ready for execution.

Specified by:
isValid in interface AuthenticationRequest
Returns:
true if request is ready for execution; false otherwise

getBanner

public java.lang.String getBanner()
Description copied from interface: AuthenticationRequest
Returns server authentication banner if any.

Specified by:
getBanner in interface AuthenticationRequest
Returns:
server authentication banner

getRequestsPause

public long getRequestsPause()

setRequestsPause

public void setRequestsPause(long requestsPause)

clone

public java.lang.Object clone()
Description copied from interface: AuthenticationRequest
Clones request instance.

Specified by:
clone in interface AuthenticationRequest
Overrides:
clone in class java.lang.Object
Returns:
request copy

isDone

public boolean isDone()
Description copied from interface: Task
Checks if task is done.

Specified by:
isDone in interface Task
Overrides:
isDone in class com.jscape.util.task.AbstractTask
Returns:
true if task is done; false otherwise

cancel

public void cancel()
Description copied from interface: Task
Cancels task execution.

Specified by:
cancel in interface Task
Overrides:
cancel in class com.jscape.util.task.AbstractTask

getError

public java.lang.Throwable getError()
Specified by:
getError in interface AuthenticationRequest

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved