本文整理匯總了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);
}