mirror of
https://github.com/Telecominfraproject/wlan-cloud-base.git
synced 2026-03-20 16:39:02 +00:00
Compare commits
1 Commits
WIFI-4732
...
revert-Com
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f12ab10ec6 |
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
package com.telecominfraproject.wlan.core.model.equipment;
|
||||
|
||||
public enum LedStatus {
|
||||
led_on,
|
||||
led_off,
|
||||
led_blink,
|
||||
UNKNOWN;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -73,19 +73,5 @@ public enum RadioType {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getRadioDisplayString(RadioType radioType) {
|
||||
// This display format matches UI
|
||||
switch (radioType) {
|
||||
case is2dot4GHz:
|
||||
return "2.4GHz";
|
||||
case is5GHz:
|
||||
return "5GHz";
|
||||
case is5GHzU:
|
||||
return "5GHz (U)";
|
||||
case is5GHzL:
|
||||
return "5GHz (L)";
|
||||
default:
|
||||
return radioType.name();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user