Class PutProxyResource<T>

  • Type Parameters:
    T - the type of entity to send as PUT payload.
    All Implemented Interfaces:
    ResourceRequest<Response>, Callable<Response>

    public class PutProxyResource<T>
    extends WebAppResourceRequest<Response>
    Executes a PUT request on a OSLC resource.

    An OSLC-Core-Version header is set to 2.0, as the PUT is expected to execute on an OSLC resource.

    This request returns a generic Response, as callers may not know the exact type of response to expect.

    Since:
    1.3.0
    • Constructor Detail

      • PutProxyResource

        public PutProxyResource​(HttpServletRequest request,
                                URI uri,
                                String eTag,
                                T entity)
        Creates a new instance to execute a PUT on the specified resource.

        A Content-Type header is set to application/rdf+xml, as this is the most frequently used exchange format.

        Parameters:
        request - the HTTP request used to obtain a REST client
        uri - the URI used for the underlying request
        eTag - the ETag to send as PUT header
        entity - the entity to send as PUT payload
      • PutProxyResource

        public PutProxyResource​(HttpServletRequest request,
                                URI uri,
                                String eTag,
                                T entity,
                                String contentType)
        Creates a new instance to execute a PUT on the specified resource.
        Parameters:
        request - the HTTP request used to obtain a REST client
        uri - the URI used for the underlying request
        eTag - the ETag to send as PUT header
        entity - the entity to send as PUT payload
        contentType - the Content-Type header to send
      • PutProxyResource

        public PutProxyResource​(HttpServletRequest request,
                                URI uri,
                                String eTag,
                                T entity,
                                String contentType,
                                String acceptType)
        Creates a new instance to execute a PUT on the specified resource.
        Parameters:
        request - the HTTP request used to obtain a REST client
        uri - the URI used for the underlying request
        eTag - the ETag to send as PUT header
        entity - the entity to send as PUT payload
        contentType - the Content-Type header to send
        acceptType - the Accept header to send, which describes the expected response entity format
    • Method Detail

      • call

        protected Response call​(OslcClient client)
        Executes a GET request on the resource.

        An OSLC-Core-Version header is set to 2.0, as the GET is expected to execute on an OSLC resource.

        Specified by:
        call in class WebAppResourceRequest<Response>
        Parameters:
        client - the client to use to execute the request.
        Returns:
        a generic Response object