Package onep :: Package location :: Module location :: Class Location
[frames] | no frames]

Class Location



Location class stores all information related to physical location
in the real world. It is used by multiple Service Sets, including
Element (NetworkElement & NetworkInterface) and Identity.

Location provides location information in various forms:
ELIN ("Equipment Line Item Number" or
          "Emergency Location Identification Number")
Civic address (CAtype attributes as defined in RFC 4776)
Cisco Custom address "Name" and "Value" pairs
Geographic address information

Any entity which has location data may have any one or more of these defined
simultaneously.  Each type of location data is defined independently of the
others.

Location usage includes the following cases:
 * <ul>
 * <li>Network Element
 * <li>Network Interface
 * <li>Identify
 * </ul>
In the case of NetworkElement, Location specifies the physical location
of the device itself. This may be used in order to locate a device 
in a building or machine room, find devices which will be affected by 
maintenance,etc.

In the case of NetworkInterface, Location specifies the physical location
of the end point of the cable attached on the port.  This information may be
used in order to track down the location of devices attached to this port.
Any sessions which are started from devices attached to the port will inherit
their location data from that port.

When used in the Identity Service Set, Location specifies the
physical location associated with the end point(s) of the session and/or the
location of the end-user associated with the session.  

@undocumented: toIDL

Instance Methods
 
civic_location(self, catype)
 
__init__(self, elin=None, civic_list=None, custom_list=None, geo=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
elin(self)
 
__eq__(self, obj)
 
__str__(self)
str(x)
 
add_civic_location(self, catype, value)
This method adds one standardized Civic Address information element associated with the Location, indexed by catype and specifying the value for the new element.
 
remove_civic_location(self, catype)
This method removes one standardized Civic Address information element associated with the Location, indexed by catype.
 
remove_civic_location_list(self)
This method removes all Civic Address information associated with the Location.
 
get_custom_location(self, name)
This method gets one standardized Custom Address information element associated with the Location, indexed by name.
 
add_custom_location(self, name, value)
This method adds one Cisco Custom Address information tuple associated with the Location, specifying the name and value for the new element.
 
remove_custom_location(self, name)
This method removes one Cisco Custom Address information element associated with the Location, indexed by name.
 
remove_custom_location_list(self)
This method removes all Custom Address information associated with the Location.
 
remove_geo_location(self)
This method removes the Geolocation (GPS) Address information associated with the Location.
 
toIDL(self)
Convert Location instance to NetworkLocationIDL.
 
add_change_listener(self, listener, loc_filter, client_data)
Add a location change listener to the Location object.
 
remove_change_listener(self, event_handle)
Remove location change event listener.

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

Class Variables
  civic_list = property(_get_civic_list, _set_civic_list, None, ...
  custom_list = property(_get_custom_list, _set_custom_list, Non...
  geo = property(_get_geo, _set_geo, None, _doc_geo)
Properties

Inherited from object: __class__

Method Details

__init__(self, elin=None, civic_list=None, custom_list=None, geo=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • elin - The ELIN phone number string containing ELIN information. It can be None if the information is not specified. This is not supported on asr1k
  • civic_list - A list of LocationCivic containing civic location information. It can be None if the information is not specified.
  • custom_list - A list of LocationCustom containing custom location information. It can be None if the information is not specified.
  • geo - The GeoLocation object containing Geo location information. It can be None if the information is not specified.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

add_civic_location(self, catype, value)

 

This method adds one standardized Civic Address information element
associated with the Location, indexed by catype and specifying the value
for the new element.

@param catype RFC4776 standard CAtype for the new civic location element.
@param value A string representing the civic location info. A None for the
    value is considered a parameter error.
@throws OnepIllegalArgumentException
    The exception is thrown when input catype parameter is invalid, or
    if the input catype already exist in this Location instance.
    If the "catype" is already present, it cannot be added again, but
    must be removed first.   

remove_civic_location(self, catype)

 

This method removes one standardized Civic Address information element
associated with the Location, indexed by catype. 

If no match is found, this method will not take action.

@param catype RFC4776 standard CAtype for the new civic location element.
@throws OnepIllegalArgumentException
    The exception is thrown when input parameter is invalid.

get_custom_location(self, name)

 

This method gets one standardized Custom Address information element
associated with the Location, indexed by name.

@param name Name of the custom location element to retrieve.
@return A string representing the Custom location info; null if no 
    Custom location information is not defined for this 
    Location instance or no value has been assigned for 
    the custom name passed.

add_custom_location(self, name, value)

 

This method adds one Cisco Custom Address information tuple
associated with the Location, specifying the name and value
for the new element.

Each element of the Custom Address information is represented as a
(name,value) tuple, where both are strings.

@param name Name of the custom location element, which is 
    case-sensitive.
@param value A string representing the Custom location info.
@throws OnepIllegalArgumentException
    The exception is thrown when input parameter is invalid,
    or if the input name already exist in this Location instance.
    If the name is already present, it cannot be added again, but
    must be removed first.

remove_custom_location(self, name)

 

This method removes one Cisco Custom Address information element
associated with the Location, indexed by name.

If no match is found, this method will not take action.

Each element of the Custom Address information is represented as a
(name,value) tuple, where both are strings.

@param name Name of the custom location element.
    @throws OnepIllegalArgumentException
    The exception is thrown when input parameter is invalid.

remove_custom_location_list(self)

 

This method removes all Custom Address information associated with the Location.

Each element of the Custom Address information is represented as a (name,value) tuple, where both are strings.

toIDL(self)

 

Convert Location instance to NetworkLocationIDL. For internal use only

add_change_listener(self, listener, loc_filter, client_data)

 

Add a location change listener to the Location object. 
Multiple listeners can be associate with an instance of Location.

@param listener
    The LocationChangeListener object that handles the events.
@type listener: L{LocationChangeListener<onep.location.location.LocationChangeListener>}

@param loc_filter
    The LocationChangeFilter to specify criteria of interested location
    change events.
@type loc_filter: L{LocationChangeFilter<onep.location.location.LocationChangeFilter>}

@param clientData
    The client data associated with the listener. This client data 
    will be part of input parameters when the handleEvent method 
    in the listener is invoked.
@type clientData: L{object}

@return EventHandle, a numeric ID associated with this event
    registration. The eventHandle is used to unregister the listener
    using the removeLocationChangeListener method. If registration fails, -1
    is returned.
@throws OnepConnectionException
    The exception is thrown when connection to a network element
    has failed.
@throws OnepRemoteProcedureException
    The exception is thrown when error has occurred in the remote
    procedure call made to a network element
@throws OnepException
    The exception is thrown when an internal error occurs

remove_change_listener(self, event_handle)

 

Remove location change event listener. This method will remove the listener
associated with the given event_handle and the corresponding registered
event on the Location will be removed as well

@param event_handle
    Registered event identifier.

@throws OnepIllegalArgumentException
    This exception is thrown when eventHandle is not valid or is
    unregistered already.
<p><b>Example:</b></p>
<pre>
    location = ne.get_location();
    eh = locA.add_change_listener(listener, filter, null);
    location.remove_changeListener(eh);
</pre>


Class Variable Details

civic_list

Value:
property(_get_civic_list, _set_civic_list, None, _doc_civic_list)

custom_list

Value:
property(_get_custom_list, _set_custom_list, None, _doc_custom_list)