import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-public class BulkOMaticUtils {
-
- private BulkOMaticUtils () { }
+public final class BulkOMaticUtils {
public static final int DEFUALT_STATUS = FlowCounter.OperationStatus.INIT.status();
public static final int DEFAULT_FLOW_COUNT = 0;
public static final String DEFAULT_UNITS = "ns";
public static final String DEVICE_TYPE_PREFIX = "openflow:";
+ private BulkOMaticUtils() {
+ }
+
public static String ipIntToStr (int k) {
- return new StringBuilder().append(((k >> 24) & 0xFF)).append(".")
- .append(((k >> 16) & 0xFF)).append(".")
- .append(((k >> 8) & 0xFF)).append(".")
- .append((k & 0xFF)).append("/32").toString();
+ return new StringBuilder().append(k >> 24 & 0xFF).append(".")
+ .append(k >> 16 & 0xFF).append(".")
+ .append(k >> 8 & 0xFF).append(".")
+ .append(k & 0xFF).append("/32").toString();
}
public static Match getMatch(final Integer sourceIp){
.augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(tableId))
.build();
-
}
public static InstanceIdentifier<Flow> getFlowId(final InstanceIdentifier<Table> tablePath, final String flowId) {
import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
-public abstract class AbstractModelDrivenSwitchRegistration extends AbstractObjectRegistration<ModelDrivenSwitch>
- implements ModelDrivenSwitchRegistration {
+public abstract class AbstractModelDrivenSwitchRegistration
+ extends AbstractObjectRegistration<ModelDrivenSwitch>
+ implements ModelDrivenSwitchRegistration {
protected AbstractModelDrivenSwitchRegistration(final ModelDrivenSwitch instance) {
super(instance);
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
- * interface concatenating all md-sal services provided by OF-switch
+ * interface concatenating all md-sal services provided by OF-switch.
*/
public interface ModelDrivenSwitch
extends
Identifiable<InstanceIdentifier<Node>> {
/**
- * @param rpcProviderRegistry
+ * Register.
+ * @param rpcProviderRegistry rpc provider
* @return wrapped list of {service provider + path} registration couples
*/
ModelDrivenSwitchRegistration register(RpcProviderRegistry rpcProviderRegistry);
/**
+ * Getter.
* @return id of encapsulated node (served by this impl)
*/
NodeId getNodeId();
/**
- * returnes the session context associated with this model-driven switch
+ * returnes the session context associated with this model-driven switch.
*
* @return session context object
*/
SessionContext getSessionContext();
/**
- * Returns whether this *instance* is entity owner or not
+ * Returns whether this *instance* is entity owner or not.
* @return true if it's entity owner, else false.
*/
boolean isEntityOwner();
/**
- * Set entity ownership satus of this switch in *this* instance
- * @param isOwner
+ * Set entity ownership satus of this switch in *this* instance.
+ * @param isOwner is owner
*/
void setEntityOwnership(boolean isOwner);
/**
* Method send port/desc multipart request to the switch to fetch the initial details.
*/
-
- public abstract void requestSwitchDetails();
+ void requestSwitchDetails();
}
-/**
+/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import org.opendaylight.yangtools.yang.binding.DataObject;
-/**
- * @author mirehak
- */
public interface ConnectionConductor {
- /** distinguished connection states */
- public enum CONDUCTOR_STATE {
- /** initial phase of talking to switch */
+ /** distinguished connection states. */
+ @SuppressWarnings({"checkstyle:abbreviationaswordinname", "checkstyle:typename"})
+ enum CONDUCTOR_STATE {
+ /** initial phase of talking to switch. */
HANDSHAKING,
- /** standard phase - interacting with switch */
+ /** standard phase - interacting with switch. */
WORKING,
- /** connection is idle, waiting for echo reply from switch */
+ /** connection is idle, waiting for echo reply from switch. */
TIMEOUTING,
- /** talking to switch is over - resting in pieces */
+ /** talking to switch is over - resting in pieces. */
RIP
}
- /** supported version ordered by height (highest version is at the beginning) */
- List<Short> versionOrder = Lists.newArrayList((short) 0x04, (short) 0x01);
+ /** supported version ordered by height (highest version is at the beginning). */
+ List<Short> VERSION_ORDER = Lists.newArrayList((short) 0x04, (short) 0x01);
/**
- * initialize wiring around {@link ConnectionAdapter}
+ * initialize wiring around {@link ConnectionAdapter}.
*/
void init();
/**
- * @return the negotiated version
+ * return the negotiated version.
*/
Short getVersion();
/**
- * @return the state of conductor
+ * return the state of conductor.
*/
CONDUCTOR_STATE getConductorState();
/**
- * @param conductorState
+ * Setter.
+ * @param conductorState state
*/
void setConductorState(CONDUCTOR_STATE conductorState);
/**
- * terminates owned connection
+ * terminates owned connection.
* @return future result of disconnect action
*/
Future<Boolean> disconnect();
/**
- * assign corresponding {@link SessionContext} to this conductor (to handle disconnect caused by switch)
- * @param context
+ * assign corresponding {@link SessionContext} to this conductor (to handle disconnect caused by switch).
+ * @param context session context
*/
void setSessionContext(SessionContext context);
/**
- * assign corresponding {@link org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher} to this conductor
- * to handle disconnect caused by switch. This involves auxiliary conductors only.
- * @param auxiliaryKey
+ * assign corresponding {@link org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher}
+ * to this conductor to handle disconnect caused by switch. This involves auxiliary conductors only.
+ * @param auxiliaryKey key
*/
void setConnectionCookie(SwitchConnectionDistinguisher auxiliaryKey);
/**
- * @return the sessionContext
+ * return the sessionContext.
*/
SessionContext getSessionContext();
/**
- * @return the auxiliaryKey (null if this is a primary connection)
+ * return the auxiliaryKey (null if this is a primary connection).
*/
SwitchConnectionDistinguisher getAuxiliaryKey();
/**
- * @return the connectionAdapter
+ * return the connectionAdapter.
*/
ConnectionAdapter getConnectionAdapter();
/**
- * assign global queueKeeper
- * @param queueKeeper
+ * assign global queueKeeper.
+ * @param queueKeeper keeper
*/
void setQueueProcessor(QueueProcessor<OfHeader, DataObject> queueKeeper);
/**
+ * Setter.
* @param errorHandler for internal exception handling
*/
void setErrorHandler(ErrorHandler errorHandler);
/**
- * @param conductorId
+ * Setter.
+ * @param conductorId id
*/
void setId(int conductorId);
import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
-/**
- * @author mirehak
- *
- */
public interface ErrorHandler {
/**
- * @param e cause
+ * Exception handler.
+ * @param throwable cause
* @param sessionContext of source
*/
- void handleException(Throwable e, SessionContext sessionContext);
+ void handleException(Throwable throwable, SessionContext sessionContext);
}
import org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
-/**
- * @author mirehak
- *
- */
public interface HandshakeListener {
/**
+ * Handshake successfull.
* @param featureOutput obtained
* @param version negotiated
*/
void onHandshakeFailure();
/**
- * @param handshakeContext
+ * Setter.
+ * @param handshakeContext context
*/
void setHandshakeContext(HandshakeContext handshakeContext);
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
-/**
- * @author mirehak
- */
public interface HandshakeManager {
/**
- * @return negotiated version
+ * return negotiated version.
*/
Short getVersion();
/**
+ * Setter.
* @param errorHandler the errorHandler to set
*/
void setErrorHandler(ErrorHandler errorHandler);
/**
+ * Setter.
* @param handshakeListener the handshakeListener to set
*/
void setHandshakeListener(HandshakeListener handshakeListener);
/**
- * @param isBitmapNegotiationEnable
+ * should use negotiation bit map.
+ * @param isBitmapNegotiationEnable yes/no
*/
void setUseVersionBitmap(boolean isBitmapNegotiationEnable);
/**
+ * process current handshake step.
* @param receivedHello message from device we need to act upon
- * process current handshake step
*/
void shake(HelloMessage receivedHello);
}
import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext;
/**
- * translates between messages
+ * translates between messages.
* @param <I> source message type (IN)
* @param <O> result message type (OUT)
*/
/**
* This method is called in order to translate message to MD-SAL or from MD-SAL.
- *
- * @param cookie
- * auxiliary connection identifier
- * @param sc
- * The SessionContext which sent the OF message
- * @param msg
- * The OF message
- *
+ * @param cookie auxiliary connection identifier
+ * @param sc The SessionContext which sent the OF message
+ * @param msg The OF message
* @return translated message
*/
O translate(SwitchConnectionDistinguisher cookie, SessionContext sc, I msg);
-/**
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
package org.opendaylight.openflowplugin.api.openflow.md.core;
/**
- * provider of wrapped notification enqueue
+ * provider of wrapped notification enqueue.
*/
public interface NotificationEnqueuer {
/**
- * enqueue given notification into standard message processing queue
- *
- * @param notification
+ * enqueue given notification into standard message processing queue.
+ * @param notification notification
*/
void enqueueNotification(NotificationQueueWrapper notification);
-/**
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.Notification;
-/**
- *
- */
public class NotificationQueueWrapper implements OfHeader {
-
+
private final Notification notification;
private final Short version;
private Long xid = -1L;
-
+
/**
- * @param notification
- * @param version
+ * Notofication queue wrapper.
+ * @param notification notofication
+ * @param version version
*/
public NotificationQueueWrapper(final Notification notification, final Short version) {
Preconditions.checkArgument(notification != null, "wrapped notification must not be null");
Preconditions.checkArgument(version != null, "message version of wrapped notification must not be null");
- this.notification = notification;
+ this.notification = notification;
this.version = version;
}
}
/**
- * @return the notification
+ * return the notification.
*/
public Notification getNotification() {
return notification;
}
/**
+ * Setter.
* @param xid the xid to set
*/
public void setXid(Long xid) {
package org.opendaylight.openflowplugin.api.openflow.md.core;
-/**
- * @author mirehak
- */
public interface SwitchConnectionDistinguisher {
/**
+ * Getter.
* @return encoded switch session identifier
*/
long getCookie();
*/
package org.opendaylight.openflowplugin.api.openflow.md.core;
-/**
- * @author mirehak
- */
public class TranslatorKey {
- private int version;
- private String messageClass;
+ private final int version;
+ private final String messageClass;
/**
- * @param version
- * @param messageClass
+ * Constructor.
+ * @param version version
+ * @param messageClass message class
*/
public TranslatorKey(int version, String messageClass) {
this.version = version;
} else if (!messageClass.equals(other.messageClass)) {
return false;
}
- if (version != other.version) {
- return false;
- }
- return true;
+ return version == other.version;
}
}
-/**
+/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
/**
- * Common interface for SwitchFeatures builders for different OF versions
- *
- * @author jsebin
- *
+ * Common interface for SwitchFeatures builders for different OF versions.
*/
public interface BuildSwitchFeatures {
/**
- *
- * @param features {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput}
+ * Getter.
+ * @param features
+ * {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput}
* @return {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures}
*/
SwitchFeatures build(GetFeaturesOutput features);
-/**
+/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
import org.opendaylight.yangtools.yang.binding.Notification;
/**
+ * Notification composer.
* @param <N> type of notification
*/
public interface NotificationComposer<N extends Notification> {
-
+
/**
+ * Compose.
* @param xid corresponding OF transaction id
* @return notification instance
*/
/**
* Message Dispatch Service to send the message to switch.
- *
- * @author AnilGujele
- *
*/
public interface IMessageDispatchService {
- public static final String CONNECTION_ERROR_MESSAGE = "Session for the cookie is invalid. Reason: "
- + "the switch has been recently disconnected OR inventory provides outdated information.";
+ String CONNECTION_ERROR_MESSAGE = "Session for the cookie is invalid. Reason: "
+ + "the switch has been recently disconnected OR inventory provides outdated information.";
/**
- * send barrier message to switch
+ * send barrier message to switch.
*
* @param input
* - message
Future<RpcResult<BarrierOutput>> barrier(BarrierInput input, SwitchConnectionDistinguisher cookie);
/**
- * send experimenter message to switch
+ * send experimenter message to switch.
*
* @param input
* - message
Future<RpcResult<java.lang.Void>> experimenter(ExperimenterInput input, SwitchConnectionDistinguisher cookie);
/**
- * send flow modification message to switch
+ * send flow modification message to switch.
*
* @param input
* - message
Future<RpcResult<UpdateFlowOutput>> flowMod(FlowModInput input, SwitchConnectionDistinguisher cookie);
/**
- * send get async message to switch
+ * send get async message to switch.
*
* @param input
* - message
Future<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input, SwitchConnectionDistinguisher cookie);
/**
- * send get config message to switch
+ * send get config message to switch.
*
* @param input
* - message
Future<RpcResult<GetConfigOutput>> getConfig(GetConfigInput input, SwitchConnectionDistinguisher cookie);
/**
- * send get features message to switch
+ * send get features message to switch.
*
* @param input
* - message
Future<RpcResult<GetFeaturesOutput>> getFeatures(GetFeaturesInput input, SwitchConnectionDistinguisher cookie);
/**
- * send get queue config message to switch
+ * send get queue config message to switch.
*
* @param input
* - message
SwitchConnectionDistinguisher cookie);
/**
- * send group modification message to switch
+ * send group modification message to switch.
*
* @param input
* - message
Future<RpcResult<UpdateGroupOutput>> groupMod(GroupModInput input, SwitchConnectionDistinguisher cookie);
/**
- * send meter modification message to switch
+ * send meter modification message to switch.
*
* @param input
* - message
Future<RpcResult<UpdateMeterOutput>> meterMod(MeterModInput input, SwitchConnectionDistinguisher cookie);
/**
- * send multipart request message to switch
+ * send multipart request message to switch.
*
* @param input
* - multipart request message
* any connection
* @return - the future
*/
- Future<RpcResult<java.lang.Void>> multipartRequest(MultipartRequestInput input, SwitchConnectionDistinguisher cookie);
+ Future<RpcResult<java.lang.Void>> multipartRequest(
+ MultipartRequestInput input,
+ SwitchConnectionDistinguisher cookie);
/**
- * send packet out message to switch
+ * send packet out message to switch.
*
* @param input
* - message
Future<RpcResult<java.lang.Void>> packetOut(PacketOutInput input, SwitchConnectionDistinguisher cookie);
/**
- * send port modification message to switch
+ * send port modification message to switch.
*
* @param input
* - message
Future<RpcResult<UpdatePortOutput>> portMod(PortModInput input, SwitchConnectionDistinguisher cookie);
/**
- * send role request message to switch
+ * send role request message to switch.
*
* @param input
* - message
Future<RpcResult<RoleRequestOutput>> roleRequest(RoleRequestInput input, SwitchConnectionDistinguisher cookie);
/**
- * send set async message to switch
+ * send set async message to switch.
*
* @param input
* - message
Future<RpcResult<java.lang.Void>> setAsync(SetAsyncInput input, SwitchConnectionDistinguisher cookie);
/**
- * send set config message to switch
+ * send set config message to switch.
*
* @param input
* - message
Future<RpcResult<java.lang.Void>> setConfig(SetConfigInput input, SwitchConnectionDistinguisher cookie);
/**
- * send table modification message to switch
+ * send table modification message to switch.
*
* @param input
* - message
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
-/**
- * @author mirehak
- */
public interface SessionContext {
/**
- * @return primary connection wrapper
+ * return primary connection wrapper.
*/
ConnectionConductor getPrimaryConductor();
/**
- * @return the features of corresponding switch
+ * return the features of corresponding switch.
*/
GetFeaturesOutput getFeatures();
/**
+ * Auxiliary connections.
* @param auxiliaryKey key under which the auxiliary conductor is stored
* @return list of auxiliary connection wrappers
*/
SwitchConnectionDistinguisher auxiliaryKey);
/**
- * @return entries of all auxiliary connections wrapped in conductors in this session
+ * return entries of all auxiliary connections wrapped in conductors in this session.
*/
Set<Entry<SwitchConnectionDistinguisher, ConnectionConductor>> getAuxiliaryConductors();
/**
- * register new auxiliary connection wrapped in {@link ConnectionConductor}
+ * register new auxiliary connection wrapped in {@link ConnectionConductor}.
*
- * @param auxiliaryKey
- * @param conductor
+ * @param auxiliaryKey key
+ * @param conductor connection conductor
*/
void addAuxiliaryConductor(SwitchConnectionDistinguisher auxiliaryKey,
ConnectionConductor conductor);
/**
- * @param connectionCookie
+ * Remove conductor.
+ * @param connectionCookie cookie
* @return removed connectionConductor
*/
ConnectionConductor removeAuxiliaryConductor(
SwitchConnectionDistinguisher connectionCookie);
/**
- * @return true if this session is valid
+ * return true if this session is valid.
*/
boolean isValid();
/**
+ * Setter.
* @param valid the valid to set
*/
void setValid(boolean valid);
/**
- * @return the sessionKey
+ * return the sessionKey.
*/
SwitchSessionKeyOF getSessionKey();
Boolean getPortBandwidth(Long portNumber);
/**
- * Returns True if the port is enabled,
+ * Returns True if the port is enabled.
*
- * @param portNumber
+ * @param portNumber port number
* @return True if the port is enabled
*/
boolean isPortEnabled(long portNumber);
/**
* Returns True if the port is enabled.
*
- * @param port
+ * @param port port
* @return True if the port is enabled
*/
boolean isPortEnabled(PortGrouping port);
// TODO:: add listeners here, manager will set them and conductor use them
/**
- * get message dispatch service to send the message to switch
+ * get message dispatch service to send the message to switch.
*
* @return the message service
*/
IMessageDispatchService getMessageDispatchService();
/**
- * @return the unique xid for this session
+ * return the unique xid for this session.
+ * @return xid
*/
Long getNextXid();
/**
+ * Setter.
* @param registration provider composite registration
*/
void setProviderRegistration(ModelDrivenSwitchRegistration registration);
/**
- * @return provider composite registration
+ * return provider composite registration.
+ * @return ModelDrivenSwitchRegistration
*/
ModelDrivenSwitchRegistration getProviderRegistration();
/**
- * @return seed value for random operations
+ * return seed value for random operations.
+ * @return int
*/
int getSeed();
/**
- * @return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}
+ * return (wrapped) notification enqueue service - {@link NotificationQueueWrapper}.
+ * @return NotificationEnqueuer
*/
NotificationEnqueuer getNotificationEnqueuer();
/**
- * @param roleOnDevice
+ * Setter.
+ * @param roleOnDevice role
*/
void setRoleOnDevice(ControllerRole roleOnDevice);
/**
- * @return actual role
+ * return actual role.
+ * @return role
*/
ControllerRole getRoleOnDevice();
}
-/**
+/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import java.util.EventListener;
/**
- * listens on session changes
+ * listens on session changes.
*/
public interface SessionListener extends EventListener {
/**
- * fired upon session added
- * @param sessionKey
- * @param context
+ * fired upon session added.
+ * @param sessionKey session key
+ * @param context context
*/
void onSessionAdded(SwitchSessionKeyOF sessionKey, SessionContext context);
/**
- * fired upon session removed
- * @param context
+ * fired upon session removed.
+ * @param context context
*/
void onSessionRemoved(SessionContext context);
+
void setRole(SessionContext context);
}
-/**
+/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
-/**
- * @author mirehak
- */
public interface SessionManager extends AutoCloseable {
/**
- * @param sessionKey
+ * primary connection.
+ * @param sessionKey session key
* @return corresponding conductor, holding {@link ConnectionAdapter} to
- * primary connection
*/
- public SessionContext getSessionContext(SwitchSessionKeyOF sessionKey);
+ SessionContext getSessionContext(SwitchSessionKeyOF sessionKey);
/**
- * disconnect all underlying {@link ConnectionAdapter}s and notify listeners
+ * disconnect all underlying {@link ConnectionAdapter}s and notify listeners.
*
- * @param sessionKey
+ * @param sessionKey session key
*/
- public void invalidateSessionContext(SwitchSessionKeyOF sessionKey);
+ void invalidateSessionContext(SwitchSessionKeyOF sessionKey);
/**
- * register session context
+ * register session context.
*
- * @param sessionKey
- * @param context
+ * @param sessionKey session key
+ * @param context context
*/
- public void addSessionContext(SwitchSessionKeyOF sessionKey, SessionContext context);
- public void setRole(SessionContext context);
+ void addSessionContext(SwitchSessionKeyOF sessionKey, SessionContext context);
+
+ void setRole(SessionContext context);
/**
* disconnect particular auxiliary {@link ConnectionAdapter}, identified by
- * sessionKey and connectionCookie
+ * sessionKey and connectionCookie.
*
- * @param sessionKey
- * @param connectionCookie
+ * @param sessionKey session key
+ * @param connectionCookie cookie
*/
- public void invalidateAuxiliary(SwitchSessionKeyOF sessionKey,
+ void invalidateAuxiliary(SwitchSessionKeyOF sessionKey,
SwitchConnectionDistinguisher connectionCookie);
/**
- * @param connectionConductor
+ * Invalidate on disconnect.
+ * @param connectionConductor connection conductor.
*/
- public void invalidateOnDisconnect(ConnectionConductor connectionConductor);
+ void invalidateOnDisconnect(ConnectionConductor connectionConductor);
/**
- * @param translatorMapping
+ * Setter.
+ * @param translatorMapping translators
*/
- public void setTranslatorMapping(Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> translatorMapping);
+ void setTranslatorMapping(
+ Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> translatorMapping);
/**
+ * Getter.
* @return translator mapping
*/
- public Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> getTranslatorMapping();
+ Map<TranslatorKey, Collection<IMDMessageTranslator<OfHeader, List<DataObject>>>> getTranslatorMapping();
/**
- * @param notificationProviderService
+ * Setter.
+ * @param notificationProviderService notofication provider
*/
- public void setNotificationProviderService(NotificationProviderService notificationProviderService);
+ void setNotificationProviderService(NotificationProviderService notificationProviderService);
/**
+ * Getter.
* @return notificationServiceProvider
*/
- public DataBroker getDataBroker();
+ DataBroker getDataBroker();
/**
- * @param dataBroker
+ * Setter.
+ * @param dataBroker databroker
*/
- public void setDataBroker(DataBroker dataBroker);
+ void setDataBroker(DataBroker dataBroker);
/**
+ * Gatter.
* @return notificationServiceProvider
*/
- public NotificationProviderService getNotificationProviderService();
+ NotificationProviderService getNotificationProviderService();
/**
- * @param listener
+ * Session listener registration.
+ * @param listener listener
* @return registration
*/
- public ListenerRegistration<SessionListener> registerSessionListener(SessionListener listener);
+ ListenerRegistration<SessionListener> registerSessionListener(SessionListener listener);
/**
+ * Getter.
* @return popListener mapping, key=message type; value=collection of listeners
*/
- public Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> getPopListenerMapping();
+ Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> getPopListenerMapping();
/**
+ * Setter.
* @param popListenerMapping the popListenerMapping to set
*/
- void setPopListenerMapping(Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> popListenerMapping);
+ void setPopListenerMapping(
+ Map<Class<? extends DataObject>, Collection<PopListener<DataObject>>> popListenerMapping);
/**
- * @param rpcPoolDelegator
+ * Setter.
+ * @param rpcPoolDelegator rpc pool delegator
*/
void setRpcPool(ListeningExecutorService rpcPoolDelegator);
/**
+ * Getter.
* @return the rpcPool instance
*/
ListeningExecutorService getRpcPool();
/**
- * @param messageSpy
+ * Setter.
+ * @param messageSpy message spy
*/
void setMessageSpy(MessageSpy<DataContainer> messageSpy);
/**
+ * Getter.
* @return the messageSpy
*/
MessageSpy<DataContainer> getMessageSpy();
/**
+ * Getter.
* @return collection of current sessions
*/
Collection<SessionContext> getAllSessions();
import java.math.BigInteger;
-/**
- * @author mirehak
- */
public class SwitchSessionKeyOF {
private BigInteger datapathId;
/**
- * default ctor
+ * default ctor.
*/
public SwitchSessionKeyOF() {
// NOOP
}
-
+
/**
+ * Setter.
* @param datapathId the datapathId to set
*/
public void setDatapathId(BigInteger datapathId) {
this.datapathId = datapathId;
}
-
+
/**
+ * Getter.
* @return the datapathId
*/
public byte[] getId() {
private HandshakeManager createHandshakeManager(final ConnectionAdapter connectionAdapter,
final HandshakeListener handshakeListener) {
HandshakeManagerImpl handshakeManager = new HandshakeManagerImpl(connectionAdapter,
- ConnectionConductor.versionOrder.get(0),
- ConnectionConductor.versionOrder);
+ ConnectionConductor.VERSION_ORDER.get(0),
+ ConnectionConductor.VERSION_ORDER);
handshakeManager.setUseVersionBitmap(BITMAP_NEGOTIATION_ENABLED);
handshakeManager.setHandshakeListener(handshakeListener);
handshakeManager.setErrorHandler(new ErrorHandlerSimpleImpl());
conductorState = CONDUCTOR_STATE.HANDSHAKING;
firstHelloProcessed = false;
handshakeManager = new HandshakeManagerImpl(connectionAdapter,
- ConnectionConductor.versionOrder.get(0),
- ConnectionConductor.versionOrder);
+ ConnectionConductor.VERSION_ORDER.get(0),
+ ConnectionConductor.VERSION_ORDER);
handshakeManager.setUseVersionBitmap(isBitmapNegotiationEnable);
handshakeManager.setHandshakeListener(this);
portFeaturesUtils = PortFeaturesUtil.getInstance();
for(Elements element : list) {
List<Boolean> bitmap = element.getVersionBitmap();
// check for version bitmap
- for(short bitPos : ConnectionConductor.versionOrder) {
+ for(short bitPos : ConnectionConductor.VERSION_ORDER) {
// with all the version it should work.
if(bitmap.get(bitPos % Integer.SIZE)) {
supportedHighestVersion = bitPos;
@Before
public void setUp() {
handshakeManager = new HandshakeManagerImpl(adapter, OFConstants.OFP_VERSION_1_3,
- ConnectionConductor.versionOrder);
+ ConnectionConductor.VERSION_ORDER);
handshakeManager.setErrorHandler(errorHandler);
handshakeManager.setHandshakeListener(handshakeListener);
handshakeManager.setUseVersionBitmap(false);
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.hello.Elements;
-/**
- * @author mirehak
- *
- */
public class MessageFactoryTest {
- /**
- * Test method for {@link org.opendaylight.openflowplugin.openflow.md.core.MessageFactory#createHelloInputWoElements(java.lang.Short, java.lang.Long)}.
- */
@Test
public void testCreateHelloInputWoElements() {
short highestVersion = (short) 0x04;
Assert.assertNull(helloMsg.getElements());
}
- /**
- * Test method for {@link org.opendaylight.openflowplugin.openflow.md.core.MessageFactory#createHelloInputWithElements(java.lang.Short, java.lang.Long, java.util.List)}.
- */
@Test
public void testCreateHelloInputWithElements() {
short highestVersion = (short) 0x04;
false, true, false, false, true};
HelloInput helloMsg = MessageFactory.createHelloInput(highestVersion, xid,
- ConnectionConductor.versionOrder);
+ ConnectionConductor.VERSION_ORDER);
Assert.assertEquals(highestVersion, helloMsg.getVersion().shortValue());
Assert.assertEquals(xid, helloMsg.getXid().longValue());
Assert.assertEquals(1, helloMsg.getElements().size());