Core API 7.1

net.juniper.smgt.sae.scriptservice
Interface ServiceSessionInfo


public interface ServiceSessionInfo

Provide information of a service session to a script service.


Method Summary
 String getAccountingId()
          Get the user accounting ID.
 CommandChannel getCommandChannel()
          Returns the CommandChannel this service session attached to.
 LogWriter getDebugLog()
          Returns a LogWriter object that can be used to print messages to the DEBUG log.
 byte[] getDhcpPacket()
          Get DHCP options returned for DHCP users.
 int getDownStreamBandwidth()
          Get the service down stream bandwidth.
 LogWriter getErrorLog()
          Returns a LogWriter object that can be used to print messages to the ERROR log.
 String getHostName()
          Get the host name.
 String getIfRadiusClass()
          Get the RadiusClass.
 LogWriter getInfoLog()
          Returns a LogWriter object that can be used to print messages to the INFO log.
 String getInterfaceAlias()
          Get the interface alias, i.e. alternative description of managed interface.
 String getInterfaceDescr()
          Get the interface description, i.e. a textual description of the managed interface.
 String getInterfaceName()
          Get the interface name.
 long getInterfaceSpeed()
          Get the interface speed
 String getLoginName()
          Get the user's login name.
 InetAddress getNasInetAddress()
          Get the IP address the virtual router uses for accounting purposes.
 int getNasPort()
          Get NAS-Port, i.e. a numerical index that identifies the layer 2 interface.
 String getPortId()
          Get NAS-Port-ID, i.e. a name of the interface including layer 2 access information.
 String getPrimaryUserName()
          Get the primary user name.
 InetAddress getRouterDynRadiusAddr()
           
 String getRouterName()
          Get the router name.
 Object getServiceAttribute(String attributeName)
          Get the value for the named attribute of the service.
 String[] getServiceAttributeNames()
          Get the names of the attributes of the service.
 String getServiceBundle()
          Get ServiceBundle string associated with authenticated lifecyle handle.
 DirContext getServiceDirectory()
          Returns a javax.naming.DirContext object that can be used to access the directory that stores SAE's service definitions, as specified by the following SAE configuration parameters: Service repository address (i.e.
 String getServiceName()
          Get the service name.
 String getServiceSessionName()
          Get the session name.
 String getServiceSessionTag()
          Get the service session tag.
 String getSessionId()
          Get the session id.
 String getSessionVolumeQuota()
          Get the session volume quota.
 long getStartTime()
          Get the start time.
 String getSubscriptionName()
          Get the subscription name.
 String[] getSubstitutions()
          Get the substitutions.
 int getTerminateCause()
          Gets the reason the service session was stopped
 int getUpStreamBandwidth()
          Get the service up stream bandwidth.
 DirContext getUserDirectory()
          Returns a javax.naming.DirContext object that can be used to access the directory that stores SAE's user profiles, as specified by the following SAE configuration parameters: User repository address (i.e.
 String getUserDn()
          Get the LDAP distinguished name of the loaded user profile assigned to the user.
 InetAddress getUserInetAddress()
          Get the InetAddress associated with PPP or DHCP user.
 String getUserMacAddress()
          Get MAC address of DHCP user.
 String[] getUserRadiusClass()
          Get radius class.
 String getUserSessionId()
          Get the user session ID.
 String getUserType()
          Get the user type.
 boolean isBeingRemoved()
          Returns true if this service session is being removed if true - the script service must be cleaned up there will be no furthur attempts to collect accounting
 boolean isLoggingIn()
          Returns true if this user session is in the process of activating the automatically on login services
 boolean isLoggingOut()
          Returns true if this user session is in the process of or has previously been logged out
 RadiusResponse sendDynamicRadius(InetSocketAddress dynRadiusServer, byte code, int action, Map attrs, String config, InetSocketAddress dynRadiusClient, String shareSecret, int retry)
          Send dynamic authorization request to radius client
 void stopService(int terminateReason)
          Deactivate the service session.
 

Method Detail

getHostName

public String getHostName()
Get the host name.

Returns:
The host name.

getServiceName

public String getServiceName()
Get the service name.

Returns:
The service name.

getServiceSessionName

public String getServiceSessionName()
Get the session name.

Returns:
The session name.

getServiceSessionTag

