Package onep :: Package identity :: Module identity :: Class Identity
[frames] | no frames]

Class Identity


Session Aware Network (aka. Identity) Service Set is a set of API that allows application programs to access information about the network sessions.

A network session is identified by a set of AAA attributes (user-name, IP-address, MAC-address, etc). The Identity service set API will provide capability to add, update, delete and query network session based on a combination of query attributes. These API will provide an interface to applications interested in accessing network session information that matches certain criteria.

Instance Methods
 
__init__(self, element)
@param element: The network element from which to access the Identity service.
 
add_session(self, attr_list)
Adds a session record to the database and updates it with the attribute values.
 
delete_session(self, session)
Deletes the session record from the database.
 
find_session_by_attributes(self, match_list, retrieve_list=None)
Finds sessions matching the attributes specified in match_list.
 
delete_session_by_attributes(self, match_list, enforce_multi_delete=False)
Deletes sessions matching the attributes specified in match_list.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, element)
(Constructor)

 

@param element:
    The network element from which to access 
    the Identity service. The element must be 
    connected before using this constructor to get 
               
@throws OnepIllegalArgumentException
    The exception is thrown when any of input parameter is 
    invalid.
@throws OnepConnectionException
    The exception is thrown when the network element 
    is not connected.

Overrides: object.__init__

add_session(self, attr_list)

 

Adds a session record to the database and updates it with the 
attribute values. Note that "mac-addr" must be specified in
the AAA attributes when adding a session. 
 
@param attr_ist: List of AAA attributes to be stored in the record.

@return an IdentitySession object representing the session record 
in the database of the network element; None is returned 
if the method failed to add a session.
         
@throws OnepIllegalArgumentException
    The exception is thrown when any of input parameter is 
    invalid.
@throws OnepConnectionException
    The exception is thrown when the network element 
    is not connected.
@throws OnepRemoteProcedureException
    The exception is thrown when an error has 
    occurred in the remote procedure call made to the 
    network element or the session cannot be created.

delete_session(self, session)

 

Deletes the session record from the database.

@param session:
    The session that needs to be deleted. 
    
@throws OnepIllegalArgumentException
    The exception is thrown when any of input parameter is 
    invalid.
@throws OnepConnectionException
    The exception is thrown when the network element 
    is not connected.
@throws OnepRemoteProcedureException
    The exception is thrown when an error has 
    occurred in the remote procedure call made to the 
    network element.

find_session_by_attributes(self, match_list, retrieve_list=None)

 

Finds sessions matching the attributes specified in match_list. 
The attributes associated with each of the found sessions will be
retrieved and returned as the values of the dictionary.

If the optional retrieve_list is None, all attributes will be retrieved. 
If the retrieve_list is not null, only a subset of the attributes listed 
in the retrieve_list will be retrieved. 

@param match_list:
    The attributes and their corresponding values in the match_list 
    specifies the sessions that match these attributes.
@param retrieve_list:
    The retrieve_list specifies a list of attribute to be retrieved. 
    If it is None or missing, all attributes will be retrieved; otherwise 
    only a subset of the attributes listed in the retrieve_list
    will be retrieved.
            
@return A dictionary that contains Identity sessions as keys and list of Attribute
    as corresponding values. 
        
@throws OnepIllegalArgumentException
    The exception is thrown when any of input parameter is 
    invalid.
@throws OnepConnectionException
    The exception is thrown when the network element 
    is not connected.
@throws OnepRemoteProcedureException
    The exception is thrown when an error has 
    occurred in the remote procedure call made to the 
    network element.

delete_session_by_attributes(self, match_list, enforce_multi_delete=False)

 

Deletes sessions matching the attributes specified in match_list. 
The attributes and their corresponding values in the match_list need to be 
specified in order to find the sessions that match these attributes. 

If multiple sessions are found and the enforce_multi_delete parameter 
is True, then all found sessions will be deleted. If multiple sessions 
are found but the enforce_multi_delete parameter is False, then none of the 
found sessions will be deleted.

@param match_list:
    The attributes and their corresponding values in the match_list 
    specifies the sessions that match these attributes.
@param enforce_multi_delete:
    This parameter determines whether to proceed with the deletion when 
    multiple sessions are found. If the  parameter is true, 
    then all found sessions will be deleted. Otherwise, none of the 
    found sessions will be deleted.
               
@throws OnepIllegalArgumentException
    The exception is thrown when any of input parameter is 
    invalid.
@throws OnepConnectionException
    The exception is thrown when the network element 
    is not connected.
@throws OnepRemoteProcedureException
    The exception is thrown when an error has 
    occurred in the remote procedure call made to the 
    network element.