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
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() {