AXL Software™

com.theorem.tacacs
Class TACACSSession

Object
  extended byTACACSSession

public final class TACACSSession
extends Object

Session class to handle a TACACS+ session.

The session holds all the information for TACACS+ transactions. By setting various fields, like setService() the service type will be sent to the server. In fact all configuration of a TACACS+ transaction are handled by the session information.

Multiple sessions can be handled by the client by using multiple TACACSSession instances on the same TACACSClient.

Sessions are created by the TACACSClient.createSession() method. The callback argument is the class which implements the interface TACACSCallback. When the TACACSClient receives a reply for this session it will invoke the method TACACSCallbackacceptTACACSReply() with the session used to send the packet as well as a reply Packet. The actual type of packet will depend on the packet sent. For example if your code uses the TACACSClient.accounting() method the Packet will actually be a subclassed AccountingPacket with method specfic to the retreival of accounting reply information.

Concurrent modification by the creator of the session and the call back class will cause unpredicatable results.

See Also:
AccountingPacket, AuthorizationPacket, AuthenticationPacket, TACACSCallback, TACACSClient

Method Summary
 void enableEncryption(boolean enable)
          Enable or disable the encryption of the packet body for this session.
 boolean equals(Object o)
          Determine if this Session is the same as another Session.
 int getAuthenicationType()
          Get the authentication type.
 int getAuthenticationMethod()
          Get the authentication method flags.
 int getAuthenticationType()
          Get the authentication type.
 int getAuthenType()
          Get the authentication type.
 byte[] getName()
          Get the user name.
 int getPrivLevel()
          Get the privilege level.
 String getServerMessage()
          Get the server message from a REPLY message.
 int getService()
          Get the service type.
 byte[] getSessionId()
          Get the session identifier.
 String getUserMessage()
          Get the user message from a CONTINUE message.
 void remove()
          Remove this session.
 void setAuthenticationMethod(int authenMethod)
          Set the authentication method flags.
 void setAuthenticationType(int authenType)
          Set the authentication type.
 void setAuthenType(int authenType)
          Set the authentication type.
 void setName(String name)
          Set the User Name.
 void setPort(String port)
          Set the port name.
 void setPrivLevel(int privLevel)
          Set privilege level.
 void setRemoteAddress(String remAddr)
          Set remote address.
 void setRequestAttributes(AttributeList requestList)
          Set the request attributes going to the server.
 void setService(int serviceType)
          Set the service type.
 String toString()
          Return the string representation of the TACACSession.
 
Methods inherited from class Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setName

public void setName(String name)
Set the User Name.

Parameters:
name - Name.

setPort

public void setPort(String port)
Set the port name. The port is not a socket port number. For TACACS this is defined as:
 The ASCII name of the client port on which the authentication is taking
 place. The value of this field is client specific. (For example,
 Cisco uses "tty10" to denote the tenth tty line and "Async10" to
 denote the tenth async interface).

Parameters:
port - Port name.

setPrivLevel

public void setPrivLevel(int privLevel)
Set privilege level. The TACACS documentation decribes this as: <.pre> This indicates the privilege level that the user is authenticating as. Privilege levels are ordered values from 0 to 15 with each level representing a privilege level that is a superset of the next lower value. If a NAS client uses a different privilege level scheme, then mapping must be provided.

Parameters:
privLevel - Privilege level.

setAuthenType

public void setAuthenType(int authenType)
Set the authentication type. This is one of the TAC.TAC_PLUS_AUTHEN_* types.

Parameters:
authenType - Authentication type.

getAuthenType

public int getAuthenType()
Get the authentication type.

Returns:
Authentication type.

setRemoteAddress

public void setRemoteAddress(String remAddr)
Set remote address. The TACACS documentation describes this as:
 An ASCII string that describes the user's remote location. This field
 is optional (since the information may not be available). It is
 intended to hold a network address if the user is connected via a
 network, a caller ID is the user is connected via ISDN or a POTS, or
 any other remote location information that is available. This field
 value is client specified.
 

Parameters:
remAddr - Remote address.

enableEncryption

public void enableEncryption(boolean enable)
Enable or disable the encryption of the packet body for this session. This setting does not affect the server's encryption of the reply packet. Disabling encryption is somtimes useful for debugging.

Parameters:
enable - True to enable encryption, false to disable it. The default is to enable packet encryption.

setAuthenticationType

public void setAuthenticationType(int authenType)
Set the authentication type.

Parameters:
authenType - Authentication type.

getAuthenticationType

public int getAuthenticationType()
Get the authentication type.

Returns:
Authentication type.

setService

public void setService(int serviceType)
Set the service type.

Parameters:
serviceType - Service type.

getService

public int getService()
Get the service type.

Returns:
Service type.

getName

public byte[] getName()
Get the user name.

Returns:
name

getPrivLevel

public int getPrivLevel()
Get the privilege level.

Returns:
privilege level.

setRequestAttributes

public void setRequestAttributes(AttributeList requestList)
Set the request attributes going to the server.

Parameters:
requestList - Attributes to be sent to the server.

getAuthenicationType

public int getAuthenicationType()
Get the authentication type.

Returns:
authentication type.

getSessionId

public byte[] getSessionId()
Get the session identifier.

Returns:
session identifier.

getServerMessage

public String getServerMessage()
Get the server message from a REPLY message.

Returns:
Server message.

getUserMessage

public String getUserMessage()
Get the user message from a CONTINUE message.

Returns:
User message.

setAuthenticationMethod

public void setAuthenticationMethod(int authenMethod)
Set the authentication method flags.

Parameters:
authenMethod - Authentication method flags.

getAuthenticationMethod

public int getAuthenticationMethod()
Get the authentication method flags.

Returns:
Authentication method flags.

remove

public void remove()
Remove this session.


equals

public boolean equals(Object o)
Determine if this Session is the same as another Session.


toString

public String toString()
Return the string representation of the TACACSession.


AXL Software™

Submit a bug report or feature request

Copyright 1998-2002 AXL Software™ PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.