Core API 7.8

net.juniper.smgt.sae.scriptservice
Interface ServiceSessionInfo


public interface ServiceSessionInfo

Provide information of a service session to a script service.


Method Summary
 java.lang.String getAccountingId()
          Get the user accounting ID.
 java.lang.String getCallingStationId()
          Get Calling-Station-Id associated with the primary interface
 CommandChannel getCommandChannel()
          Returns the CommandChannel this service session attached to.
 LogWriter getCriticalLog()
          Returns a LogWriter object that can be used to print messages to the CRITICAL log.
 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.
 java.lang.String getHostName()
          Get the host name.
 java.lang.String getIfRadiusClass()
          Deprecated. use getIfRadiusClassList() instead.
 java.util.List getIfRadiusClassList()
          Get all values of interface-radius class.
 LogWriter getInfoLog()
          Returns a LogWriter object that can be used to print messages to the INFO log.
 java.lang.String getInterfaceAlias()
          Get the interface alias, i.e. alternative description of managed interface.
 java.lang.String getInterfaceDescr()
          Get the interface description, i.e. a textual description of the managed interface.
 java.lang.String getInterfaceName()
          Get the interface name.
 long getInterfaceSpeed()
          Get the interface speed
 java.util.Map getLocalQosProfiles()
           
 java.net.InetAddress getLocalTunnelInetAddress()
          InetAddress of the local end of an L2TP tunnel.
 java.lang.String getLoginName()
          Get the user's login name.
 java.net.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.
 LogWriter getNoticeLog()
          Returns a LogWriter object that can be used to print messages to the NOTICE log.
 java.util.Map getParameterSubstitutions(java.util.List names)
          Get the requested parameter substitutions from the acquisition path.
 java.lang.String getPortId()
          Get NAS-Port-ID, i.e. a name of the interface including layer 2 access information.
 java.lang.String getPrimaryUserName()
          Get the primary user name.
 java.net.InetAddress getRemoteTunnelInetAddress()
          InetAddress of the far end of an L2TP tunnel.
 java.net.InetAddress getRouterDynRadiusAddr()
           
 java.lang.String getRouterName()
          Get the router name.
 java.lang.Object getServiceAttribute(java.lang.String attributeName)
          Get the value for the named attribute of the service.
 java.lang.String[] getServiceAttributeNames()
          Get the names of the attributes of the service.
 java.lang.String getServiceBundle()
          Get ServiceBundle string associated with authenticated lifecyle handle.
 javax.naming.directory.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.
 java.lang.String getServiceName()
          Get the service name.
 java.lang.String getServiceSessionName()
          Get the session name.
 java.util.Map getServiceSessionPropertyMap()
          Gets a map of service session properties.
 java.lang.String getServiceSessionTag()
          Get the service session tag.
 java.lang.String getSessionId()
          Get the session id.
 java.lang.String getSessionVolumeQuota()
          Get the session volume quota.
 long getStartTime()
          Get the start time.
 java.util.Map getSubscriberPropertyMap()
          Gets a map of subscriber properties.
 java.lang.String getSubscriptionName()
          Get the subscription name.
 java.lang.String[] getSubstitutions()
          Get the substitutions.
 int getTerminateCause()
          Gets the reason the service session was stopped
 int getUpStreamBandwidth()
          Get the service up stream bandwidth.
 javax.naming.directory.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.
 java.lang.String getUserDn()
          Get the LDAP distinguished name of the loaded user profile assigned to the user.
 java.net.InetAddress getUserInetAddress()
          Get the InetAddress associated with PPP or DHCP user.
 java.lang.String getUserMacAddress()
          Get MAC address of DHCP user.
 java.lang.String[] getUserRadiusClass()
          Get radius class.
 java.lang.String getUserSessionId()
          Get the user session ID.
 java.lang.String getUserType()
          Get the user type.
 LogWriter getWarningLog()
          Returns a LogWriter object that can be used to print messages to the WARNING log.
 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
 boolean isModifyServiceSession()
           
 RadiusResponse sendDynamicRadius(java.net.InetSocketAddress dynRadiusServer, byte code, int action, java.util.Map attrs, java.lang.String config, java.net.InetSocketAddress dynRadiusClient, java.lang.String shareSecret, int retry)
          Send dynamic authorization request to radius client
 void stopService(int terminateReason)
          Deactivate the service session.
 

Method Detail

getHostName

java.lang.String getHostName()
Get the host name.

Returns:
The host name.

getServiceName

java.lang.String getServiceName()
Get the service name.

Returns:
The service name.

getServiceSessionName

java.lang.String getServiceSessionName()
Get the session name.

Returns:
The session name.

getServiceSessionTag

java.lang.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

java.lang.String getSubscriptionName()
Get the subscription name.

Returns:
The subscription name.

getStartTime

long getStartTime()
Get the start time.

Returns:
The time the service session was started.

getSessionId

java.lang.String getSessionId()
Get the session id.

Returns:
The session id.

getSubstitutions

java.lang.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.

getParameterSubstitutions

java.util.Map getParameterSubstitutions(java.util.List names)
                                        throws ScriptServiceException
