Search in sources :

Example 11 with Contact

use of org.jboss.as.quickstarts.jaxrsclient.model.Contact in project quickstart by wildfly.

the class SavedByClientRequestFilter method filter.

@Override
public void filter(ClientRequestContext requestContext) throws IOException {
    String method = requestContext.getMethod();
    if ("POST".equals(method) && requestContext.hasEntity()) {
        Contact contact = (Contact) requestContext.getEntity();
        contact.setSavedBy(USERNAME);
        requestContext.setEntity(contact);
    }
}
Also used : Contact(org.jboss.as.quickstarts.jaxrsclient.model.Contact)

Aggregations

Contact (org.jboss.as.quickstarts.jaxrsclient.model.Contact)11 List (java.util.List)10 Response (javax.ws.rs.core.Response)10 GenericType (javax.ws.rs.core.GenericType)6 Test (org.junit.Test)5 Invocation (javax.ws.rs.client.Invocation)2 InvocationCallback (javax.ws.rs.client.InvocationCallback)2