Search in sources :

Example 21 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getSearchService.

protected SearchService getSearchService() {
    SearchService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", SearchService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000L);
    return service;
}
Also used : SearchService(org.apache.archiva.rest.api.services.SearchService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Example 22 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getUserService.

protected UserService getUserService(String authzHeader) {
    UserService service = JAXRSClientFactory.create("http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/", UserService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    // for debuging purpose
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(3000000L);
    if (authzHeader != null) {
        WebClient.client(service).header("Authorization", authzHeader);
    }
    return service;
}
Also used : UserService(org.apache.archiva.redback.rest.api.services.UserService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Example 23 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getRemoteRepositoriesService.

protected RemoteRepositoriesService getRemoteRepositoriesService() {
    RemoteRepositoriesService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", RemoteRepositoriesService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000L);
    return service;
}
Also used : RemoteRepositoriesService(org.apache.archiva.rest.api.services.RemoteRepositoriesService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Example 24 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getRepositoryGroupService.

protected RepositoryGroupService getRepositoryGroupService() {
    RepositoryGroupService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", RepositoryGroupService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000L);
    return service;
}
Also used : RepositoryGroupService(org.apache.archiva.rest.api.services.RepositoryGroupService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Example 25 with JacksonJaxbJsonProvider

use of com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider in project archiva by apache.

the class AbstractDownloadTest method getManagedRepositoriesService.

protected ManagedRepositoriesService getManagedRepositoriesService() {
    ManagedRepositoriesService service = JAXRSClientFactory.create(getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/", ManagedRepositoriesService.class, Collections.singletonList(new JacksonJaxbJsonProvider()));
    WebClient.client(service).header("Authorization", authorizationHeader);
    WebClient.client(service).header("Referer", "http://localhost:" + port);
    WebClient.getConfig(service).getHttpConduit().getClient().setReceiveTimeout(300000L);
    return service;
}
Also used : ManagedRepositoriesService(org.apache.archiva.rest.api.services.ManagedRepositoriesService) JacksonJaxbJsonProvider(com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)

Aggregations

JacksonJaxbJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)35 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)5 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 URI (java.net.URI)3 Response (javax.ws.rs.core.Response)3 JacksonJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider)2 Provides (com.google.inject.Provides)2 Singleton (com.google.inject.Singleton)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 Annotation (java.lang.annotation.Annotation)2 ElementType (java.lang.annotation.ElementType)2 Retention (java.lang.annotation.Retention)2 RetentionPolicy (java.lang.annotation.RetentionPolicy)2 Target (java.lang.annotation.Target)2 Method (java.lang.reflect.Method)2 Type (java.lang.reflect.Type)2