Commit a8488c41 authored by Tobias Meuser's avatar Tobias Meuser Committed by Jose Ignacio Monreal Bailey
Browse files

Added speed to SiSTypes, provided by DefaultTopologyComponent

parent 02e300e9
...@@ -134,7 +134,6 @@ public class DefaultTopologyComponent implements TopologyComponent { ...@@ -134,7 +134,6 @@ public class DefaultTopologyComponent implements TopologyComponent {
position.set(placementModel.place(this)); position.set(placementModel.place(this));
} }
if (registerAsInformationProviderInSiS) {
try { try {
final SiSComponent sis = host.getComponent(SiSComponent.class); final SiSComponent sis = host.getComponent(SiSComponent.class);
sis.provide().nodeState(SiSTypes.PHY_LOCATION, sis.provide().nodeState(SiSTypes.PHY_LOCATION,
...@@ -165,6 +164,34 @@ public class DefaultTopologyComponent implements TopologyComponent { ...@@ -165,6 +164,34 @@ public class DefaultTopologyComponent implements TopologyComponent {
} }
}); });
sis.provide().nodeState(SiSTypes.SPEED,
new SiSDataCallback<Double>() {
Set<INodeID> localID = INodeID
.getSingleIDSet(getHost().getId());
@Override
public Double getValue(INodeID nodeID,
SiSProviderHandle providerHandle)
throws InformationNotAvailableException {
if (nodeID.equals(getHost().getId())) {
return getMovementSpeed();
} else {
throw new InformationNotAvailableException();
}
}
@Override
public Set<INodeID> getObservedNodes() {
return localID;
}
@Override
public SiSInfoProperties getInfoProperties() {
return new SiSInfoProperties();
}
});
// Provide Underlay topology // Provide Underlay topology
Event.scheduleImmediately(new EventHandler() { Event.scheduleImmediately(new EventHandler() {
...@@ -176,7 +203,6 @@ public class DefaultTopologyComponent implements TopologyComponent { ...@@ -176,7 +203,6 @@ public class DefaultTopologyComponent implements TopologyComponent {
getTopologyID(NetInterfaceName.WIFI, true), getTopologyID(NetInterfaceName.WIFI, true),
DefaultTopologyComponent.class); DefaultTopologyComponent.class);
} }
}
}, null, 0); }, null, 0);
} catch (ComponentNotAvailableException e) { } catch (ComponentNotAvailableException e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment