// Path: web-api/RESTEasy/src/main/java/com/sample/utilities/MyBean.java
// public class MyBean {
// 
//     private int index;
//     private String name;
//     private long epoch;
//     private char gender;
// 
//     public int getIndex() {
//         return index;
//     }
// 
//     public void setIndex(int index) {
//         this.index = index;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public long getEpoch() {
//         return epoch;
//     }
// 
//     public void setEpoch(long epoch) {
//         this.epoch = epoch;
//     }
// 
//     public char getGender() {
//         return gender;
//     }
// 
//     public void setGender(char gender) {
//         this.gender = gender;
//     }
// 
// }
// 
// Path: web-api/RESTEasy/src/main/java/com/sample/utilities/TransformationUtils.java
// public class TransformationUtils {
// 
//     private TransformationUtils() {
//         // Dont init
//     }
// 
//     /**
//      * Get sum of bytes
//      *
//      * @return
//      */
//     public static String getSumOfBytes() {
//         return String.valueOf((Math.random() * 1000 + Math.random() * 1000));
//     }
// 
//     /**
//      * Retrieve a sample object from {@link MyBean}
//      *
//      * @param caller
//      * @return
//      */
//     public static MyBean getObj(String caller) {
//         MyBean myBean = new MyBean();
//         myBean.setEpoch(0);
//         myBean.setGender('m');
//         myBean.setIndex(1);
//         myBean.setName(caller);
//         return myBean;
//     }
// 
// }


import com.sample.utilities.MyBean;
import com.sample.utilities.TransformationUtils;
import org.apache.log4j.Logger;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
package com.sample.one;



/**
 * The actual rest service that will be exposed to the user with /greet in the URL
 *
 * @author saifasif
 */
@Path("/greet")
public class GreetRestService extends Application {

    private static final Logger log = Logger.getLogger(GreetRestService.class);

    /**
     * A sample rest method exposed at URL '/greet/hello/{insert_name_here}'
     *
     * @param name A sample String text
     * @return {@link String} text format string that will be displayed on the page
     */
    @GET
    @Path("/hello/{name}")
    @Produces(MediaType.TEXT_PLAIN)
    public String getGreetings(@PathParam("name") String name) {
        log.info("Service requests... Getting response");
        return "Greetings " + name + " to Rest service.";
    }

    /**
     * A sample rest method exposed at URL '/greet/get_sample/{caller}'
     *
     * @param caller A sample String text
     * @return {@link String} json format string that will be displayed on the page
     */
    @GET
    @Path("/get_sample/{caller}")
    @Produces(MediaType.APPLICATION_JSON)
    public MyBean getJsonObj(@PathParam("caller") String caller) {
        log.info("Service requests... Getting response");
// Path: web-api/RESTEasy/src/main/java/com/sample/utilities/MyBean.java
// public class MyBean {
// 
//     private int index;
//     private String name;
//     private long epoch;
//     private char gender;
// 
//     public int getIndex() {
//         return index;
//     }
// 
//     public void setIndex(int index) {
//         this.index = index;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public long getEpoch() {
//         return epoch;
//     }
// 
//     public void setEpoch(long epoch) {
//         this.epoch = epoch;
//     }
// 
//     public char getGender() {
//         return gender;
//     }
// 
//     public void setGender(char gender) {
//         this.gender = gender;
//     }
// 
// }
// 
// Path: web-api/RESTEasy/src/main/java/com/sample/utilities/TransformationUtils.java
// public class TransformationUtils {
// 
//     private TransformationUtils() {
//         // Dont init
//     }
// 
//     /**
//      * Get sum of bytes
//      *
//      * @return
//      */
//     public static String getSumOfBytes() {
//         return String.valueOf((Math.random() * 1000 + Math.random() * 1000));
//     }
// 
//     /**
//      * Retrieve a sample object from {@link MyBean}
//      *
//      * @param caller
//      * @return
//      */
//     public static MyBean getObj(String caller) {
//         MyBean myBean = new MyBean();
//         myBean.setEpoch(0);
//         myBean.setGender('m');
//         myBean.setIndex(1);
//         myBean.setName(caller);
//         return myBean;
//     }
// 
// }


// Path: web-api/RESTEasy/src/main/java/com/sample/one/GreetRestService.java
import com.sample.utilities.MyBean;
import com.sample.utilities.TransformationUtils;
import org.apache.log4j.Logger;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;

package com.sample.one;



/**
 * The actual rest service that will be exposed to the user with /greet in the URL
 *
 * @author saifasif
 */
@Path("/greet")
public class GreetRestService extends Application {

    private static final Logger log = Logger.getLogger(GreetRestService.class);

    /**
     * A sample rest method exposed at URL '/greet/hello/{insert_name_here}'
     *
     * @param name A sample String text
     * @return {@link String} text format string that will be displayed on the page
     */
    @GET
    @Path("/hello/{name}")
    @Produces(MediaType.TEXT_PLAIN)
    public String getGreetings(@PathParam("name") String name) {
        log.info("Service requests... Getting response");
        return "Greetings " + name + " to Rest service.";
    }

    /**
     * A sample rest method exposed at URL '/greet/get_sample/{caller}'
     *
     * @param caller A sample String text
     * @return {@link String} json format string that will be displayed on the page
     */
    @GET
    @Path("/get_sample/{caller}")
    @Produces(MediaType.APPLICATION_JSON)
    public MyBean getJsonObj(@PathParam("caller") String caller) {
        log.info("Service requests... Getting response");
        return TransformationUtils.getObj(caller);