Added getters for remote address and remote PCEPTlvs in order for session listener to access this information.
+ Fixed bundle configuration issues for pcep-impl
Change-Id: Ibc59378de7b99912d4e3d5e54881e59e84514146
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
*/
package org.opendaylight.protocol.pcep;
*/
package org.opendaylight.protocol.pcep;
+import java.net.InetAddress;
+
import org.opendaylight.protocol.framework.ProtocolSession;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
import org.opendaylight.protocol.framework.ProtocolSession;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Tlvs;
/**
* PCEP Session represents the finite state machine in PCEP, including timers and its purpose is to create a PCEP
/**
* PCEP Session represents the finite state machine in PCEP, including timers and its purpose is to create a PCEP
* Sends message from user to PCE/PCC. If the user sends an Open Message, the session returns an error (open message
* is only allowed, when a PCEP handshake is in progress). Close message will close the session and free all the
* resources.
* Sends message from user to PCE/PCC. If the user sends an Open Message, the session returns an error (open message
* is only allowed, when a PCEP handshake is in progress). Close message will close the session and free all the
* resources.
* @param message message to be sent
*/
public void sendMessage(Message message);
public void close(TerminationReason reason);
* @param message message to be sent
*/
public void sendMessage(Message message);
public void close(TerminationReason reason);
+
+ public Tlvs getRemoteTlvs();
+
+ public InetAddress getRemoteAddress();
import io.netty.util.TimerTask;
import java.io.IOException;
import io.netty.util.TimerTask;
import java.io.IOException;
+import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.Date;
import java.util.LinkedList;
import java.net.InetSocketAddress;
import java.util.Date;
import java.util.LinkedList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.message.CCloseMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.message.c.close.message.CCloseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.message.CCloseMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.message.c.close.message.CCloseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.Tlvs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Sends message to serialization.
/**
* Sends message to serialization.
* @param msg to be sent
*/
@Override
* @param msg to be sent
*/
@Override
+ @Override
+ public Tlvs getRemoteTlvs() {
+ return remoteOpen.getTlvs();
+ }
+
+ @Override
+ public InetAddress getRemoteAddress() {
+ return ((InetSocketAddress) this.channel.remoteAddress()).getAddress();
+ }
+
private synchronized void terminate(final TerminationReason reason) {
this.listener.onSessionTerminated(this, new PCEPCloseTermination(reason));
this.closed = true;
private synchronized void terminate(final TerminationReason reason) {
this.listener.onSessionTerminated(this, new PCEPCloseTermination(reason));
this.closed = true;
/**
* Sends PCEP Error Message with one PCEPError and Open Object.
/**
* Sends PCEP Error Message with one PCEPError and Open Object.
* @param value
* @param open
*/
* @param value
* @param open
*/
* sent (CAPABILITY_NOT_SUPPORTED) and the method checks if the MAX_UNKNOWN_MSG per minute wasn't overstepped.
* Second, any other error occurred that is specified by rfc. In this case, the an error message is generated and
* sent.
* sent (CAPABILITY_NOT_SUPPORTED) and the method checks if the MAX_UNKNOWN_MSG per minute wasn't overstepped.
* Second, any other error occurred that is specified by rfc. In this case, the an error message is generated and
* sent.
* @param error documented error in RFC5440 or draft
*/
@VisibleForTesting
* @param error documented error in RFC5440 or draft
*/
@VisibleForTesting
/**
* Handles incoming message. If the session is up, it notifies the user. The user is notified about every message
* except KeepAlive.
/**
* Handles incoming message. If the session is up, it notifies the user. The user is notified about every message
* except KeepAlive.
* @param msg incoming message
*/
@Override
* @param msg incoming message
*/
@Override
@Override
public String getNodeIdentifier() {
@Override
public String getNodeIdentifier() {
- if (this.remoteOpen.getTlvs() == null)
+ if (this.remoteOpen.getTlvs() == null) {
if (this.remoteOpen.getTlvs().getPredundancyGroupId() != null) {
return new String(this.remoteOpen.getTlvs().getPredundancyGroupId().getIdentifier());
}
if (this.remoteOpen.getTlvs().getPredundancyGroupId() != null) {
return new String(this.remoteOpen.getTlvs().getPredundancyGroupId().getIdentifier());
}