/** * Returns an API instance that conforms to the given API Type that can communicate with the Metacat server. * * @param apiType apiType A JAX-RS annotated Metacat interface * @param <T> API Resource instance * @return An instance that implements the given interface and is wired up to communicate with the Metacat server. */ public <T> T getApiClient(final Class<T> apiType) { Preconditions.checkArgument(apiType.isInterface(), "apiType must be an interface"); return feignBuilder.target(apiType, host); }
/** * Resource for retrieving SimpleDomain related data. * * @return The configured SimpleDomain Resource */ @Bean public SimpleDomainMaintenanceResource simpledomainResource() { return feignBuilder().logger(new Slf4jLogger(SimpleDomainMaintenanceResource.class)).target( SimpleDomainMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving ValidationExample related data. * * @return The configured ValidationExample Resource */ @Bean public ValidationExampleMaintenanceResource validationexampleResource() { return feignBuilder().logger(new Slf4jLogger(ValidationExampleMaintenanceResource.class)).target( ValidationExampleMaintenanceResource.class, getEndpoint()); }
private static TestEchoService createTestService(SslConfiguration sslConfig) { SSLSocketFactory factory = SslSocketFactories.createSslSocketFactory(sslConfig); X509TrustManager trustManager = SslSocketFactories.createX509TrustManager(sslConfig); String endpointUri = "https://localhost:" + APP.getLocalPort(); OkHttpClient okHttpClient = new OkHttpClient.Builder().sslSocketFactory(factory, trustManager).build(); return Feign.builder() .client(new feign.okhttp.OkHttpClient(okHttpClient)) .contract(new JAXRSContract()) .target(TestEchoService.class, endpointUri); }
/** * Resource for invoking rest services on EnumerationBased. * * @return The configured EnumerationBased Resource */ @Bean public EnumerationBasedResource enumerationbasedResource() { return feignBuilder().logger(new Slf4jLogger(EnumerationBasedResource.class)).target( EnumerationBasedResource.class, getEndpoint()); }
/** * Resource for invoking rest services on ServiceExampleLogger. * * @return The configured ServiceExampleLogger Resource */ @Bean public ServiceExampleLoggerResource serviceexampleloggerResource() { return feignBuilder().logger(new Slf4jLogger(ServiceExampleLoggerResource.class)).target( ServiceExampleLoggerResource.class, getEndpoint()); }
/** * Resource for retrieving ForeignKeyColumnCustomName related data. * * @return The configured ForeignKeyColumnCustomName Resource */ @Bean public ForeignKeyColumnCustomNameMaintenanceResource foreignkeycolumncustomnameResource() { return feignBuilder().logger(new Slf4jLogger(ForeignKeyColumnCustomNameMaintenanceResource.class)).target( ForeignKeyColumnCustomNameMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving IdentityKeyedEntity related data. * * @return The configured IdentityKeyedEntity Resource */ @Bean public IdentityKeyedEntityMaintenanceResource identitykeyedentityResource() { return feignBuilder().logger(new Slf4jLogger(IdentityKeyedEntityMaintenanceResource.class)).target( IdentityKeyedEntityMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving NonUUIDKeyEntity related data. * * @return The configured NonUUIDKeyEntity Resource */ @Bean public NonUUIDKeyEntityMaintenanceResource nonuuidkeyentityResource() { return feignBuilder().logger(new Slf4jLogger(NonUUIDKeyEntityMaintenanceResource.class)).target( NonUUIDKeyEntityMaintenanceResource.class, getEndpoint()); }
@Override public <T> T target(FeignClientFactoryBean factory, Feign.Builder feign, FeignContext context, Target.HardCodedTarget<T> target) { return feign.target(target); } }
/** * Resource for retrieving MappedSubclassB related data. * * @return The configured MappedSubclassB Resource */ @Bean public MappedSubclassBMaintenanceResource mappedsubclassbResource() { return feignBuilder().logger(new Slf4jLogger(MappedSubclassBMaintenanceResource.class)).target( MappedSubclassBMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving LocalTransientReferenceExample related data. * * @return The configured LocalTransientReferenceExample Resource */ @Bean public LocalTransientReferenceExampleMaintenanceResource localtransientreferenceexampleResource() { return feignBuilder().logger(new Slf4jLogger(LocalTransientReferenceExampleMaintenanceResource.class)).target( LocalTransientReferenceExampleMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving ForeignKeyWithColumnDefinition related data. * * @return The configured ForeignKeyWithColumnDefinition Resource */ @Bean public ForeignKeyWithColumnDefinitionMaintenanceResource foreignkeywithcolumndefinitionResource() { return feignBuilder().logger(new Slf4jLogger(ForeignKeyWithColumnDefinitionMaintenanceResource.class)).target( ForeignKeyWithColumnDefinitionMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving SimpleDomainChild related data. * * @return The configured SimpleDomainChild Resource */ @Bean public SimpleDomainChildMaintenanceResource simpledomainchildResource() { return feignBuilder().logger(new Slf4jLogger(SimpleDomainChildMaintenanceResource.class)).target( SimpleDomainChildMaintenanceResource.class, getEndpoint()); }
@Override default Reference createBranch(String repoFullName, String branchName, String fromReferenceSha1, String oauthToken) throws BranchAlreadyExistsException, GitHubAuthorizationException { GitReferenceClient gitReferenceClient = GitReferenceClient.buildGitReferenceClient(oauthToken) .target(GitReferenceClient.class, GlobalProperties.getGitHubApiUrl() + "/repos/" + repoFullName + "/git/refs"); return gitReferenceClient.createBranch(new InputRef("refs/heads/" + branchName, fromReferenceSha1)); }
/** * Resource for retrieving MappedSuperclassOneToManyChild related data. * * @return The configured MappedSuperclassOneToManyChild Resource */ @Bean public MappedSuperclassOneToManyChildMaintenanceResource mappedsuperclassonetomanychildResource() { return feignBuilder().logger(new Slf4jLogger(MappedSuperclassOneToManyChildMaintenanceResource.class)).target( MappedSuperclassOneToManyChildMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving ServiceEntityExample related data. * * @return The configured ServiceEntityExample Resource */ @Bean public ServiceEntityExampleMaintenanceResource serviceentityexampleResource() { return feignBuilder().logger(new Slf4jLogger(ServiceEntityExampleMaintenanceResource.class)).target( ServiceEntityExampleMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving TableNameMismatch related data. * * @return The configured TableNameMismatch Resource */ @Bean public TableNameMismatchMaintenanceResource tablenamemismatchResource() { return feignBuilder().logger(new Slf4jLogger(TableNameMismatchMaintenanceResource.class)).target( TableNameMismatchMaintenanceResource.class, getEndpoint()); }
/** * Resource for retrieving ValidationReferencedObject related data. * * @return The configured ValidationReferencedObject Resource */ @Bean public ValidationReferencedObjectMaintenanceResource validationreferencedobjectResource() { return feignBuilder().logger(new Slf4jLogger(ValidationReferencedObjectMaintenanceResource.class)).target( ValidationReferencedObjectMaintenanceResource.class, getEndpoint()); }
private static DCOS buildInstance(String endpoint, Consumer<Feign.Builder> customize) { GsonDecoder decoder = new GsonDecoder(ModelUtils.GSON); GsonEncoder encoder = new GsonEncoder(ModelUtils.GSON); Feign.Builder builder = Feign.builder() .encoder(encoder) .decoder(decoder) .errorDecoder(new DCOSErrorDecoder()); customize.accept(builder); builder.requestInterceptor(new DCOSAPIInterceptor()); return builder.target(DCOS.class, endpoint); }