IltLink
class defines the following attributes:
Media
—Indicates the physical medium connecting two network elements
(
fiber
, for example).
media
IltLink.Media
IltLink.MediaAttribute
Technology
—Indicates the networking technology represented by the link
(circuit switching, for example).
technology
IltLink.LinkTechnology
IltLink.TechnologyAttribute
IltLink
using its GetIlpClass method. You can handle its
instances as simple IlpObject instances and set and get its
attributes with the generic methods getAttributeValue and setAttributeValue.
parse
method of the data source, as shown below:
dataSource = new IltDefaultDataSource(); dataSource.parse("LinkXMLFile.xml");
<cpldata> <addObject id="NE1"> <class>ilog.tgo.model.IltNetworkElement</class> <attribute name="name">NE1</attribute> <attribute name="family">OC12</attribute> <attribute name="type">MD</attribute> <attribute name="position" javaClass="ilog.cpl.graphic.IlpPoint"> <x>200</x> <y>200</y> </attribute> </addObject> <addObject id="NE2"> <class>ilog.tgo.model.IltNetworkElement</class> <attribute name="name">NE2</attribute> <attribute name="type">MD</attribute> <attribute name="position" javaClass="ilog.cpl.graphic.IlpPoint"> <x>400</x> <y>200</y> </attribute> </addObject> <addObject id="NE1-NE2"> <class>ilog.tgo.model.IltLink</class> <link> <from>NE1</from> <to>NE2</to> </link> <attribute name="name">Link1</attribute> <attribute name="media">Fiber</attribute> <attribute name="objectState" javaClass="ilog.tgo.model.IltSONETObjectState"> <state>ActiveProtecting</state> <protection>Exercisor</protection> </attribute> </addObject> </cplData>
IltNetworkElement ne1 = new IltNetworkElement("NE1", IltNetworkElement.Type.MD, new IltOSIObjectState()); ne1.setAttributeValue(IltObject.PositionAttribute, new IlpPoint(200, 200)); IltNetworkElement ne2 = new IltNetworkElement("NE2", IltNetworkElement.Type.MD, new IltOSIObjectState()); ne2.setAttributeValue(IltObject.PositionAttribute, new IlpPoint(400, 200)); IltSONETObjectState linkState = new IltSONETObjectState(IltSONET.State.ActiveProtecting); linkState.addProtection(IltSONET.End.From, IltSONET.Protection.Exercisor); linkState.addProtection(IltSONET.End.To, IltSONET.Protection.Exercisor); IltLink link = new IltLink (linkState, "Link1", IltLink.Media.Fiber); IltDefaultDataSource dataSource = new IltDefaultDataSource(); dataSource.setLink(link.getIdentifier(), ne1.getIdentifier(), ne2.getIdentifier()); List objs = new ArrayList(); objs.add(ne1); objs.add(ne2); objs.add(link); dataSource.addObjects(objs);