com.maverick.sshd
Class AccessManagerAdapter

java.lang.Object
  extended bycom.maverick.sshd.AccessManagerAdapter
All Implemented Interfaces:
AccessManager

public class AccessManagerAdapter
extends java.lang.Object
implements AccessManager

An adapter for AccessManager

Author:
Lee David Painter

Constructor Summary
AccessManagerAdapter()
           
 
Method Summary
 boolean canConnect(java.net.SocketAddress remoteClient)
          Can the remote ip address connect to this server.
 boolean canConnect(java.lang.String username)
          Perform an access permissions check to determine whether the user can connect to this server.
 boolean canExecuteCommand(byte[] sessionid, java.lang.String username, java.lang.String cmd)
          Perform an access permissions check to determine whether the user can execute the specified command
 boolean canForward(byte[] sessionid, java.lang.String username, ForwardingChannel channel, boolean isLocal)
          Perform an access permissions check to determine whether the user can open a forwarding channel to/on the specified host:port combination
 boolean canListen(byte[] sessionid, java.lang.String username, java.lang.String bindAddress, int bindPort)
          Perform an access permission check to determine whether the user can open up a listening port on the server to forward remote connections to the remote client.
 boolean canOpenChannel(byte[] sessionid, java.lang.String username, Channel channel)
          Can the user open a channel.
 boolean canStartShell(byte[] sessionid, java.lang.String username)
          Perform an access permissions check to determine whether the user can start a shell.
 boolean canStartSubsystem(byte[] sessionid, java.lang.String username, java.lang.String subsystem)
          Perform an access permissions check to determine whether the user can start the specified subsystem
 java.lang.String[] getRequiredAuthentications(byte[] sessionid, java.lang.String username)
          Called by the AuthenticationProtocol to retrieve a list of required authentications for each user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessManagerAdapter

public AccessManagerAdapter()
Method Detail

canConnect

public boolean canConnect(java.net.SocketAddress remoteClient)
Can the remote ip address connect to this server.

Specified by:
canConnect in interface AccessManager
Parameters:
remoteClient - SocketAddress
Returns:
boolean

canConnect

public boolean canConnect(java.lang.String username)
Perform an access permissions check to determine whether the user can connect to this server.

Specified by:
canConnect in interface AccessManager
Parameters:
username - String
Returns:
boolean

canExecuteCommand

public boolean canExecuteCommand(byte[] sessionid,
                                 java.lang.String username,
                                 java.lang.String cmd)
Description copied from interface: AccessManager
Perform an access permissions check to determine whether the user can execute the specified command

Specified by:
canExecuteCommand in interface AccessManager
Parameters:
sessionid - byte[]
username - String
cmd - String
Returns:
boolean

canForward

public boolean canForward(byte[] sessionid,
                          java.lang.String username,
                          ForwardingChannel channel,
                          boolean isLocal)
Description copied from interface: AccessManager
Perform an access permissions check to determine whether the user can open a forwarding channel to/on the specified host:port combination

Specified by:
canForward in interface AccessManager
Parameters:
channel - the channel instance being opened.
sessionid - the id of the user's session
username - the connected user
isLocal - true if the forwarding is local, otherwise false for remote forwarding.
Returns:
boolean

canListen

public boolean canListen(byte[] sessionid,
                         java.lang.String username,
                         java.lang.String bindAddress,
                         int bindPort)
Perform an access permission check to determine whether the user can open up a listening port on the server to forward remote connections to the remote client.

Specified by:
canListen in interface AccessManager
Parameters:
sessionid - byte[]
username - String
bindAddress - String
bindPort - int
Returns:
boolean

canOpenChannel

public boolean canOpenChannel(byte[] sessionid,
                              java.lang.String username,
                              Channel channel)
Can the user open a channel.

Specified by:
canOpenChannel in interface AccessManager
Parameters:
sessionid - byte[]
username - String
channel - Channel
Returns:
boolean

canStartShell

public boolean canStartShell(byte[] sessionid,
                             java.lang.String username)
Perform an access permissions check to determine whether the user can start a shell.

Specified by:
canStartShell in interface AccessManager
Parameters:
sessionid - byte[]
username - String
Returns:
boolean

canStartSubsystem

public boolean canStartSubsystem(byte[] sessionid,
                                 java.lang.String username,
                                 java.lang.String subsystem)
Description copied from interface: AccessManager
Perform an access permissions check to determine whether the user can start the specified subsystem

Specified by:
canStartSubsystem in interface AccessManager
Parameters:
sessionid - byte[]
username - String
subsystem - String
Returns:
boolean

getRequiredAuthentications

public java.lang.String[] getRequiredAuthentications(byte[] sessionid,
                                                     java.lang.String username)
Description copied from interface: AccessManager
Called by the AuthenticationProtocol to retrieve a list of required authentications for each user. If you do not want to override the settings in the ConfigurationContext then return null, otherwise return a list of the user's required authentications.

Specified by:
getRequiredAuthentications in interface AccessManager
Parameters:
sessionid - byte[]
username - String
Returns:
String[]


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.