Get the requested parameter substitutions from the acquisition path.

Parameters:
names - - list of parameter substitution names to get their values from the acquisition path (List of String). If names is null or empty, returns all the substitutions from the acquisition path.
Returns:
a Map where substitution-name (String) -> substitution-value (String)
Throws:
ScriptServiceException - If an exception was thrown during acquiring the parameters or if one of the parameters had no acquired value.
Since:
3.0.0

getUpStreamBandwidth

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

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

java.lang.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

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

Returns:
the terminate cause of the service session

getServiceSessionPropertyMap

java.util.Map getServiceSessionPropertyMap()
Gets a map of service session properties. The service session properties are arbitrary strings that are persistently stored in the service session. The properties can also be set by an authorization plug-in.

Returns:
Map of session properties where key: String, value: String (property of format "key = value") key: String, value: null (property of format "a string")

getServiceAttributeNames

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

Returns:
The names of the service attributes.

getServiceAttribute

java.lang.Object getServiceAttribute(java.lang.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

java.lang.String getRouterName()
Get the router name.

Returns:
The router name.

getInterfaceName

java.lang.String getInterfaceName()
Get the interface name.

Returns:
The interface name.

getInterfaceAlias

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

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

getInterfaceDescr

java.lang.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

long getInterfaceSpeed()
Get the interface speed

Returns:
The interface speed

getPortId

java.lang.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

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

java.lang.String getIfRadiusClass()
Deprecated. use getIfRadiusClassList() instead.

Get the RadiusClass. The RadiusClass is only available for PPP and authenticated DHCP addresses.

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

getIfRadiusClassList

java.util.List getIfRadiusClassList()
Get all values of interface-radius class.

Returns:
a List of String or null if no attributes are available.

getNasInetAddress

java.net.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

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

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

getPrimaryUserName

java.lang.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

java.lang.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

getCallingStationId

java.lang.String getCallingStationId()
Get Calling-Station-Id associated with the primary interface

Returns:
the calling-station-id

getUserInetAddress

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

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

getUserType

java.lang.String getUserType()
Get the user type.

Returns:
The user type.

getUserMacAddress

java.lang.String getUserMacAddress()
Get MAC address of DHCP user.

Returns:
The user MAC address.

getDhcpPacket

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

Returns:
The DHCP options.

getAccountingId

java.lang.String getAccountingId()
Get the user accounting ID.

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

getUserDn

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

Returns:
The user DN.

getUserRadiusClass

java.lang.String[] getUserRadiusClass()
Get radius class.

Returns:
The user radius class.

getUserSessionId

java.lang.String getUserSessionId()
Get the user session ID.

Returns:
The user session ID.

isLoggingOut

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


isLoggingIn

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


isBeingRemoved

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


getSubscriberPropertyMap

java.util.Map getSubscriberPropertyMap()
Gets a map of subscriber properties. The subscriber properties are arbitrary strings that are persistently stored in the subscriber session. The properties can also be set by an authorization plug-in.

Returns:
Map of session properties where key: String, value: String (property of format "key = value") key: String, value: null (property of format "a string")

getServiceDirectory

javax.naming.directory.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

javax.naming.directory.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

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

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

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

Returns:
The access to the ERROR log.

getWarningLog

LogWriter getWarningLog()
Returns a LogWriter object that can be used to print messages to the WARNING log.

Returns:
The access to the WARNING log.

getNoticeLog

LogWriter getNoticeLog()
Returns a LogWriter object that can be used to print messages to the NOTICE log.

Returns:
The access to the NOTICE log.

getCriticalLog

LogWriter getCriticalLog()
Returns a LogWriter object that can be used to print messages to the CRITICAL log.

Returns:
The access to the CRITICAL log.

stopService

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

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

getCommandChannel

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

Returns:
the router CommandChannel

sendDynamicRadius

RadiusResponse sendDynamicRadius(java.net.InetSocketAddress dynRadiusServer,
                                 byte code,
                                 int action,
                                 java.util.Map attrs,
                                 java.lang.String config,
                                 java.net.InetSocketAddress dynRadiusClient,
                                 java.lang.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

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

getLocalQosProfiles

java.util.Map getLocalQosProfiles()
Returns:
A map of the local qos profiles if reported by router. key is the layer the qos profile is attached at and the value is the profile name.

getRemoteTunnelInetAddress

java.net.InetAddress getRemoteTunnelInetAddress()
InetAddress of the far end of an L2TP tunnel. If the subscriber interface is an L2TP(LAC) interface, the field contains the address of the LNS. If the subscriber interface is an IP interface on top of an LNS, the field contains the address of the LAC.

Returns:
the InetAddress of the far end of an L2TP connection

getLocalTunnelInetAddress

java.net.InetAddress getLocalTunnelInetAddress()
InetAddress of the local end of an L2TP tunnel. If the subscriber interface is an L2TP(LAC) interface, the field contains the address of the LAC. If the subscriber interface is an IP interface on top of an LNS, the field contains the address of the LNS.

Returns:
the InetAddress of the far end of an L2TP connection

isModifyServiceSession

boolean isModifyServiceSession()

Core API 7.8