package com.gofish.sentiment.sentimentservice;

import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.json.JsonObject;
import io.vertx.serviceproxy.ProxyHelper;

/**
 * @author Luke Herron
 */
@ProxyGen
@VertxGen
public interface SentimentService {

    String NAME = "sentiment-eventbus-service";
    String ADDRESS = "sentiment.service";
    long SENTIMENT_PROXY_TIMEOUT = 300000; // 5 minutes

    static SentimentService create(Vertx vertx, JsonObject config) {
        return new SentimentServiceImpl(vertx, config);
    }

    static SentimentService createProxy(Vertx vertx, String address) {
        DeliveryOptions deliveryOptions = new DeliveryOptions().setSendTimeout(SENTIMENT_PROXY_TIMEOUT);
        return ProxyHelper.createProxy(SentimentService.class, vertx, address, deliveryOptions);
    }

    @Fluent
    SentimentService getSentiment(String query, Handler<AsyncResult<JsonObject>> resultHandler);

    @Fluent
    SentimentService analyseSentiment(String query, Handler<AsyncResult<JsonObject>> resultHandler);
}

@@ -640,525 +640,2410 @@
     
-static SentimentService create(Vertx vertx, JsonObject config) %7B%0A        return new SentimentServiceImpl(vertx, config);%0A    %7D%0A%0A    static SentimentService createProxy(Vertx vertx, String address) %7B%0A        DeliveryOptions deliveryOptions = new DeliveryOptions().setSendTimeout(SENTIMENT_PROXY_TIMEOUT);%0A        return ProxyHelper.createProxy(SentimentService.class, vertx, address, deliveryOptions);%0A    %7D%0A%0A    @Fluent%0A    SentimentService getSentiment(String query, Handler%3CAsyncResult%3CJsonObject%3E%3E resultHandler);%0A
+/**%0A     * Factory method for creating SentimentService instance%0A     * @param vertx Vertx instance%0A     * @param config JsonObject for configuring the NewsAnalyserService%0A     * @return NewsAnalyserService object%0A     */%0A    static SentimentService create(Vertx vertx, JsonObject config) %7B%0A        return new SentimentServiceImpl(vertx, config);%0A    %7D%0A%0A    /**%0A     * Factory method for generating a proxy to access the SentimentService%0A     * @param vertx Vertx instance%0A     * @param address The address of the news analyser service on the vertx cluster%0A     * @return NewsAnalyserService object%0A     */%0A    static SentimentService createProxy(Vertx vertx, String address) %7B%0A        DeliveryOptions deliveryOptions = new DeliveryOptions().setSendTimeout(SENTIMENT_PROXY_TIMEOUT);%0A        return ProxyHelper.createProxy(SentimentService.class, vertx, address, deliveryOptions);%0A    %7D%0A%0A    /**%0A     * Convenience method for accessing the service name. Used primarily for the vertx generated rx version of this%0A     * class, which does not have access to the constant declared in this interface%0A     * @return String representing the name of this service%0A     */%0A    static String name() %7B%0A        return NAME;%0A    %7D%0A%0A    /**%0A     * Convenience method for accessing the service address. Used primarily for the vertx generated rx version of this%0A     * class, which does not have access to the constant declared in this interface%0A     * @return String representing the address of this service%0A     */%0A    static String address() %7B%0A        return ADDRESS;%0A    %7D%0A%0A    /**%0A     * Retrieves the currently stored sentiment results for the supplied query%0A     * @param query String representing the news query to retrieve the sentiment results for%0A     * @param resultHandler the result will be returned asynchronously in this handler%0A     * @return SentimentService so this method can be used fluently%0A     */%0A    @Fluent%0A    SentimentService getSentiment(String query, Handler%3CAsyncResult%3CJsonObject%3E%3E resultHandler);%0A%0A    /**%0A     * Crawls the news for the provided query keyword and analyses the sentiment of each news article that is found%0A     * @param query String representing the news query to crawl for and perform sentiment analysis on%0A     * @param resultHandler the result will be returned asynchronously in this handler%0A     * @return SentimentService so this method can be used fluently%0A     */
 %0A   

Add static methods to retrieve service name and address. Updated inline comments