Search in sources :

Example 1 with IBatfish

use of org.batfish.common.plugin.IBatfish in project batfish by batfish.

the class QuestionPlugin method pluginInitialize.

@Override
protected final void pluginInitialize() {
    Question question = createQuestion();
    String questionName = question.getName();
    String questionClassName = question.getClass().getCanonicalName();
    switch(_pluginConsumer.getType()) {
        case BATFISH:
            {
                IBatfish batfish = (IBatfish) _pluginConsumer;
                batfish.registerAnswerer(questionName, questionClassName, this::createAnswerer);
                break;
            }
        case CLIENT:
            {
                IClient client = (IClient) _pluginConsumer;
                client.registerQuestion(questionName, this::createQuestion);
                break;
            }
        default:
            break;
    }
}
Also used : Question(org.batfish.datamodel.questions.Question) IClient(org.batfish.common.plugin.IClient) IBatfish(org.batfish.common.plugin.IBatfish)

Example 2 with IBatfish

use of org.batfish.common.plugin.IBatfish in project batfish by batfish.

the class BatfishCompressionTest method compressNetwork.

private SortedMap<String, Configuration> compressNetwork(Map<String, Configuration> configs, HeaderSpace headerSpace) throws IOException {
    TemporaryFolder tmp = new TemporaryFolder();
    tmp.create();
    IBatfish batfish = BatfishTestUtils.getBatfish(new TreeMap<>(configs), tmp);
    return new TreeMap<>(new BatfishCompressor(batfish, configs).compress(headerSpace));
}
Also used : TemporaryFolder(org.junit.rules.TemporaryFolder) TreeMap(java.util.TreeMap) IBatfish(org.batfish.common.plugin.IBatfish)

Aggregations

IBatfish (org.batfish.common.plugin.IBatfish)2 TreeMap (java.util.TreeMap)1 IClient (org.batfish.common.plugin.IClient)1 Question (org.batfish.datamodel.questions.Question)1 TemporaryFolder (org.junit.rules.TemporaryFolder)1