protected static String createCounterName(String switchID,int portID,String counterName,String subCategory,NetworkLayer layer){
  String fullCounterName="";
  String groupCounterName="";
  if (portID < 0) {
    groupCounterName=switchID + TitleDelimitor + counterName;
    fullCounterName=groupCounterName + TitleDelimitor + subCategory;
  }
 else {
    groupCounterName=switchID + TitleDelimitor + portID+ TitleDelimitor+ counterName;
    fullCounterName=groupCounterName + TitleDelimitor + subCategory;
  }
  Map<String,List<String>> counterToCategories;
  if (layeredCategories.containsKey(layer)) {
    counterToCategories=layeredCategories.get(layer);
  }
 else {
    counterToCategories=new ConcurrentHashMap<String,List<String>>();
    layeredCategories.put(layer,counterToCategories);
  }
  List<String> categories;
  if (counterToCategories.containsKey(groupCounterName)) {
    categories=counterToCategories.get(groupCounterName);
  }
 else {
    categories=new ArrayList<String>();
    counterToCategories.put(groupCounterName,categories);
  }
  if (!categories.contains(subCategory)) {
    categories.add(subCategory);
  }
  return fullCounterName;
}

protected static String createCounterName ( String switchID , int portID , String counterName , String subCategory , NetworkLayer layer ) { String fullCounterName = "" ; String groupCounterName = "" ; if ( portID < 0 ) { groupCounterName = switchID + TitleDelimitor + counterName ; fullCounterName = groupCounterName + TitleDelimitor + subCategory ; } else { groupCounterName = switchID + TitleDelimitor + portID + TitleDelimitor + counterName ; fullCounterName = groupCounterName + TitleDelimitor + subCategory ; } Map < String , List < String > > counterToCategories ; if ( layeredCategories . containsKey ( layer ) ) { counterToCategories = layeredCategories . get ( layer ) ; } else { counterToCategories = new ConcurrentHashMap < String , List < String > > ( ) ; layeredCategories . put ( layer , counterToCategories ) ; } List < String > categories ; if ( counterToCategories . containsKey ( groupCounterName ) ) { categories = counterToCategories . get ( groupCounterName ) ; } else { categories = new ArrayList < String > ( ) ; counterToCategories . put ( groupCounterName , categories ) ; } if ( ! categories . contains ( subCategory ) ) { categories . add ( subCategory ) ; } return fullCounterName ; }
create a title based on switch id , portid , vlanid , countername , and subcategory if portid is - 1 , the title represents the given switch only if portid is a non - negative number , the title represents the port on the given switch for example : packetins can be further categorized based on l2 ethertype or l3 protocol
