Search in sources :

Example 1 with IClient

use of org.batfish.common.plugin.IClient 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)

Aggregations

IBatfish (org.batfish.common.plugin.IBatfish)1 IClient (org.batfish.common.plugin.IClient)1 Question (org.batfish.datamodel.questions.Question)1