com.maverick.sshd
Class AccessManagerAdapter

java.lang.Object
  extended by com.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, java.net.SocketAddress localAddress)
          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(java.lang.String 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(java.lang.String 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(java.lang.String 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(java.lang.String sessionid, java.lang.String username, Channel channel)
          Can the user open a channel.
 boolean canStartShell(java.lang.String sessionid, java.lang.String username)
          Perform an access permissions check to determine whether the user can start a shell.
 boolean canStartSubsystem(java.lang.String 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(java.lang.String 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.lang.String username)
Description copied from interface: AccessManager
Perform an access permissions check to determine whether the user can connect to this server.

Specified by:
canConnect in interface AccessManager
Returns:
boolean

canConnect

public boolean canConnect(java.net.SocketAddress remoteClient,
                          java.net.SocketAddress localAddress)
Description copied from interface: AccessManager
Can the remote ip address connect to this server.

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

canOpenChannel

public boolean canOpenChannel(java.lang.String sessionid,
                              java.lang.String username,
                              Channel channel)
Description copied from interface: AccessManager
Can the user open a channel. The channel is not open when this method is called and it has not been allocated a channel id. Use the channel instance to verify the type of channel and add event listeners if you wish.

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

canStartShell

public boolean canStartShell(java.lang.String sessionid,
                             java.lang.String username)
Description copied from interface: AccessManager
Perform an access permissions check to determine whether the user can start a shell.

Specified by:
canStartShell in interface AccessManager
Returns:
boolean

canExecuteCommand

public boolean canExecuteCommand(java.lang.String 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
Returns:
boolean

canStartSubsystem

public boolean canStartSubsystem(java.lang.String 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
Returns:
boolean

canForward

public boolean canForward(java.lang.String 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:
sessionid - the id of the users session
username - the connected user
channel - the channel instance being opened. You can get information such as address/host from this.
isLocal - true if the forwarding is local, otherwise false for remote forwarding.
Returns:
boolean

canListen

public boolean canListen(java.lang.String sessionid,
                         java.lang.String username,
                         java.lang.String bindAddress,
                         int bindPort)
Description copied from interface: AccessManager
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
Returns:
boolean

getRequiredAuthentications

public java.lang.String[] getRequiredAuthentications(java.lang.String 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.