Java 类net.floodlightcontroller.core.OFMessageFilterManager 实例源码

项目:Multipath-Hedera-system-in-Floodlight-controller    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:smartenit    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:floodlight-qosmanager    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:floodlight-nfv    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:HederaInFloodlight    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:floodlight-oss    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:my-floodlight    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:FL_HAND    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}
项目:sdn-project    文件:PacketTraceResource.java   
@Post("json")
public PacketTraceOutput packettrace(FilterParameters fp) {

    ConcurrentHashMap <String,String> filter = new ConcurrentHashMap<String,String> ();
    String sid = null;
    PacketTraceOutput output = new PacketTraceOutput();
    OFMessageFilterManager manager = 
            (OFMessageFilterManager)getContext()
                .getAttributes().
                    get(OFMessageFilterManager.class.getCanonicalName());

    if (manager == null) {
        sid = null;
        setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
    }

    if (fp.getSessionId() != null) {
        filter.put("sessionId", fp.getSessionId());
    }
    if (fp.getMac() != null) {
        filter.put("mac", fp.getMac());
    }
    if (fp.getDirection() != null) {
        filter.put("direction", fp.getDirection());
    }

    if (filter.isEmpty()) {
        setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
    } else {
        if (log.isDebugEnabled()) {
            log.debug ("Call setupFilter: sid:{} filter:{}, period:{}", 
                       new Object[] {fp.getSessionId(), filter, 
                                     fp.getPeriod()*1000});
        }
        sid = manager.setupFilter(fp.getSessionId(), filter, 
                                  fp.getPeriod()*1000);
        output.setSessionId(sid);
        setStatus(Status.SUCCESS_OK);
    }

    return output;
}