@Override protected void doRemove() { try { client.serviceResource("ldap/servers/" + id()).delete(); } catch (UniformInterfaceException e) { throw client.convert(e); } catch (ClientHandlerException e) { throw client.convert(e); } }
@Override public String getIndex(final String repositoryId, final String version, final String path) { try { return getNexusClient().serviceResource( "yum/repos/" + repositoryId + "/" + version + "/" + (path == null ? "" : path + (path.endsWith("/") ? "" : "/")) ).get(String.class); } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } }
@Override public void order(final List<String> ids) { checkNotNull(ids); try { final LdapServerOrderRequest request = new LdapServerOrderRequest(); request.getData().addAll(ids); getNexusClient().serviceResource("ldap/server_order").put(request); } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } }
@Override public List<Configuration> get() { try { final LdapServerListResponse response = getNexusClient().serviceResource("ldap/servers") .get(LdapServerListResponse.class); final List<Configuration> result = Lists.newArrayList(); for (LdapServerListEntryDTO entry : response.getData()) { result.add(get(entry.getId())); } return result; } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } }
@Override protected ConfigurationXO doGet() { try { return toXO(client.serviceResource("ldap/servers/" + id()).get(LdapServerRequest.class).getData()); } catch (UniformInterfaceException e) { throw client.convert(e); } catch (ClientHandlerException e) { throw client.convert(e); } }
@Override public void clearCaches() { try { getNexusClient().serviceResource("ldap/clearcache").delete(); } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } } }
@Override public Configuration get(final String id) { checkNotNull(id); try { final LdapServerRequest response = getNexusClient().serviceResource("ldap/servers/" + id) .get(LdapServerRequest.class); return new JerseyConfiguration(getNexusClient(), response.getData()); } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } }
@VisibleForTesting void setConfiguration( final GlobalConfigurationResource configuration ) { final GlobalConfigurationResourceResponse request = new GlobalConfigurationResourceResponse(); request.setData( configuration ); try { getNexusClient().serviceResource( "global_settings/current" ).put( request ); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override public String getAlias(String repositoryId, String alias) { try { return getNexusClient() .serviceResource(getUrlPath(repositoryId, alias)) .get(String.class); } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } }
@Override public String getAlias( String repositoryId, String alias ) { try { return getNexusClient() .serviceResource( getUrlPath( repositoryId, alias ) ) .get( String.class ); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override public void updatePrefixFile( final String mavenProxyRepositoryId ) throws IllegalArgumentException, NexusClientNotFoundException { try { getNexusClient().serviceResource( routingPath( mavenProxyRepositoryId ) ).delete(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override public void createOrUpdateAlias(String repositoryId, String alias, String version) { try { getNexusClient() .serviceResource(getUrlPath(repositoryId, alias)) .type(TEXT_PLAIN) .post(String.class, version); } catch (UniformInterfaceException e) { throw getNexusClient().convert(e); } catch (ClientHandlerException e) { throw getNexusClient().convert(e); } }
@Override protected void doRemove() { try { getNexusClient() .serviceResource( path( id() ) ) .delete(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override protected ConfigurationXO doCreate() { try { final LdapServerRequest entity = new LdapServerRequest(); entity.setData(toDto(settings())); return toXO(client.serviceResource("ldap/servers").post(LdapServerRequest.class, entity).getData()); } catch (UniformInterfaceException e) { throw client.convert(e); } catch (ClientHandlerException e) { throw client.convert(e); } }
private void doRemove() { try { getNexusClient() .serviceResource( uri() + "/" + id() ) .delete(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override protected void doRemove() { try { getNexusClient() .serviceResource( path( id() ) ) .delete(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override protected PrivilegeStatusResource doGet() { try { return getNexusClient() .serviceResource( path( id() ) ) .get( PrivilegeStatusResourceResponse.class ) .getData(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
S doGet() { try { return (S) getNexusClient() .serviceResource( uri() + "/" + id() ) .get( RepositoryResourceResponse.class ) .getData(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
@Override protected ConfigurationXO doUpdate() { try { final LdapServerRequest entity = new LdapServerRequest(); entity.setData(toDto(settings())); return toXO(client.serviceResource("ldap/servers/" + id()).put(LdapServerRequest.class, entity).getData()); } catch (UniformInterfaceException e) { throw client.convert(e); } catch (ClientHandlerException e) { throw client.convert(e); } }
@Override protected RoleResource doGet() { try { return getNexusClient() .serviceResource( path( id() ) ) .get( RoleResourceResponse.class ) .getData(); } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }