/*
 * oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2017, Gluu
 */
package org.gluu.oxtrust.api.saml;

import javax.inject.Inject;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.gluu.oxtrust.util.OxTrustConstants;

/**
 * WS endpoint for TrustRelationship actions.
 * 
 * @author Dmitry Ognyannikov
 */
@Path("/saml/tr")
public class TrustRelationshipWebService {
    //TODO
    
    @GET
    @Path("/read/{inum}/")
    @Produces(MediaType.APPLICATION_JSON)
    public String read(@PathParam("inum") String inum) {
        String result = null;
        //TODO
        return result;
    }
    
    @POST
    @Path("/create")
    @Produces(MediaType.TEXT_PLAIN)
    public String create() {
        String inum = null;
        //TODO
        return inum;
    }
    
    @PUT
    @Path("/update/{inum}/")
    @Produces(MediaType.TEXT_PLAIN)
    public String update(@PathParam("inum") String inum) {
        //TODO
        return OxTrustConstants.RESULT_SUCCESS;
    }
    
    @DELETE
    @Path("/delete/{inum}/")
    @Produces(MediaType.TEXT_PLAIN)
    public String delete(@PathParam("inum") String inum) {
        //TODO
        return OxTrustConstants.RESULT_SUCCESS;
    }
    
    @GET
    @Path("/list/")
    @Produces(MediaType.APPLICATION_JSON)
    public String list() {
        String list = null;
        //TODO
        return list;
    }
    
    
}

@@ -203,16 +203,45 @@
 Inject;%0A
+import javax.ws.rs.Consumes;%0A
 import j
@@ -259,16 +259,16 @@
 DELETE;%0A
-
 import j
@@ -605,16 +605,80 @@
 ml/tr%22)%0A
+@Consumes(%7B MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN %7D)%0A
 public c
@@ -756,25 +756,24 @@
 /read/%7Binum%7D
-/
 %22)%0A    @Prod
@@ -1138,33 +1138,32 @@
 (%22/update/%7Binum%7D
-/
 %22)%0A    @Produces
@@ -1355,17 +1355,16 @@
 e/%7Binum%7D
-/
 %22)%0A    @
@@ -1528,32 +1528,32 @@
 %7D%0A    %0A    @GET%0A
+
     @Path(%22/list
@@ -1552,17 +1552,16 @@
 h(%22/list
-/
 %22)%0A    @

Prepare working prototype which demonstrates oxTrust API #784