@Override public Object getPayloadInstance() { return new PrivilegeResourceRequest(); }
@Override public Object getPayloadInstance() { return new PrivilegeResourceRequest(); }
public Response sendMessage( Method method, PrivilegeResource resource, String id ) throws IOException { XStreamRepresentation representation = new XStreamRepresentation( xstream, "", mediaType ); String privId = ( method == Method.POST ) ? "" : "/" + id; String serviceURI = "service/local/privileges" + privId; if ( method == Method.POST || method == Method.PUT ) // adding put so we can check for the 405, without a resource you get a 400 { PrivilegeResourceRequest requestResponse = new PrivilegeResourceRequest(); requestResponse.setData( resource ); // now set the payload representation.setPayload( requestResponse ); log.debug( method.getName() + ": " + representation.getText() ); } return RequestFacade.sendMessage( serviceURI, method, representation ); }
public Response sendMessage(Method method, PrivilegeResource resource, String id) throws IOException { XStreamRepresentation representation = new XStreamRepresentation(xstream, "", mediaType); String privId = (method == Method.POST) ? "" : "/" + id; String serviceURI = "service/local/privileges" + privId; if (method == Method.POST) { serviceURI += "_target"; } if (method == Method.POST || method == Method.PUT) // adding put so we can check for the 405, without a // resource you get a 400 { PrivilegeResourceRequest requestResponse = new PrivilegeResourceRequest(); requestResponse.setData(resource); // now set the payload representation.setPayload(requestResponse); log.debug(method.getName() + ": " + representation.getText()); } return RequestFacade.sendMessage(serviceURI, method, representation); }
final PrivilegeResourceRequest request = new PrivilegeResourceRequest(); request.setData( convert() ); try
/** * Creating "one" privilege will return many privileges depending on the methods set. * @return always null */ @Override protected PrivilegeStatusResource doCreate() { final PrivilegeResourceRequest request = new PrivilegeResourceRequest(); request.setData( convert() ); try { getNexusClient() .serviceResource( "privileges_target" ) .post( PrivilegeListResourceResponse.class, request ); return null; } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }