import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ReadService implements IReadService, CommandProvider, IPluginOutReadService {
protected static final Logger logger = LoggerFactory.getLogger(ReadService.class);
- private ConcurrentHashMap<String, IPluginInReadService> pluginReader;
- private Set<IReadServiceListener> readerListeners;
+ private ConcurrentHashMap<String, IPluginInReadService> pluginReader =
+ new ConcurrentHashMap<String, IPluginInReadService>();
+ private Set<IReadServiceListener> readerListeners =
+ new CopyOnWriteArraySet<IReadServiceListener>();
/**
* Function called by the dependency manager when all the required
*
*/
void init() {
- pluginReader = new ConcurrentHashMap<String, IPluginInReadService>();
- readerListeners = new CopyOnWriteArraySet<IReadServiceListener>();
}
/**
// In case of plugin disactivating make sure we clear the
// dependencies
this.pluginReader.clear();
+ this.readerListeners.clear();
}
/**
}
}
logger.warn("Plugin {} unavailable", node.getType());
- return null;
+ return Collections.emptyList();
}
@Override
}
}
logger.warn("Plugin {} unavailable", node.getType());
- return null;
+ return Collections.emptyList();
}
@Override
}
}
logger.warn("Plugin {} unavailable", node.getType());
- return null;
+ return Collections.emptyList();
}
@Override
}
}
logger.warn("Plugin {} unavailable", node.getType());
- return null;
+ return Collections.emptyList();
}
}
}
logger.warn("Plugin {} unavailable", node.getType());
- return null;
+ return Collections.emptyList();
}
@Override
public String getHelp() {
StringBuffer help = new StringBuffer();
help.append("---SAL Reader testing commands---\n");
- help
- .append("\t readflows <sid> <cached> - Read all the (cached) flows from the openflow switch <sid>\n");
- help
- .append("\t readflow <sid> <cached> - Read the (cached) sample flow from the openflow switch <sid>\n");
- help
- .append("\t readdesc <sid> <cached> - Read the (cached) description from openflow switch <sid>\n");
- help
- .append("\t cached=true/false. If false or not specified, the protocol plugin cached info\n");
- help
- .append("\t is returned. If true, the info is directly retrieved from the switch\n");
+ help.append("\t readflows <sid> <cached> - Read all the (cached) flows from the openflow switch <sid>\n");
+ help.append("\t readflow <sid> <cached> - Read the (cached) sample flow from the openflow switch <sid>\n");
+ help.append("\t readdescr <sid> <cached> - Read the (cached) description from openflow switch <sid>\n");
+ help.append("\t\t cached = (true|false). If false or not specified, the plugin cached info\n");
+ help.append("\t\t is returned. If true, the info is directly retrieved from the switch\n");
+ help.append("\t readport <sid> <port> - Read port statistics for the specified port\n");
+ help.append("\t readports <sid> - Read port statistics for all ports of specified switch\n");
+ help.append("\t readtable <sid> <tableid>- Read specified table statistics\n");
+
return help.toString();
}