public String getServiceSessionTag()
Get the service session tag. The tag is an arbitrary string and can be used for accounting purposes.

Returns:
The session tag or "" if session tag is not initialized.

getSubscriptionName

public String getSubscriptionName()
Get the subscription name.

Returns:
The subscription name.

getStartTime

public long getStartTime()
Get the start time.

Returns:
The time the service session was started.

getSessionId

public String getSessionId()
Get the session id.

Returns:
The session id.

getSubstitutions

public String[] getSubstitutions()
Get the substitutions. See the SSC Administration and Operations Guide for details about how substitutions affect service policies via paramater value aquisitions, and for detailed information about the format of the Strings that contain the substitutions.

Returns:
The substitutions used for the service session.

getUpStreamBandwidth

public int getUpStreamBandwidth()
Get the service up stream bandwidth.

Returns:
The service up stream bandwidth for the service session or -1 if up stream bandwidth is not initialized.

getDownStreamBandwidth

public int getDownStreamBandwidth()
Get the service down stream bandwidth.

Returns:
The service down stream bandwidth for the service session or -1 if down stream bandwidth is not initialized.

getSessionVolumeQuota

public String getSessionVolumeQuota()
Get the session volume quota. The session volume quota is a string which contains two decimal encoded numbers, separated by ";". The first number is the number of octets allowed to be sent from the network to the user, the second number is the number of octets allowed to be sent from the user to the network.

Returns:
the session volume quota for the service session.

getTerminateCause

public int getTerminateCause()
Gets the reason the service session was stopped

Returns:
the terminate cause of the service session

getServiceAttributeNames

public String[] getServiceAttributeNames()
Get the names of the attributes of the service.

Returns:
The names of the service attributes.

getServiceAttribute

public Object getServiceAttribute(String attributeName)
Get the value for the named attribute of the service. If the attribute is a single value, the returned Object must be cast to the appropriate type. If the attribute is multi-valued, the returned Object must be cast to an array of the appropriate type.

Parameters:
attributeName -
Returns:
The value of the named attribute or null if the service does not contain the named attribute.

getRouterName

public String getRouterName()
Get the router name.

Returns:
The router name.

getInterfaceName

public String getInterfaceName()
Get the interface name.

Returns:
The interface name.

getInterfaceAlias

public String getInterfaceAlias()
Get the interface alias, i.e. alternative description of managed interface.

Returns:
The interface alias or "" if it is not available.

getInterfaceDescr

public String getInterfaceDescr()
Get the interface description, i.e. a textual description of the managed interface.

Returns:
The interface description or "" if it is not available.

getInterfaceSpeed

public long getInterfaceSpeed()
Get the interface speed

Returns:
The interface speed

getPortId

public String getPortId()
Get NAS-Port-ID, i.e. a name of the interface including layer 2 access information. The NAS-Port-ID field is used in RADIUS messages concerning the interface.

Returns:
The NAS-Port-ID or null if it is not available.

getNasPort

public int getNasPort()
Get NAS-Port, i.e. a numerical index that identifies the layer 2 interface.

Returns:
NAS-Port or zero if it is not available.

getIfRadiusClass

public String getIfRadiusClass()
Get the RadiusClass. The RadiusClass is only available for PPP and authenticated DHCP addresses.

Returns:
The RadiusClass or null if it is not available.

getNasInetAddress

public InetAddress getNasInetAddress()
Get the IP address the virtual router uses for accounting purposes.

Returns:
The IP addess or null if it is not available.

getLoginName

public String getLoginName()
Get the user's login name.

Returns:
The user's login name or null if it is not available.

getPrimaryUserName

public String getPrimaryUserName()
Get the primary user name. The primary user name is the name that was used to authenticate the transport interface of the user. For example if the user session is an authenticated PPP session, the primary user name is the PPP login name of the user.

Returns:
The primary user name or an empty string, if the primary login was unauthenticated.

getServiceBundle

public String getServiceBundle()
Get ServiceBundle string associated with authenticated lifecyle handle. The service bundle is only available for PPP and authenticated DHCP addresses.

Returns:
The service bundle

getUserInetAddress

public InetAddress getUserInetAddress()
Get the InetAddress associated with PPP or DHCP user.

Returns:
The user InetAddress or null if it is not known.

getUserType

public String getUserType()
Get the user type.

