@Override public int canAdapt(final RepositoryBaseResource resource) { int score = super.canAdapt(resource); if (score > 0) { if (JerseyDockerGroupRepository.PROVIDER_ROLE.equals(resource.getProviderRole()) && JerseyDockerGroupRepository.PROVIDER.equals(resource.getProvider())) { score++; } } return score; }
@Override public int canAdapt(final RepositoryBaseResource resource) { int score = super.canAdapt(resource); if (score > 0) { if (JerseyDockerProxyRepository.PROVIDER_ROLE.equals(resource.getProviderRole()) && JerseyDockerProxyRepository.PROVIDER.equals(resource.getProvider())) { score++; } } return score; }
@Override public int canAdapt(final RepositoryBaseResource resource) { int score = super.canAdapt(resource); if (score > 0) { if (JerseyDockerHostedRepository.PROVIDER_ROLE.equals(resource.getProviderRole()) && JerseyDockerHostedRepository.PROVIDER.equals(resource.getProvider())) { score++; } } return score; }
@Override public int canAdapt(final RepositoryBaseResource resource) { int score = super.canAdapt(resource); if (score > 0) { if (JerseyPypiProxyRepository.PROVIDER_ROLE.equals(resource.getProviderRole()) && JerseyPypiProxyRepository.PROVIDER.equals(resource.getProvider())) { score++; } } return score; }
/** * IMPORTANT: Make sure to release the Response in a finally block when you are done with it. */ public Response sendMessage( Method method, RepositoryBaseResource resource, String id ) throws IOException { if ( resource != null && resource.getProviderRole() == null ) { if ( "virtual".equals( resource.getRepoType() ) ) { resource.setProviderRole( ShadowRepository.class.getName() ); } else { resource.setProviderRole( Repository.class.getName() ); } } XStreamRepresentation representation = new XStreamRepresentation( xstream, "", mediaType ); String idPart = ( method == Method.POST ) ? "" : "/" + id; String serviceURI = SERVICE_PART + idPart; RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse(); repoResponseRequest.setData( resource ); // now set the payload representation.setPayload( repoResponseRequest ); LOG.debug( "sendMessage: " + representation.getText() ); return nexusRestClient.sendMessage( serviceURI, method, representation ); }
/** * IMPORTANT: Make sure to release the Response in a finally block when you are done with it. */ public Response sendMessage(Method method, RepositoryBaseResource resource, String id) throws IOException { if (resource != null && resource.getProviderRole() == null) { if ("virtual".equals(resource.getRepoType())) { resource.setProviderRole(ShadowRepository.class.getName()); } else { resource.setProviderRole(Repository.class.getName()); } } XStreamRepresentation representation = new XStreamRepresentation(xstream, "", mediaType); String idPart = (method == Method.POST) ? "" : "/" + id; String serviceURI = SERVICE_PART + idPart; RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse(); repoResponseRequest.setData(resource); // now set the payload representation.setPayload(repoResponseRequest); LOG.debug("sendMessage: " + representation.getText()); return nexusRestClient.sendMessage(serviceURI, method, representation); }
appModel.setProviderRole(resource.getProviderRole());
appModel.setProviderRole( resource.getProviderRole() );