本文整理汇总了Java中net.floodlightcontroller.core.IOFConnectionBackend类的典型用法代码示例。如果您正苦于以下问题:Java IOFConnectionBackend类的具体用法?Java IOFConnectionBackend怎么用?Java IOFConnectionBackend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOFConnectionBackend类属于net.floodlightcontroller.core包,在下文中一共展示了IOFConnectionBackend类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectionClosed
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
/** IOFConnectionListener */
@Override
public void connectionClosed(IOFConnectionBackend connection) {
// Disconnect handler's remaining connections
cleanup();
// Only remove the switch handler when the main connection is
// closed
if (connection == this.mainConnection) {
switchManager.handshakeDisconnected(connection.getDatapathId());
if(sw != null) {
log.debug("[{}] - main connection {} closed - disconnecting switch",
connection);
setSwitchStatus(SwitchStatus.DISCONNECTED);
switchManager.switchDisconnected(sw);
}
}
}
示例2: getOFSwitchInstance
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
@Override
public IOFSwitchBackend
getOFSwitchInstance(IOFConnectionBackend connection,
SwitchDescription description,
OFFactory factory, DatapathId datapathId) {
return null;
}
示例3: OFSwitch
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager,
@Nonnull DatapathId datapathId) {
if(connection == null)
throw new NullPointerException("connection must not be null");
if(!connection.getAuxId().equals(OFAuxId.MAIN))
throw new IllegalArgumentException("connection must be the main connection");
if(factory == null)
throw new NullPointerException("factory must not be null");
if(switchManager == null)
throw new NullPointerException("switchManager must not be null");
this.connected = true;
this.factory = factory;
this.switchManager = switchManager;
this.datapathId = datapathId;
this.attributes = new ConcurrentHashMap<Object, Object>();
this.role = null;
this.description = new SwitchDescription();
this.portManager = new PortManager();
this.status = SwitchStatus.HANDSHAKE;
// Connections
this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
this.connections.put(connection.getAuxId(), connection);
// Switch's controller connection
this.controllerConnections = ImmutableMap.of();
// Defaults properties for an ideal switch
this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);
this.tableFeaturesByTableId = new HashMap<TableId, TableFeatures>();
this.tables = new ArrayList<TableId>();
this.securityKernel = switchManager.getSecurityKernelService();
}
示例4: disconnect
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
@Override
public void disconnect() {
// Iterate through connections and perform cleanup
for (Entry<OFAuxId, IOFConnectionBackend> entry : this.connections.entrySet()) {
entry.getValue().disconnect();
this.connections.remove(entry.getKey());
}
log.debug("~~~~~~~SWITCH DISCONNECTED~~~~~~");
// Remove all counters from the store
connected = false;
}
示例5: OFSwitchHandshakeHandler
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
/**
* Create a new unconnected OFChannelHandler.
* @param controller
* @param broker
* @throws SwitchHandshakeHandlerException
*/
OFSwitchHandshakeHandler(@Nonnull IOFConnectionBackend connection,
@Nonnull OFFeaturesReply featuresReply,
@Nonnull IOFSwitchManager switchManager,
@Nonnull RoleManager roleManager,
@Nonnull Timer timer) {
Preconditions.checkNotNull(connection, "connection");
Preconditions.checkNotNull(featuresReply, "featuresReply");
Preconditions.checkNotNull(switchManager, "switchManager");
Preconditions.checkNotNull(roleManager, "roleManager");
Preconditions.checkNotNull(timer, "timer");
Preconditions.checkArgument(connection.getAuxId().equals(OFAuxId.MAIN),
"connection must be MAIN connection but is %s", connection);
this.switchManager = switchManager;
this.roleManager = roleManager;
this.mainConnection = connection;
this.auxConnections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
this.featuresReply = featuresReply;
this.timer = timer;
this.switchManagerCounters = switchManager.getCounters();
this.factory = OFFactories.getFactory(featuresReply.getVersion());
this.roleChanger = new RoleChanger(DEFAULT_ROLE_TIMEOUT_NS);
setState(new InitState());
this.pendingPortStatusMsg = new ArrayList<OFPortStatus>();
connection.setListener(this);
}
示例6: auxConnectionOpened
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
/**
* Called by the switch manager when new aux connections have connected.
* This alerts the state machine of an aux connection.
*
* @param connection
* the aux connection
*/
public synchronized void auxConnectionOpened(IOFConnectionBackend connection) {
if(log.isDebugEnabled())
log.debug("[{}] - Switch Handshake - new aux connection {}", this.getDpid(), connection.getAuxId());
// Handle new Auxiliary connections if the main connection has completed (i.e. in ACTIVE or STANDBY state)
if (this.getState().equals("ACTIVE") || this.getState().equals("STANDBY")) {
auxConnections.put(connection.getAuxId(), connection);
connection.setListener(OFSwitchHandshakeHandler.this);
log.info("Auxiliary connection {} added for {}.", connection.getAuxId().getValue(), connection.getDatapathId().toString());
} else {
log.info("Auxiliary connection {} initiated for {} before main connection handshake complete. Ignorning aux connection attempt.", connection.getAuxId().getValue(), connection.getDatapathId().toString());
}
}
示例7: hasConnection
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
/**
* Determines if this handshake handler is responsible for the supplied
* connection.
*
* @param connection
* an OF connection
* @return true if the handler has the connection
*/
public boolean hasConnection(IOFConnectionBackend connection) {
if (this.mainConnection.equals(connection)
|| this.auxConnections.get(connection.getAuxId()) == connection) {
return true;
} else {
return false;
}
}
示例8: cleanup
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
void cleanup() {
for (IOFConnectionBackend conn : this.auxConnections.values()) {
conn.disconnect();
}
this.mainConnection.disconnect();
}
示例9: getOFSwitchInstance
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
@Override
public IOFSwitchBackend getOFSwitchInstance(IOFConnectionBackend connection,
SwitchDescription description,
OFFactory factory, DatapathId datapathId) {
return this.driverRegistry.getOFSwitchInstance(connection, description, factory, datapathId);
}
示例10: OFSwitch
import net.floodlightcontroller.core.IOFConnectionBackend; //导入依赖的package包/类
public OFSwitch(IOFConnectionBackend connection, @Nonnull OFFactory factory, @Nonnull IOFSwitchManager switchManager,
@Nonnull DatapathId datapathId) {
if(connection == null)
throw new NullPointerException("connection must not be null");
if(!connection.getAuxId().equals(OFAuxId.MAIN))
throw new IllegalArgumentException("connection must be the main connection");
if(factory == null)
throw new NullPointerException("factory must not be null");
if(switchManager == null)
throw new NullPointerException("switchManager must not be null");
this.connected = true;
this.factory = factory;
this.switchManager = switchManager;
this.datapathId = datapathId;
this.attributes = new ConcurrentHashMap<Object, Object>();
this.role = null;
this.description = new SwitchDescription();
this.portManager = new PortManager();
this.status = SwitchStatus.HANDSHAKE;
// Connections
this.connections = new ConcurrentHashMap<OFAuxId, IOFConnectionBackend>();
this.connections.put(connection.getAuxId(), connection);
// Switch's controller connection
this.controllerConnections = ImmutableMap.of();
// Defaults properties for an ideal switch
this.setAttribute(PROP_FASTWILDCARDS, EnumSet.allOf(OFFlowWildcards.class));
this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.TRUE);
this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.TRUE);
this.tableFeaturesByTableId = new HashMap<TableId, TableFeatures>();
this.tables = new ArrayList<TableId>();
}