Returns:
The user type.

getUserMacAddress

public String getUserMacAddress()
Get MAC address of DHCP user.

Returns:
The user MAC address.

getDhcpPacket

public byte[] getDhcpPacket()
Get DHCP options returned for DHCP users.

Returns:
The DHCP options.

getAccountingId

public String getAccountingId()
Get the user accounting ID.

Returns:
The accounting ID or null if it is not known.

getUserDn

public String getUserDn()
Get the LDAP distinguished name of the loaded user profile assigned to the user.

Returns:
The user DN.

getUserRadiusClass

public String[] getUserRadiusClass()
Get radius class.

Returns:
The user radius class.

getUserSessionId

public String getUserSessionId()
Get the user session ID.

Returns:
The user session ID.

isLoggingOut

public boolean isLoggingOut()
Returns true if this user session is in the process of or has previously been logged out


isLoggingIn

public boolean isLoggingIn()
Returns true if this user session is in the process of activating the automatically on login services


isBeingRemoved

public boolean isBeingRemoved()
Returns true if this service session is being removed if true - the script service must be cleaned up there will be no furthur attempts to collect accounting


getServiceDirectory

public DirContext getServiceDirectory()
Returns a javax.naming.DirContext object that can be used to access the directory that stores SAE's service definitions, as specified by the following SAE configuration parameters: The returned DirContext object must not be modified. Modifying the returned DirContext object may affect the stability of the SAE server.

Returns:
The access to the service directory.

getUserDirectory

public DirContext getUserDirectory()
Returns a javax.naming.DirContext object that can be used to access the directory that stores SAE's user profiles, as specified by the following SAE configuration parameters: The returned DirContext object must not be modified. Modifying the returned DirContext object may affect the stability of the SAE server.

Returns:
The access to the user directory.

getDebugLog

public LogWriter getDebugLog()
Returns a LogWriter object that can be used to print messages to the DEBUG log.

Returns:
The access to the DEBUG log.

getInfoLog

public LogWriter getInfoLog()
Returns a LogWriter object that can be used to print messages to the INFO log.

Returns:
The access to the INFO log.

getErrorLog

public LogWriter getErrorLog()
Returns a LogWriter object that can be used to print messages to the ERROR log.

Returns:
The access to the ERROR log.

stopService

public void stopService(int terminateReason)
                 throws ScriptServiceException
Deactivate the service session.

Parameters:
terminateReason - for the Radius attribute Acct-Terminate-Cause.
Throws:
ScriptServiceException

getCommandChannel

public CommandChannel getCommandChannel()
Returns the CommandChannel this service session attached to.

Returns:
the router CommandChannel

sendDynamicRadius

public RadiusResponse sendDynamicRadius(InetSocketAddress dynRadiusServer,
                                        byte code,
                                        int action,
                                        Map attrs,
                                        String config,
                                        InetSocketAddress dynRadiusClient,
                                        String shareSecret,
                                        int retry)
                                 throws ScriptServiceException
Send dynamic authorization request to radius client

Parameters:
dynRadiusServer - Dynamic radius source IP and port If not provided, SAE uses configuration attributes AccountingMgr.local.address and AccountingMgr.local.port instead
code - the radius packet code field. e.g. 40 - Disconnect-Request 43 - CoA-Request
action - customized action used by SAE generating dynamic radius packet see customer documentation for details
attrs - customer specific radius attributes appending to radius packet key: radius attribute name e.g. value: value
config - flexible radius plug-in like configuration for configuring the radius packet content, the format is: action.radiusAttributeName = pluginEventAttribute see SDX customer documentation for available plug-in event attribute e.g. 1.User-Name = accountingId\n1.vendor-specific.WISPr.Location-ID = interfaceAlias see customer documentation for details
dynRadiusClient - Dynamic radius client IP and port
shareSecret - dynamic radius share secret,
retry - number of retry for sending dynamic radius packet by underlying library in case of no radius response being received the retry interval is 3 seconds.
Returns:
RadiusResponse contains the attribute responded by dynamic radius client
Throws:
ScriptServiceException - when no response is received or there is connection error with radius client.

getRouterDynRadiusAddr

public InetAddress getRouterDynRadiusAddr()
Returns:
IP address of router management end point e.g. JunosE router cops connection end point address

Core API 7.1