This fixes various javadoc inconsistencies reported by JDK8.
Change-Id: Ic41c2d16e8191885266b6b8f440fe17eb5ec159c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Ladislav Borak <lborak@cisco.com>
/**
* Serializes Flowspec NLRI to ByteBuf.
*
- * @param flow flowspec NLRI to be serialized
+ * @param flows flowspec NLRI to be serialized
+ * @param buffer where flowspec NLRI will be serialized
*/
public static void serializeNlri(final List<Flowspec> flows, final ByteBuf buffer) {
final ByteBuf nlriByteBuf = Unpooled.buffer();
.setDestinationFlowspec(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150114.update.path.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.flowspec._case.DestinationFlowspecBuilder().setFlowspec(dst).build()).build()).build());
}
+ /**
+ * Parses Flowspec NLRI into list of Flowspec.
+ *
+ * @param nlri byte representation of NLRI which will be parsed
+ * @return list of Flowspec
+ */
public static List<Flowspec> parseNlri(final ByteBuf nlri) throws BGPParsingException {
if (!nlri.isReadable()) {
return null;
package org.opendaylight.protocol.bgp.linkstate.nlri;
import com.google.common.base.Preconditions;
-
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
-
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
-
import org.opendaylight.protocol.bgp.linkstate.spi.TlvUtil;
import org.opendaylight.protocol.bgp.parser.BGPParsingException;
import org.opendaylight.protocol.bgp.parser.spi.NlriParser;
* Parses common parts for Link State Nodes, Links and Prefixes, that includes protocol ID and identifier tlv.
*
* @param nlri as byte array
+ * @param isVpn flag which determines that destination has route distinguisher
* @return {@link CLinkstateDestination}
* @throws BGPParsingException if parsing was unsuccessful
*/
* Serializes Linkstate NLRI to byte array. We need this as NLRI serves as a key in upper layers.
*
* @param destination Linkstate NLRI to be serialized
+ * @param buffer where Linkstate NLRI will be serialized
*/
public static void serializeNlri(final CLinkstateDestination destination, final ByteBuf buffer) {
final ByteBuf nlriByteBuf = Unpooled.buffer();
private static final long serialVersionUID = 1L;
/**
+ * Creates new BGPParsingException with specific error message.
*
* @param err error message string.
*/
}
/**
+ * Creates new BGPParsingException with specific message and cause.
*
* @param message exception message
* @param cause primary exception
* Serializes BGP Notification message.
*
* @param msg to be serialized
- * @param ByteBuf where the message will be serialized
+ * @param bytes ByteBuf where the message will be serialized
*/
@Override
public void serializeMessage(final Notification msg, final ByteBuf bytes) {
* Parses BGP Notification message to bytes.
*
* @param body ByteBuf to be parsed
- * @return BGPNotification message
+ * @param messageLength the length of the message
+ * @return {@link Notify} which represents BGP notification message
* @throws BGPDocumentedException if parsing goes wrong
*/
@Override
* Parses given byte array to BGP Open message
*
* @param body byte array representing BGP Open message, without header
- * @return BGP Open Message
+ * @param messageLength the length of the message
+ * @return {@link Open} BGP Open Message
* @throws BGPDocumentedException if the parsing was unsuccessful
*/
@Override
}
/**
- * Parse AGGREGATOR from bytes
+ * Parse {@link Aggregator} from bytes
*
* @param buffer byte buffer to be parsed
- * @return {@link Aggregator} BGP Aggregator
+ * @param builder PathAttributesBuilder into which parsed {@link Aggregator} will be set
*/
@Override
public void parseAttribute(final ByteBuf buffer, final PathAttributesBuilder builder) {
/**
* Reads data from buffer until reaches TLV of type AIGP TLV.
*
- * @param buffer
- * TLVs in ByteBuf format
- * @return
- * instance of AigpTlv class or null if buffer contains unknown TLV type
+ * @param buffer TLVs in ByteBuf format
+ * @return instance of AigpTlv class or null if buffer contains unknown TLV type
*/
private static AigpTlv parseAigpTLV(final ByteBuf buffer) {
final int tlvType = buffer.readByte();
/**
* Parses AS_PATH from bytes.
*
- * @param buffer bytes to be parsed @return new ASPath object
+ * @param refCache ReferenceCache shared reference of object
+ * @param buffer bytes to be parsed
+ * @return new ASPath object
* @throws BGPDocumentedException if there is no AS_SEQUENCE present (mandatory)
* @throws BGPParsingException
*/
* Parse known Community, if unknown, a new one will be created.
*
* @param refCache
- *
- * @param bytes byte array to be parsed
+ * @param buffer byte array to be parsed
* @return new Community
* @throws BGPDocumentedException
*/
package org.opendaylight.protocol.bgp.parser.impl.message.update;
import com.google.common.base.Preconditions;
-
import org.opendaylight.protocol.util.NoopReferenceCache;
import org.opendaylight.protocol.util.ReferenceCache;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
* Creates a new Community given AS number value and semantics using generated CommunitiesBuilder.
*
* @param asn long
- * @param semantics long
+ * @param semantics int
* @return new Community
*/
public Community create(final long asn, final int semantics) {
*
* @param refCache reference cache to use
* @param asn long
- * @param semantics long
+ * @param semantics int
* @return new Community
*/
public static Community create(final ReferenceCache refCache, final long asn, final int semantics) {
/**
* Parse Extended Community according to their type.
*
- * @param bytes byte array to be parsed
+ * @param refCache
+ * @param comm ExtendedCommunitiesBuilder based on which community type will be new ExtendedCommunity created
+ * @param buffer byte array to be parsed
* @return new Specific Extended Community
* @throws BGPDocumentedException if the type is not recognized
*/
package org.opendaylight.protocol.bgp.parser.mock;
import io.netty.buffer.ByteBuf;
-
import java.util.Map;
-
import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
import org.opendaylight.protocol.bgp.parser.BGPParsingException;
import org.opendaylight.protocol.bgp.parser.spi.MessageRegistry;
private final Map<ByteBuf, Notification> messages;
/**
- * @param updateMessages Map<byte[], BGPUpdateEvent>
+ * Creates a new BGPMessageParserMock with given messages.
+ *
+ * @param messages represents a new map of ByteBuf and Notification
*/
public BGPMessageParserMock(final Map<ByteBuf, Notification> messages) {
this.messages = messages;
package org.opendaylight.protocol.bgp.parser.spi;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
import org.opendaylight.protocol.bgp.parser.BGPParsingException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.update.PathAttributesBuilder;
*/
public interface AttributeParser {
/**
+ * Parses attribute from ByteBuf buffer
+ *
* @param buffer encoded attribute body in Bytebuf
* @param builder Path attributes builder. Guaranteed to contain all valid attributes whose type is numerically
* lower than this attribute's type.
* Adds header to attribute value. If the length of the attribute value exceeds one-byte length field,
* set EXTENDED bit and write length as 2B field.
*
+ * @param flags
* @param type of the attribute
* @param value attribute value
* @param buffer ByteBuf where the attribute will be copied with its header
/**
* Adds header to capability value.
*
- * @param type of the capability
+ * @param code type of the capability
* @param value capability value
* @param buffer ByteBuf where the capability will be copied with its header
*/
* Adds header to message value.
*
* @param type of the message
- * @param value message value
+ * @param body message body
* @param buffer ByteBuf where the message will be copied with its header
*/
public static void formatMessage(final int type, final ByteBuf body, final ByteBuf buffer) {
import io.netty.buffer.ByteBuf;
+/**
+ * Utility class which is intended for formatting parameter.
+ */
public final class ParameterUtil {
private ParameterUtil() {
import org.slf4j.LoggerFactory;
/**
- * Bgp Session negotiator. Common for local -> remote and remote -> local connections.
+ * Bgp Session negotiator. Common for local-to-remote and remote-to-local connections.
* One difference is session validation performed by injected BGPSessionValidator when OPEN message is received.
*/
public abstract class AbstractBGPSessionNegotiator extends AbstractSessionNegotiator<Notification, BGPSessionImpl> {
/**
* For each received Update message, the upd sync variable needs to be updated to true, for particular AFI/SAFI
* combination. Currently we only assume Unicast SAFI. From the Update message we have to extract the AFI. Each
- * Update message can contain BGP Object with one type of AFI. If the object is BGP Link, BGP Node or BGPPrefix<?>
+ * Update message can contain BGP Object with one type of AFI. If the object is BGP Link, BGP Node or a BGPPrefix
* the AFI is Linkstate. In case of BGPRoute, the AFI depends on the IP Address of the prefix.
*
* @param msg received Update message
}
/**
- * Create IpAddress from SocketAddress. Only InetSocketAddress is accepted with inner address: Inet4Address and Inet6Address.
+ * Creates IpAddress from SocketAddress. Only InetSocketAddress is accepted with inner address: Inet4Address and Inet6Address.
*
- * @throws IllegalArgumentException if submitted socket address is not InetSocketAddress[ipv4 | ipv6]
* @param socketAddress socket address to transform
+ * @throws IllegalArgumentException if submitted socket address is not InetSocketAddress[ipv4 | ipv6]
*/
public static IpAddress getIpAddress(final SocketAddress socketAddress) {
Preconditions.checkNotNull(socketAddress);
package org.opendaylight.protocol.bgp.rib.impl.spi;
import io.netty.util.concurrent.Future;
-
import java.net.InetSocketAddress;
-
import org.opendaylight.protocol.bgp.rib.spi.BGPSession;
import org.opendaylight.protocol.framework.ReconnectStrategy;
import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
* Creates BGP client.
*
* @param address Peer address
+ * @param remoteAS remote AS
* @param peerRegistry BGP peer registry
+ * @param strategy reconnection strategy
* @return Future promising a client session
*/
Future<? extends BGPSession> createClient(InetSocketAddress address, AsNumber remoteAs,
* @param ip address of remote peer
* @param sourceId BGP ID of peer that initiated the session (current device or remote peer)
* @param remoteId BGP ID of peer that accepted the session (current device or remote peer)
+ * @param asNumber id of the AS
* @return configured Peer as BGP listener
*
* @throws BGPDocumentedException if session establishment cannot be finished successfully
package org.opendaylight.protocol.bgp.rib.impl.spi;
import java.util.List;
-
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.open.BgpParameters;
* @param as local AS number
* @param hold preferred hold timer value, in seconds
* @param bgpId local BGP Identifier
- * @param param advertized parameters
+ * @param params list of advertised parameters
*/
public BGPSessionPreferences(final AsNumber as, final int hold, final Ipv4Address bgpId, final List<BgpParameters> params) {
this.as = as;
return this.bgpId;
}
+ /**
+ * Gets a list of advertised bgp parameters.
+ *
+ * @return a list of advertised bgp parameters
+ */
public List<BgpParameters> getParams() {
return this.params;
}
/**
* Returns BGPSessionPreferences for this IP address.
*
- * @param address serves as constraint, the implementation can also take time into consideration
* @return BGPSessionPreferences with acceptable session characteristics
*/
BGPSessionPreferences getProposal();
public abstract I keyForIdentifier(KeyedInstanceIdentifier<D, K> id);
/**
- * Common backend for {@link AdjRIBsIn#addRoutes()} implementations.
+ * Common backend for {@link AdjRIBsIn#addRoutes(AdjRIBsTransaction, Peer, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.update.path.attributes.MpReachNlri, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.update.PathAttributes)} implementations.
* If a new route is added, check first for its existence in Map of entries.
* If the route is already there, change it's state. Then check for peer in
* Map of peers, if it's not there, add it.
}
/**
- * Common backend for {@link AdjRIBsIn#removeRoutes()} implementations.
+ * Common backend for {@link AdjRIBsIn#removeRoutes(AdjRIBsTransaction, Peer, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.update.path.attributes.MpUnreachNlri)} implementations.
*
* @param trans Transaction context
* @param peer Originating peer
/**
* This comparator is intended to implement BGP Best Path Selection algorithm, as described at
- *
- * @see http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml
- *
- * @param <T> Actual object state reference
+ * <a href="http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml">here</a>
*/
public final class BGPObjectComparator implements Comparator<RIBEntryData<?, ?, ?>>, Serializable {
*
* @param comparator
* @param initial
- * @return
+ * @return candidate for founded initial route
*/
private RIBEntryData<I, D, K> findCandidate(final BGPObjectComparator comparator, final RIBEntryData<I, D, K> initial) {
RIBEntryData<I, D, K> newState = initial;
* modifications propagated. The transaction is not shared with any other entity and will be cleaned up by
* the caller if it is not committed before this method returns.
* @param event Data change event
- * @param depth Subscription path depth.
*/
void onLocRIBChange(ReadWriteTransaction trans, AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> event);
}
/**
* Read text file, parse BGP messages. File can contain comments or other data. BGP messages are detected using 16 ff
- * marker. New lines and spaces are ignored. Use {@link ByteArray#bytesToHexString(byte[])} for serializing bytes to
- * this format.
+ * marker. New lines and spaces are ignored.
*/
@Immutable
public final class HexDumpBGPFileParser {
}
/**
- * @return integer value
+ * Gets value of termination reason.
+ *
+ * @return short value
*/
public short getShortValue() {
return this.value;
}
/**
+ * Gets termination reason for specific short value.
+ *
* @param valueArg
* @return corresponding TerminationReason item
*/
* Create the protocol session.
*
* @param channel Underlying channel.
- * @param sessionId Assigned session ID.
* @param localPrefs Session preferences proposed by us and accepted by the peer.
* @param remotePrefs Session preferences proposed by the peer and accepted by us.
* @return New protocol session.
* Create a new negotiator. This method needs to be implemented by subclasses to actually provide a negotiator.
*
* @param promise Session promise to be completed by the negotiator
+ * @param listener PCEPSessionListener
* @param channel Associated channel
* @param sessionId Session ID assigned to the resulting session
* @return a PCEP session negotiator
/**
* Finds parser for given subobject type in the registry. Delegates parsing to found parser.
*
- * @param type subobject type, key in parser registry
+ * @param subobjectType subobject type, key in parser registry
* @param buffer subobject wrapped in ByteBuf
* @param loose ERO specific common field
* @return null if the parser for this subobject could not be found
/**
* Finds parser for given message type in the registry. Delegates parsing to found parser.
*
- * @param type message type, key in parser registry
+ * @param messageType message type, key in parser registry
* @param buffer message wrapped in ByteBuf
* @param errors list of error messages, that is filled during parsing
* @return null if the parser for this message could not be found
package org.opendaylight.protocol.pcep.spi;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
/**
* Finds parser for given object type and class in the registry. Delegates parsing to found parser.
*
- * @param objectType object type
* @param objectClass object class
+ * @param objectType object type
+ * @param header ObjectHeader
* @param buffer object wrapped in ByteBuf
* @return null if the parser for this object could not be found
* @throws PCEPDeserializerException if the parsing did not succeed
/**
* Serializes given object to bytes wrapped in given ByteBuf.
- * @param message PCEP object to be serialized
+ * @param object PCEP object to be serialized
* @param buffer ByteBuf wrapper around serialized object
*/
void serializeObject(final Object object, final ByteBuf buffer);
package org.opendaylight.protocol.pcep.spi;
import io.netty.buffer.ByteBuf;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.rro.Subobject;
public interface RROSubobjectRegistry {
*
* @param type subobject type, key in parser registry
* @param buffer subobject wrapped in ByteBuf
- * @return null if the parser for this subobject could not be found
+ * @return null if the parser for this subobject could not be found otherwise returns parser
* @throws PCEPDeserializerException if the parsing did not succeed
*/
Subobject parseSubobject(final int type, final ByteBuf buffer) throws PCEPDeserializerException;
private final AtomicLong requestId = new AtomicLong(1L);
/**
+ * Creates a new stateful topology session listener for given server session manager.
+ *
* @param serverSessionManager
*/
Stateful07TopologySessionListener(final ServerSessionManager serverSessionManager) {
* Cuts 'count' number of bytes from the beginning of given byte array.
*
* @param bytes array to be cut, cannot be null
- * @param count how many bytes needed to be cut, needs to be > 0
+ * @param count how many bytes needed to be cut, needs to be greater than 0
* @return bytes array without first 'count' bytes
*/
public static byte[] cutBytes(final byte[] bytes, final int count) {
}
/**
- * Copies range of bits from passed byte and align to right.<br/>
+ * Copies range of bits from passed byte and align to right.<br>
*
* @param src source byte to copy from
* @param fromBit bit from which will copy (inclusive) - numbered from 0
- * @param length of bits to by copied - <1,8>
+ * @param length of bits to by copied, valid values are 1 through 8
* @return copied value aligned to right
*/
public static byte copyBitsRange(final byte src, final int fromBit, final int length) {
* Creates a list of Ipv4 Prefixes from given byte array.
*
* @param bytes to be converted to List of Ipv4Prefixes.
- * @return List<Ipv4Prefix>
+ * @return A list of Ipv4Prefixes
*/
public static List<Ipv4Prefix> prefixListForBytes(final byte[] bytes) {
if (bytes.length == 0) {
* Creates a list of Ipv6 Prefixes from given byte array.
*
* @param bytes to be converted to List of Ipv6Prefixes.
- * @return List<Ipv6Prefix>
+ * @return A List of Ipv6Prefixes
*/
public static List<Ipv6Prefix> prefixListForBytes(final byte[] bytes) {
if (bytes.length == 0) {
}
/**
- * Get current time in seconds.
+ * Get current time in seconds. See also {@link System#currentTimeMillis()}.
*
* @return the difference, measured in seconds, between the current time and midnight, January 1, 1970 UTC.
- * @see System.currentTimeMillis()
*/
public static long getCurrentTimestampInSeconds() {
return TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());