/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.essar.automation.dhaval.server;

import com.essar.automation.dhaval.client.RandomQuoteService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import java.util.Random;

/**
 *
 * @author dhaval
 */
public class RandomQuoteServiceImpl extends RemoteServiceServlet
                                    implements RandomQuoteService{

    private String[] quotes;

    public RandomQuoteServiceImpl() {
        quotes = new String[5];
        quotes[0] = "hello";
        quotes[1] = "hello, world";
        quotes[2] = "hi";
        quotes[3] = "hello GWT";
        quotes[4] = "hello Java";
    }


    public String getQuote() {
        return quotes[new Random().nextInt(quotes.length-1)];
    }

}
