Skip to content

Commit 760a7b7

Browse files
Release 2.2.0 (#6)
* fix LB issues when hosts are created with no name * added automatic JSON marshalling via JAXB or POJO (using Jackson 1.9.13)
1 parent b381697 commit 760a7b7

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ buildscript {
3737
apply from: "$commonBuildDir/ecs-publish.gradle"
3838

3939
dependencies {
40-
compile 'com.sun.jersey:jersey-client:1.19.3',
41-
'com.sun.jersey.contribs:jersey-apache-client4:1.19.3',
40+
compile 'com.sun.jersey:jersey-client:1.19.4',
41+
'com.sun.jersey.contribs:jersey-apache-client4:1.19.4',
42+
'org.codehaus.jackson:jackson-jaxrs:1.9.13',
43+
'org.codehaus.jackson:jackson-xc:1.9.13',
4244
'org.apache.httpcomponents:httpclient:4.2.6',
4345
'org.slf4j:slf4j-api:1.7.5'
46+
compile('com.sun.jersey:jersey-json:1.19.4') {
47+
exclude group: 'org.codehaus.jackson'
48+
}
4449
runtime 'org.slf4j:slf4j-log4j12:1.7.5'
4550
testCompile 'junit:junit:4.12',
4651
'log4j:log4j:1.2.17'

src/main/java/com/emc/rest/smart/Host.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class Host implements HostStats {
6464
* @param name the host name or IP address of this host
6565
*/
6666
public Host(String name) {
67+
if (name == null) throw new NullPointerException();
6768
this.name = name;
6869
}
6970

src/main/java/com/emc/rest/smart/SmartClientFactory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
*/
2727
package com.emc.rest.smart;
2828

29-
import org.slf4j.Logger;
30-
import org.slf4j.LoggerFactory;
31-
3229
import com.sun.jersey.api.client.Client;
3330
import com.sun.jersey.api.client.ClientHandler;
3431
import com.sun.jersey.api.client.config.ClientConfig;
@@ -39,6 +36,9 @@
3936
import com.sun.jersey.core.impl.provider.entity.ByteArrayProvider;
4037
import com.sun.jersey.core.impl.provider.entity.FileProvider;
4138
import com.sun.jersey.core.impl.provider.entity.InputStreamProvider;
39+
import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
40+
import org.slf4j.Logger;
41+
import org.slf4j.LoggerFactory;
4242

4343
public final class SmartClientFactory {
4444

@@ -105,6 +105,9 @@ public static Client createStandardClient(SmartConfig smartConfig,
105105
// add support for XML with no content-type
106106
clientConfig.getClasses().add(OctetStreamXmlProvider.class);
107107

108+
// add JSON support (using Jackson's ObjectMapper instead of JAXB marshalling)
109+
clientConfig.getClasses().add(JacksonJaxbJsonProvider.class);
110+
108111
// build Jersey client
109112
return new Client(clientHandler, clientConfig);
110113
}

0 commit comments

Comments
 (0)