Compare commits

..

1 Commits

Author SHA1 Message Date
Thomas Currie
f12ab10ec6 revert basepackage change 2021-06-14 17:06:30 -04:00
5 changed files with 8 additions and 18 deletions

View File

@@ -1,5 +1,7 @@
package com.telecominfraproject.wlan.core.client;
import java.nio.charset.StandardCharsets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpHeaders;
@@ -20,8 +22,7 @@ public abstract class BaseRemoteClient {
protected HttpHeaders headers = new HttpHeaders();
{
// Note: APPLICATION_JSON_UTF8 is deprecated
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setContentType(new MediaType("application", "json", StandardCharsets.UTF_8));
//Accept-Encoding: gzip,deflate
headers.set("Accept-Encoding", "gzip,deflate");
}

View File

@@ -8,7 +8,6 @@ import org.springframework.core.task.TaskRejectedException;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.HttpServerErrorException;
import org.springframework.web.client.ResponseErrorHandler;
@@ -39,7 +38,7 @@ public class ExceptionPropagatingErrorHandler extends DefaultResponseErrorHandle
public void handleError(ClientHttpResponse response) throws IOException {
try {
super.handleError(response);
} catch (HttpServerErrorException | HttpClientErrorException e) {
} catch (HttpServerErrorException e) {
// look in the response object, and if it contains any of the
// exceptions we recognize - throw that exception instead of the
// HttpServerErrorException

View File

@@ -20,7 +20,7 @@ import com.telecominfraproject.wlan.core.model.json.JsonSerializedException;
/**
* @author dtoptygin
*/
@ControllerAdvice(basePackages = "com.telecominfraproject")
//@ControllerAdvice(basePackages = "com.telecominfraproject")
public class CommonControllerAdvice {
private static final Logger LOG = LoggerFactory.getLogger(CommonControllerAdvice.class);

View File

@@ -1,9 +0,0 @@
package com.telecominfraproject.wlan.core.model.equipment;
public enum LedStatus {
led_on,
led_off,
led_blink,
UNKNOWN;
}

View File

@@ -82,10 +82,9 @@ public class MacAddress extends BaseJsonModel implements Comparable<MacAddress>
}
sb.setLength(sb.length() - 1);
return sb.toString();
}
return null;
return sb.toString();
}
@JsonIgnore
@@ -164,7 +163,7 @@ public class MacAddress extends BaseJsonModel implements Comparable<MacAddress>
private static byte[] stringToByteArray(String str) {
if (str == null || str.equals(""))
if (str == null)
{
return null;
}
@@ -301,7 +300,7 @@ public class MacAddress extends BaseJsonModel implements Comparable<MacAddress>
byte[] bval = stringToByteArray(macStr);
if (bval != null && bval.length >= 6) {
if (bval.length >= 6) {
long mac = 0;
for (var i = 0; i < 6; i++) {
long t = (bval[i] & 0xffL) << ((5 - i) * 8);