mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-03 16:16:14 +08:00
update logicface: registerIdentifier
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package logicface;
|
||||
|
||||
import component.Identifier;
|
||||
import mgmt.MgmtException;
|
||||
import security.KeyChain;
|
||||
|
||||
/*
|
||||
@@ -12,5 +13,5 @@ import security.KeyChain;
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public interface IRegisterPrefixHelper {
|
||||
boolean registerPrefix(Identifier identifier, LogicFace face, KeyChain keyChain);
|
||||
boolean registerPrefix(Identifier identifier, LogicFace face, KeyChain keyChain) throws MgmtException;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import encoding.TLV;
|
||||
import encoding.VlIntException;
|
||||
import jnr.unixsocket.UnixSocketAddress;
|
||||
import jnr.unixsocket.UnixSocketChannel;
|
||||
import mgmt.MgmtException;
|
||||
import packet.*;
|
||||
import security.KeyChain;
|
||||
|
||||
@@ -165,7 +166,11 @@ public class LogicFace {
|
||||
* @return
|
||||
*/
|
||||
public boolean registerIdentifier(Identifier identifier,long timeout,IRegisterPrefixHelper helper) throws LogicFaceException {
|
||||
try {
|
||||
return helper.registerPrefix(identifier,this,this.keyChain);
|
||||
} catch (MgmtException e) {
|
||||
throw new LogicFaceException("LogicFace.registerIdentifier: "+e.getMessage());
|
||||
}
|
||||
// try {
|
||||
// Interest interest=MgmtCommand.createRegisterIdentifierInterest(identifier);
|
||||
// if(interest==null){
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mgmt;
|
||||
|
||||
import component.Identifier;
|
||||
import logicface.IRegisterPrefixHelper;
|
||||
import logicface.LogicFace;
|
||||
import mgmt.FibCommands.RegisterPrefixCommand;
|
||||
import security.KeyChain;
|
||||
@@ -14,7 +15,7 @@ import security.KeyChain;
|
||||
* @Date: 19:17 2021/4/27
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public class RegisterPrefixHelper {
|
||||
public class RegisterPrefixHelper implements IRegisterPrefixHelper {
|
||||
/**
|
||||
* 注册前缀
|
||||
* @param identifier
|
||||
@@ -22,6 +23,7 @@ public class RegisterPrefixHelper {
|
||||
* @param keyChain
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean registerPrefix(Identifier identifier, LogicFace face, KeyChain keyChain) throws MgmtException {
|
||||
try {
|
||||
MIRController controller = MIRController.createMIRController(new LogicFaceBuilderInterface() {
|
||||
|
||||
Reference in New Issue
Block a user