package we.love.pluto.infoproxy;

import cloudone.ServiceFullName;
import cloudone.client.C1Client;
import cloudone.client.C1ClientBuilder;
import org.glassfish.jersey.gson.GsonFeature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

/**
 * @author Martin Mares (martin.mares at oracle.com)
 */
@Path("/")
public class InfoResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(InfoResource.class);
    private static C1Client client = new C1ClientBuilder()
                                            .build()
                                            .register(GsonFeature.class);

    @Path("planet/{name}")
    @GET
    @Produces("text/plain")
    public String getPlanetInfo(@PathParam("name") String name) {
        LOGGER.info("getPlanetInfo(" + name + ")");
        Info info = client.target(new ServiceFullName("we.love.pluto", "solar-system", null))
                                .path("universe/{name}")
                                .resolveTemplate("name", name)
                                .anyOK()
                                .get(Info.class);
        return info.toString();
    }
}

@@ -1244,11 +1244,868 @@
 );%0A    %7D
+%0A%0A    @Path(%22star/%7Bname%7D%22)%0A    @GET%0A    @Produces(%22text/plain%22)%0A    public String getStarInfo(@PathParam(%22name%22) String name) %7B%0A        LOGGER.info(%22getStarInfo(%22 + name + %22)%22);%0A        Info info = client.target(new ServiceFullName(%22we.love.pluto%22, %22milky-way%22, null))%0A                .path(%22universe/%7Bname%7D%22)%0A                .resolveTemplate(%22name%22, name)%0A                .anyOK()%0A                .get(Info.class);%0A        return info.toString();%0A    %7D%0A%0A    @Path(%22object/%7Bname%7D%22)%0A    @GET%0A    @Produces(%22text/plain%22)%0A    public String getObjectInfo(@PathParam(%22name%22) String name) %7B%0A        LOGGER.info(%22getObjectInfo(%22 + name + %22)%22);%0A        Info info = client.target()%0A                .path(%22universe/%7Bname%7D%22)%0A                .resolveTemplate(%22name%22, name)%0A                .anyOK()%0A                .get(Info.class);%0A        return info.toString();%0A    %7D
 %0A%7D%0A

Complete any client example