Core API 7.8

net.juniper.smgt.sae.scriptservice
Interface ScriptService

All Known Implementing Classes:
NullScriptService

public interface ScriptService

The ScriptService interface defines an SPI that must be implemented by the script service.


Method Summary
 void activateSession()
          Activate the script service session.
 AccountingData deactivateSession()
          Deactivate the script service session.
 void discarded()
          Notify that the service session has been discarded.
 AccountingData getAccountingData()
          Poll current accounting data.
 byte[] getState()
          Return opaque state data that will be stored persistently on the router.
 void initSessionInfo(ServiceSessionInfo info)
          Provide session information to the script service.
 void initState(ServiceSessionInfo info, byte[] state)
          Initialize a recovered script service session after synchronization of the state.
 AccountingData modifySession(ServiceSessionInfo info)
          Modify the script service session.
 

Method Detail

initSessionInfo

void initSessionInfo(ServiceSessionInfo info)
Provide session information to the script service. This method will be called exactly once after the service is instantiated.

Parameters:
info - provide information of service session

activateSession

void activateSession()
                     throws ScriptServiceException
Activate the script service session.

Throws:
ScriptServiceException

deactivateSession

AccountingData deactivateSession()
                                 throws ScriptServiceException
Deactivate the script service session.

Returns:
The final accounting data for the script service session or null if accounting is not supported.
Throws:
ScriptServiceException

modifySession

AccountingData modifySession(ServiceSessionInfo info)
                             throws ScriptServiceException
Modify the script service session.

Returns:
The accounting data to store in an accounting baseline or null if the accounting data is continuing or not supported.
Throws:
ScriptServiceException

getAccountingData

AccountingData getAccountingData()
                                 throws ScriptServiceException
Poll current accounting data.

Returns:
The current accounting data for the script service session or null if accounting is not supported.
Throws:
ScriptServiceException

getState

byte[] getState()
Return opaque state data that will be stored persistently on the router. The script service has to maintain versioning information itself. The opaque state can be null, if no state data needs to be stored.
   This method is called after the service session is activated, modified and when interim accounting detects a discontinuity in the accounting data.

Returns:
The opaque state data that will be stored persistently on the router or null if no state data needs to be stored.

initState

void initState(ServiceSessionInfo info,
               byte[] state)
Initialize a recovered script service session after synchronization of the state.

Parameters:
info - provide information of service session
state -

discarded

void discarded()
Notify that the service session has been discarded. Service sessions are discarded when SAE loses connection with a router. A discarded service session does still exist on the router and will be restored after the connection to the router is re-established by an SAE.
   The script service session should release any resource associated with this session, but must not take any action that would disrupt the service session itself.


Core API 7.8