public Response sendMessage( Method method, RepositoryBaseResource resource ) throws IOException { return this.sendMessage( method, resource, resource.getId() ); }
@Override public int canAdapt( final RepositoryBaseResource resource ) { int score = 0; if ( resource instanceof RepositoryProxyResource ) { score++; } if ( JerseyProxyRepository.REPO_TYPE.equals( resource.getRepoType() ) ) { score++; } return score; }
@Override public String name() { return settings().getName(); }
@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; }
appModel.setId(resource.getId()); appModel.setName(resource.getName()); appModel.setExposed(resource.isExposed()); appModel.setProviderRole(resource.getProviderRole()); if (RepositoryBaseResourceConverter.REPO_TYPE_VIRTUAL.equals(resource.getRepoType())) { appModel.setExternalConfiguration(ex); else if (!RepositoryBaseResourceConverter.REPO_TYPE_GROUP.equals(resource.getRepoType())) { RepositoryResource repoResource = (RepositoryResource) resource; appModel.setProviderHint(resource.getProvider());
public void validateResourceResponse( RepositoryBaseResource repo, RepositoryBaseResource responseResource ) throws IOException Assert.assertEquals( repo.getId(), responseResource.getId() ); Assert.assertEquals( repo.getName(), responseResource.getName() ); Assert.assertEquals( repo.getFormat(), responseResource.getFormat() ); Assert.assertEquals( repo.getRepoType(), responseResource.getRepoType() ); if ( repo.getRepoType().equals( "virtual" ) ) + repo.getId() + "/ <actual>" + actual.getDefaultLocalStorageUrl(), actual .getDefaultLocalStorageUrl().endsWith( "runtime/work/storage/" + repo.getId() + "/" ) ); + repo.getId() + " <actual>" + actual.getDefaultLocalStorageUrl(), actual .getDefaultLocalStorageUrl().endsWith( "runtime/work/storage/" + repo.getId() ) );
repoRes = new RepositoryGroupResource(); repoRes.setRepoType("group"); repoRes.setId(template.getId()); repoRes.setName(template.getDescription()); repoRes.setProvider(template.getRepositoryProviderHint()); repoRes.setProviderRole(template.getRepositoryProviderRole()); repoRes.setFormat(template.getContentClass().getId());
/** * 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); }
public void validateResourceResponse(RepositoryBaseResource repo, RepositoryBaseResource responseResource) throws IOException Assert.assertEquals(responseResource.getId(), repo.getId()); Assert.assertEquals(responseResource.getName(), repo.getName()); Assert.assertEquals(responseResource.getRepoType(), repo.getRepoType()); if (repo.getRepoType().equals("virtual")) { + repo.getId() + "/ <actual>" + actual.getDefaultLocalStorageUrl(), actual.getDefaultLocalStorageUrl().endsWith("/storage/" + repo.getId() + "/")); + repo.getId() + " <actual>" + actual.getDefaultLocalStorageUrl(), actual.getDefaultLocalStorageUrl().endsWith("/storage/" + repo.getId()));
if ( repo.getRepoType().equals( "virtual" ) ) CRepositoryShadow cRepo = NexusConfigUtil.getRepoShadow( repo.getId() ); CRepository cRepo = NexusConfigUtil.getRepo( repo.getId() );
@Override public int canAdapt( final RepositoryBaseResource resource ) { int score = super.canAdapt( resource ); if ( score > 0 ) { if ( JerseyMavenHostedRepository.PROVIDER.equals( resource.getProvider() ) ) { score++; } } return score; }
RepositoryBaseResource resource = repoRequest.getData(); if (RepositoryBaseResourceConverter.REPO_TYPE_VIRTUAL.equals(resource.getRepoType())) { RepositoryShadowResource model = (RepositoryShadowResource) resource; shadow.setExposed(resource.isExposed()); repository.setExposed(resource.isExposed());
public JerseyRepository( final JerseyNexusClient nexusClient, final String id ) { super( nexusClient ); this.id = id; this.settings = checkNotNull( createSettings() ); this.shouldCreate = true; this.status = null; settings().setId( this.id ); }
public boolean isExposed() { return settings().isExposed(); }
@Override public T withName( final String name ) { settings().setName( name ); return me(); }
appModel.setId( resource.getId() ); appModel.setName( resource.getName() ); appModel.setExposed( resource.isExposed() ); appModel.setProviderRole( resource.getProviderRole() ); if ( RepositoryBaseResourceConverter.REPO_TYPE_VIRTUAL.equals( resource.getRepoType() ) ) else if ( !RepositoryBaseResourceConverter.REPO_TYPE_GROUP.equals( resource.getRepoType() ) ) appModel.setProviderHint( resource.getProvider() );
repoRes.setRepoType( "group" ); repoRes.setId( template.getId() ); repoRes.setName( template.getDescription() ); repoRes.setProvider( template.getRepositoryProviderHint() ); repoRes.setProviderRole( template.getRepositoryProviderRole() ); repoRes.setFormat( template.getContentClass().getId() );
/** * 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 ); }
@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; }
if (repo.getRepoType().equals("virtual")) { CRepository cRepo = getTest().getNexusConfigUtil().getRepo(repo.getId()); M2LayoutedM1ShadowRepositoryConfiguration cShadowRepo = getTest().getNexusConfigUtil().getRepoShadow(repo.getId()); CRepository cRepo = getTest().getNexusConfigUtil().getRepo(repo.getId()); M2RepositoryConfiguration cM2Repo = getTest().getNexusConfigUtil().getM2Repo(repo.getId());