本文整理汇总了Java中es.tid.pce.pcep.messages.PCEPClose类的典型用法代码示例。如果您正苦于以下问题:Java PCEPClose类的具体用法?Java PCEPClose怎么用?Java PCEPClose使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PCEPClose类属于es.tid.pce.pcep.messages包,在下文中一共展示了PCEPClose类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testClose
import es.tid.pce.pcep.messages.PCEPClose; //导入依赖的package包/类
@org.junit.Test
public void testClose(){
System.out.println("Testing Close Message");
//Create message
PCEPClose message = new PCEPClose();
int[] reasons={0,4,Close.reason_MAX_VALUE};
for (int i =0; i< reasons.length;++i){
message.setReason(reasons[i]);
System.out.println("PCEP Close test with reason "+reasons[i]);
testPCEPMessage(message,PCEPClose.class,"PCEP Close test with reason "+reasons[i] );
}
//loopFields(message);
}
示例2: close
import es.tid.pce.pcep.messages.PCEPClose; //导入依赖的package包/类
/**
* <p>Close the PCE session</p>
* <p>List of reasons (RFC 5440):</p>
* Value Meaning
1 No explanation provided
2 DeadTimer expired
3 Reception of a malformed PCEP message
4 Reception of an unacceptable number of unknown
requests/replies
5 Reception of an unacceptable number of unrecognized
PCEP messages
* @param reason Reason for closing the PCEP Session
*/
//* @return PCEP Session closed OK
public void close(int reason){
log.info("Closing PCEP Session with "+this.remotePeerIP);
PCEPClose p_close=new PCEPClose();
p_close.setReason(reason);
sendPCEPMessage(p_close);
killSession();
}