@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
@Override public Object getPayloadInstance() { return new RepositoryResourceResponse(); }
public RepositoryBaseResource getRepository(final String repoId) throws IOException { // accepted return codes: OK or redirect final String responseText = nexusRestClient.doGetForText(SERVICE_PART + "/" + repoId, not(inError())); LOG.debug("responseText: \n" + responseText); // this should use call to: getResourceFromResponse XStreamRepresentation representation = new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation.getPayload(new RepositoryResourceResponse()); return resourceResponse.getData(); }
public RepositoryBaseResource getRepositoryBaseResourceFromResponse(Response response) throws IOException { String responseString = response.getEntity().getText(); LOG.debug(" getRepositoryBaseResourceFromResponse: " + responseString); XStreamRepresentation representation = new XStreamRepresentation(xstream, responseString, mediaType); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation.getPayload(new RepositoryResourceResponse()); return resourceResponse.getData(); }
public RepositoryBaseResource getRepository(String repoId) throws IOException { // accepted return codes: OK or redirect final String responseText = RequestFacade.doGetForText(SERVICE_PART + "/" + repoId, not(inError())); LOG.debug("responseText: \n" + responseText); // this should use call to: getResourceFromResponse XStreamRepresentation representation = new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation.getPayload(new RepositoryResourceResponse()); return resourceResponse.getData(); }
public RepositoryBaseResource getRepositoryBaseResourceFromResponse( Response response ) throws IOException { String responseString = response.getEntity().getText(); LOG.debug( " getRepositoryBaseResourceFromResponse: " + responseString ); XStreamRepresentation representation = new XStreamRepresentation( xstream, responseString, mediaType ); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation.getPayload( new RepositoryResourceResponse() ); return resourceResponse.getData(); }
public RepositoryResource getResourceFromResponse( Response response ) throws IOException { String responseString = response.getEntity().getText(); LOG.debug( " getResourceFromResponse: " + responseString ); XStreamRepresentation representation = new XStreamRepresentation( xstream, responseString, mediaType ); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation .getPayload( new RepositoryResourceResponse() ); return (RepositoryResource) resourceResponse.getData(); }
public RepositoryBaseResource getRepository( String repoId ) throws IOException { // accepted return codes: OK or redirect final String responseText = nexusRestClient.doGetForText( SERVICE_PART + "/" + repoId, not( inError() ) ); LOG.debug( "responseText: \n" + responseText ); // this should use call to: getResourceFromResponse XStreamRepresentation representation = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML ); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation.getPayload( new RepositoryResourceResponse() ); return resourceResponse.getData(); }
public RepositoryBaseResource getTemplate(String id) throws IOException { String responseText = RequestFacade.doGetForText("service/local/templates/repositories/" + id , not(inError())); LOG.debug("responseText: \n" + responseText); XStreamRepresentation representation = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation .getPayload(new RepositoryResourceResponse()); return resourceResponse.getData(); } }
public Response sendMessage( Method method, RepositoryBaseResource resource, String id ) throws IOException { XStreamRepresentation representation = new XStreamRepresentation( xstream, "", mediaType ); String idPart = ( method == Method.POST ) ? "" : "/" + id; String serviceURI = "service/local/repositories" + idPart; RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse(); repoResponseRequest.setData( resource ); // now set the payload representation.setPayload( repoResponseRequest ); LOG.debug( "sendMessage: " + representation.getText() ); return RequestFacade.sendMessage( serviceURI, method, representation ); }
private void saveRepository(RepositoryResource repository, String repositoryName) throws IOException { String serviceURI = "service/local/repositories/" + repositoryName; RepositoryResourceResponse repositoryResponse = new RepositoryResourceResponse(); XStreamRepresentation representation = new XStreamRepresentation(xstream, "", MediaType.APPLICATION_XML); repositoryResponse.setData(repository); representation.setPayload(repositoryResponse); RequestFacade.doPutForStatus(serviceURI, representation, isSuccessful()); }
public RepositoryBaseResource getRepository( String repoId ) throws IOException { String responseText = RequestFacade .doGetRequest( "service/local/repositories/" + repoId ).getEntity().getText(); LOG.debug( "responseText: \n" + responseText ); // this should use call to: getResourceFromResponse XStreamRepresentation representation = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML ); RepositoryResourceResponse resourceResponse = (RepositoryResourceResponse) representation .getPayload( new RepositoryResourceResponse() ); return (RepositoryBaseResource) resourceResponse.getData(); }
public RepositoryBaseResource createRepository( RepositoryBaseResource repo ) throws NexusConnectionException, NexusClientException { RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse(); repoResponseRequest.setData( repo ); Object tempObj = this.getClientHelper().create( REPO_SERVICE, null, repoResponseRequest ); // Hack around NEXUS-540 if ( tempObj == null ) { return this.getRepository( repo.getId() ); } // type check the object so we can have a meaninful error if needed this.checkType( tempObj, RepositoryResourceResponse.class ); RepositoryResourceResponse repoResponse = (RepositoryResourceResponse) tempObj; return repoResponse.getData(); }
private void saveRepository( RepositoryResource repository, String repositoryName ) throws IOException { String serviceURI = "service/local/repositories/" + repositoryName; RepositoryResourceResponse repositoryResponse = new RepositoryResourceResponse(); XStreamRepresentation representation = new XStreamRepresentation( xstream, "", MediaType.APPLICATION_XML ); repositoryResponse.setData( repository ); representation.setPayload( repositoryResponse ); Status status = RequestFacade.sendMessage( serviceURI, Method.PUT, representation ).getStatus(); Assert.assertEquals( Status.SUCCESS_OK.getCode(), status.getCode() ); }