Skip to content

Commit

Permalink
Release 2.2.0 (#6)
Browse files Browse the repository at this point in the history
* fix LB issues when hosts are created with no name

* added automatic JSON marshalling via JAXB or POJO (using Jackson 1.9.13)
  • Loading branch information
twincitiesguy authored Feb 24, 2018
1 parent b381697 commit 760a7b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ buildscript {
apply from: "$commonBuildDir/ecs-publish.gradle"

dependencies {
compile 'com.sun.jersey:jersey-client:1.19.3',
'com.sun.jersey.contribs:jersey-apache-client4:1.19.3',
compile 'com.sun.jersey:jersey-client:1.19.4',
'com.sun.jersey.contribs:jersey-apache-client4:1.19.4',
'org.codehaus.jackson:jackson-jaxrs:1.9.13',
'org.codehaus.jackson:jackson-xc:1.9.13',
'org.apache.httpcomponents:httpclient:4.2.6',
'org.slf4j:slf4j-api:1.7.5'
compile('com.sun.jersey:jersey-json:1.19.4') {
exclude group: 'org.codehaus.jackson'
}
runtime 'org.slf4j:slf4j-log4j12:1.7.5'
testCompile 'junit:junit:4.12',
'log4j:log4j:1.2.17'
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/emc/rest/smart/Host.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class Host implements HostStats {
* @param name the host name or IP address of this host
*/
public Host(String name) {
if (name == null) throw new NullPointerException();
this.name = name;
}

Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/emc/rest/smart/SmartClientFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
*/
package com.emc.rest.smart;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientHandler;
import com.sun.jersey.api.client.config.ClientConfig;
Expand All @@ -39,6 +36,9 @@
import com.sun.jersey.core.impl.provider.entity.ByteArrayProvider;
import com.sun.jersey.core.impl.provider.entity.FileProvider;
import com.sun.jersey.core.impl.provider.entity.InputStreamProvider;
import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class SmartClientFactory {

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

// add JSON support (using Jackson's ObjectMapper instead of JAXB marshalling)
clientConfig.getClasses().add(JacksonJaxbJsonProvider.class);

// build Jersey client
return new Client(clientHandler, clientConfig);
}
Expand Down

0 comments on commit 760a7b7

Please sign in to comment.