本文整理汇总了Java中org.onosproject.net.driver.DriverData类的典型用法代码示例。如果您正苦于以下问题:Java DriverData类的具体用法?Java DriverData怎么用?Java DriverData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DriverData类属于org.onosproject.net.driver包,在下文中一共展示了DriverData类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectStandbyDevice
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
private void connectStandbyDevice(DeviceId deviceId) {
//if device is pipeline programmable we merge pipeconf + base driver for every other role
GeneralProviderDeviceConfig providerConfig =
cfgService.getConfig(deviceId, GeneralProviderDeviceConfig.class);
Driver driver = getDriver(deviceId);
DriverData driverData = new DefaultDriverData(driver, deviceId);
DeviceHandshaker handshaker = getBehaviour(driver, DeviceHandshaker.class, driverData);
if (handshaker == null) {
log.error("Device {}, with driver {} does not support DeviceHandshaker " +
"behaviour, supported behaviours={}", deviceId, driver.name(), driver.behaviours());
return;
}
addConfigData(providerConfig, driverData);
//Connecting to the device
handshaker.connect().thenAcceptAsync(result -> {
if (result) {
handlePipeconf(deviceId, driver, driverData, false);
}
});
}
示例2: getBehaviour
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
private <T extends Behaviour> T getBehaviour(Driver driver, Class<T> type,
DriverData data) {
if (driver != null && driver.hasBehaviour(type)) {
DefaultDriverHandler handler = new DefaultDriverHandler(data);
return driver.createBehaviour(handler, type);
} else {
return null;
}
}
示例3: addConfigData
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
private void addConfigData(GeneralProviderDeviceConfig providerConfig, DriverData driverData) {
//Storing deviceKeyId and all other config values
// as data in the driver with protocol_<info>
// name as the key. e.g protocol_ip
providerConfig.protocolsInfo()
.forEach((protocol, deviceInfoConfig) -> {
deviceInfoConfig.configValues()
.forEach((k, v) -> driverData.set(protocol + "_" + k, v));
driverData.set(protocol + "_key", deviceInfoConfig.deviceKeyId());
});
}
示例4: data
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
@Override
public DriverData data() {
return null;
}
示例5: setData
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
@Override
public void setData(DriverData data) {
}
示例6: createBehaviour
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T extends Behaviour> T createBehaviour(DriverData data, Class<T> behaviourClass) {
return (T) new TestPipeliner();
}
示例7: data
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
@Override
public DriverData data() {
return mockDriverData;
}
示例8: data
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
@Override
public DriverData data() {
// Just create a fake driver data
return new DefaultDriverData(null, deviceId);
}
示例9: setData
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
@Override
public void setData(DriverData data) {
}
示例10: asData
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
/**
* Returns self as an immutable driver data instance.
*
* @return self as driver data
*/
protected DriverData asData() {
return new DeviceDriverData();
}
示例11: asData
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
/**
* Returns self as an immutable driver data instance.
*
* @return self as driver data
*/
protected DriverData asData() {
return new AnnotationDriverData();
}
示例12: FujitsuDriverHandlerAdapter
import org.onosproject.net.driver.DriverData; //导入依赖的package包/类
/**
* Creates new driver handler with the attached driver data.
*
* @param data driver data to attach
*/
public FujitsuDriverHandlerAdapter(DriverData data) {
super(data);
}