本文整理匯總了Java中org.opendaylight.controller.forwarding.staticrouting.StaticRouteConfig.isValid方法的典型用法代碼示例。如果您正苦於以下問題:Java StaticRouteConfig.isValid方法的具體用法?Java StaticRouteConfig.isValid怎麽用?Java StaticRouteConfig.isValid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.opendaylight.controller.forwarding.staticrouting.StaticRouteConfig
的用法示例。
在下文中一共展示了StaticRouteConfig.isValid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addStaticRoute
import org.opendaylight.controller.forwarding.staticrouting.StaticRouteConfig; //導入方法依賴的package包/類
public Status addStaticRoute(StaticRouteConfig config) {
Status status;
status = config.isValid();
if (!status.isSuccess()) {
return status;
}
if (staticRouteConfigs.get(config.getName()) != null) {
return new Status(StatusCode.CONFLICT,
"A valid Static Route configuration with this name " +
"already exists. Please use a different name");
}
for (StaticRouteConfig s : staticRouteConfigs.values()) {
if (s.equals(config)) {
return new Status(StatusCode.CONFLICT,
"This conflicts with an existing Static Route " +
"Configuration. Please check the configuration " +
"and try again");
}
}
staticRouteConfigs.put(config.getName(), config);
StaticRoute sRoute = new StaticRoute(config);
staticRoutes.put(config.getName(), sRoute);
checkAndUpdateListeners(sRoute, true);
return status;
}