mirror of
https://github.com/Telecominfraproject/wlan-cloud-base.git
synced 2026-03-20 18:38:59 +00:00
Compare commits
13 Commits
revert-Com
...
WIFI-4732
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd60273495 | ||
|
|
704f5c6047 | ||
|
|
b7d396c6ce | ||
|
|
e8dd8724fb | ||
|
|
267fb477a3 | ||
|
|
04c844c2e2 | ||
|
|
72da490a3b | ||
|
|
bb9c3ba1eb | ||
|
|
7dd594644e | ||
|
|
4c15a9650b | ||
|
|
5c3bf48780 | ||
|
|
be09681087 | ||
|
|
a7076e523b |
@@ -1,7 +1,5 @@
|
||||
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;
|
||||
@@ -22,7 +20,8 @@ public abstract class BaseRemoteClient {
|
||||
protected HttpHeaders headers = new HttpHeaders();
|
||||
|
||||
{
|
||||
headers.setContentType(new MediaType("application", "json", StandardCharsets.UTF_8));
|
||||
// Note: APPLICATION_JSON_UTF8 is deprecated
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
//Accept-Encoding: gzip,deflate
|
||||
headers.set("Accept-Encoding", "gzip,deflate");
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ 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;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class ExceptionPropagatingErrorHandler extends DefaultResponseErrorHandle
|
||||
public void handleError(ClientHttpResponse response) throws IOException {
|
||||
try {
|
||||
super.handleError(response);
|
||||
} catch (HttpServerErrorException e) {
|
||||
} catch (HttpServerErrorException | HttpClientErrorException e) {
|
||||
// look in the response object, and if it contains any of the
|
||||
// exceptions we recognize - throw that exception instead of the
|
||||
// HttpServerErrorException
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
package com.telecominfraproject.wlan.core.model.equipment;
|
||||
|
||||
public enum LedStatus {
|
||||
led_on,
|
||||
led_off,
|
||||
led_blink,
|
||||
UNKNOWN;
|
||||
}
|
||||
@@ -82,9 +82,10 @@ public class MacAddress extends BaseJsonModel implements Comparable<MacAddress>
|
||||
}
|
||||
|
||||
sb.setLength(sb.length() - 1);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@@ -163,7 +164,7 @@ public class MacAddress extends BaseJsonModel implements Comparable<MacAddress>
|
||||
|
||||
|
||||
private static byte[] stringToByteArray(String str) {
|
||||
if (str == null)
|
||||
if (str == null || str.equals(""))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -300,7 +301,7 @@ public class MacAddress extends BaseJsonModel implements Comparable<MacAddress>
|
||||
|
||||
byte[] bval = stringToByteArray(macStr);
|
||||
|
||||
if (bval.length >= 6) {
|
||||
if (bval != null && bval.length >= 6) {
|
||||
long mac = 0;
|
||||
for (var i = 0; i < 6; i++) {
|
||||
long t = (bval[i] & 0xffL) << ((5 - i) * 8);
|
||||
|
||||
@@ -73,5 +73,19 @@ 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