mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
refactoring and adding proper licenses
This commit is contained in:
parent
37ef7b9047
commit
5ca299530e
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>task-allocation</artifactId>
|
<artifactId>heartbeat-management</artifactId>
|
||||||
<version>4.1.11-SNAPSHOT</version>
|
<version>4.1.11-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -14,8 +14,8 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon;
|
package io.entgra.server.bootup.heartbeat.beacon;
|
||||||
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.exception.InvalidConfigurationStateException;
|
import io.entgra.server.bootup.heartbeat.beacon.exception.InvalidConfigurationStateException;
|
||||||
@ -34,7 +34,8 @@ public class HeartBeatBeaconConfig {
|
|||||||
|
|
||||||
private int notifierFrequency;
|
private int notifierFrequency;
|
||||||
private int notifierDelay;
|
private int notifierDelay;
|
||||||
private int serverTimeOutInterval;
|
private int serverTimeOutIntervalInSeconds;
|
||||||
|
private int timeSkew;
|
||||||
|
|
||||||
private static HeartBeatBeaconConfig config;
|
private static HeartBeatBeaconConfig config;
|
||||||
|
|
||||||
@ -70,13 +71,22 @@ public class HeartBeatBeaconConfig {
|
|||||||
this.notifierFrequency = notifierFrequency;
|
this.notifierFrequency = notifierFrequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement(name = "ServerTimeOutIntervalInSeconds", required = true)
|
@XmlElement(name = "timeSkew", required = true)
|
||||||
public int getServerTimeOutIntervalInSeconds() {
|
public int getTimeSkew() {
|
||||||
return serverTimeOutInterval;
|
return timeSkew;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setServerTimeOutInterval(int serverTimeOutInterval) {
|
public void setTimeSkew(int timeSkew) {
|
||||||
this.serverTimeOutInterval = serverTimeOutInterval;
|
this.timeSkew = timeSkew;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "ServerTimeOutIntervalInSeconds", required = true)
|
||||||
|
public int getServerTimeOutIntervalInSeconds() {
|
||||||
|
return serverTimeOutIntervalInSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerTimeOutIntervalInSeconds(int serverTimeOutIntervalInSeconds) {
|
||||||
|
this.serverTimeOutIntervalInSeconds = serverTimeOutIntervalInSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init() throws HeartBeatBeaconConfigurationException {
|
public static void init() throws HeartBeatBeaconConfigurationException {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -14,8 +14,8 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon;
|
package io.entgra.server.bootup.heartbeat.beacon;
|
||||||
|
|
||||||
public class HeartBeatBeaconConfigurationException extends Exception {
|
public class HeartBeatBeaconConfigurationException extends Exception {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -15,6 +15,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon;
|
package io.entgra.server.bootup.heartbeat.beacon;
|
||||||
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.dto.ServerContext;
|
import io.entgra.server.bootup.heartbeat.beacon.dto.ServerContext;
|
||||||
@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* you may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* you may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.entgra.server.bootup.heartbeat.beacon.dto;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
public class HeartBeatEvent {
|
||||||
|
|
||||||
|
private String serverUUID;
|
||||||
|
private Timestamp time;
|
||||||
|
|
||||||
|
public HeartBeatEvent(String serverUUID){
|
||||||
|
this.serverUUID = serverUUID;
|
||||||
|
this.time = new Timestamp(System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServerUUID() {
|
||||||
|
return serverUUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServerUUID(String serverUUID) {
|
||||||
|
this.serverUUID = serverUUID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Timestamp getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(Timestamp time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -14,8 +14,8 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.dto;
|
package io.entgra.server.bootup.heartbeat.beacon.dto;
|
||||||
|
|
||||||
public class ServerContext {
|
public class ServerContext {
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
|
* in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.entgra.server.bootup.heartbeat.beacon.exception;
|
||||||
|
|
||||||
|
public class HeartBeatManagementException extends Exception {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5304352685379661115L;
|
||||||
|
|
||||||
|
public HeartBeatManagementException(String msg, Exception nestedEx) {
|
||||||
|
super(msg, nestedEx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeartBeatManagementException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeartBeatManagementException(String msg) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeartBeatManagementException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeartBeatManagementException(Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -14,8 +14,8 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.exception;
|
package io.entgra.server.bootup.heartbeat.beacon.exception;
|
||||||
|
|
||||||
public class InvalidConfigurationStateException extends RuntimeException {
|
public class InvalidConfigurationStateException extends RuntimeException {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -14,8 +14,8 @@
|
|||||||
* KIND, either express or implied. See the License for the
|
* KIND, either express or implied. See the License for the
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.exception;
|
package io.entgra.server.bootup.heartbeat.beacon.exception;
|
||||||
|
|
||||||
public class ServerStatusUpdationFailedException extends Exception {
|
public class ServerStatusUpdationFailedException extends Exception {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -15,6 +15,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.internal;
|
package io.entgra.server.bootup.heartbeat.beacon.internal;
|
||||||
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.HeartBeatBeaconConfig;
|
import io.entgra.server.bootup.heartbeat.beacon.HeartBeatBeaconConfig;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.internal;
|
package io.entgra.server.bootup.heartbeat.beacon.internal;
|
||||||
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.dto.ServerContext;
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.service.HeartBeatManagementService;
|
import io.entgra.server.bootup.heartbeat.beacon.service.HeartBeatManagementService;
|
||||||
|
|
||||||
public class HeartBeatBeaconDataHolder {
|
public class HeartBeatBeaconDataHolder {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -15,6 +15,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.internal;
|
package io.entgra.server.bootup.heartbeat.beacon.internal;
|
||||||
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.HeartBeatBeaconConfig;
|
import io.entgra.server.bootup.heartbeat.beacon.HeartBeatBeaconConfig;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -15,6 +15,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.service;
|
package io.entgra.server.bootup.heartbeat.beacon.service;
|
||||||
|
|
||||||
import io.entgra.server.bootup.heartbeat.beacon.dto.HeartBeatEvent;
|
import io.entgra.server.bootup.heartbeat.beacon.dto.HeartBeatEvent;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
* Copyright (c) 2020, Entgra Pvt Ltd. (http://www.wso2.org) All Rights Reserved.
|
||||||
*
|
*
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
* Entgra Pvt Ltd. licenses this file to you under the Apache License,
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
* Version 2.0 (the "License"); you may not use this file except
|
||||||
* in compliance with the License.
|
* in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
@ -44,8 +44,10 @@ public class HeartBeatManagementServiceImpl implements HeartBeatManagementServic
|
|||||||
heartBeatDAO = HeartBeatBeaconDAOFactory.getHeartBeatDAO();
|
heartBeatDAO = HeartBeatBeaconDAOFactory.getHeartBeatDAO();
|
||||||
|
|
||||||
int timeOutIntervalInSeconds = HeartBeatBeaconConfig.getInstance().getServerTimeOutIntervalInSeconds();
|
int timeOutIntervalInSeconds = HeartBeatBeaconConfig.getInstance().getServerTimeOutIntervalInSeconds();
|
||||||
|
int timeSkew = HeartBeatBeaconConfig.getInstance().getTimeSkew();
|
||||||
|
int cumilativeTimeOut = timeOutIntervalInSeconds + timeSkew;
|
||||||
String localServerUUID = HeartBeatBeaconDataHolder.getInstance().getLocalServerUUID();
|
String localServerUUID = HeartBeatBeaconDataHolder.getInstance().getLocalServerUUID();
|
||||||
Map<String, ServerContext> serverCtxMap = heartBeatDAO.getActiveServerDetails(timeOutIntervalInSeconds);
|
Map<String, ServerContext> serverCtxMap = heartBeatDAO.getActiveServerDetails(cumilativeTimeOut);
|
||||||
if(!serverCtxMap.isEmpty()) {
|
if(!serverCtxMap.isEmpty()) {
|
||||||
localServerCtx = serverCtxMap.get(localServerUUID);
|
localServerCtx = serverCtxMap.get(localServerUUID);
|
||||||
if (localServerCtx != null) {
|
if (localServerCtx != null) {
|
||||||
@ -27,7 +27,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>task-allocation</artifactId>
|
<artifactId>heartbeat-management</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Entgra - Task Allocation Framework</name>
|
<name>Entgra - Task Allocation Framework</name>
|
||||||
<url>http://wso2.org</url>
|
<url>http://wso2.org</url>
|
||||||
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.dto;
|
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
|
|
||||||
public class HeartBeatEvent {
|
|
||||||
|
|
||||||
private String serverUUID;
|
|
||||||
private Timestamp time;
|
|
||||||
|
|
||||||
public HeartBeatEvent(String serverUUID){
|
|
||||||
this.serverUUID = serverUUID;
|
|
||||||
this.time = new Timestamp(System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getServerUUID() {
|
|
||||||
return serverUUID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setServerUUID(String serverUUID) {
|
|
||||||
this.serverUUID = serverUUID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Timestamp getTime() {
|
|
||||||
return time;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(Timestamp time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
||||||
* Version 2.0 (the "License"); you may not use this file except
|
|
||||||
* in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package io.entgra.server.bootup.heartbeat.beacon.exception;
|
|
||||||
|
|
||||||
public class HeartBeatManagementException extends Exception {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 5304352685379661115L;
|
|
||||||
|
|
||||||
public HeartBeatManagementException(String msg, Exception nestedEx) {
|
|
||||||
super(msg, nestedEx);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HeartBeatManagementException(String message, Throwable cause) {
|
|
||||||
super(message, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HeartBeatManagementException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HeartBeatManagementException() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HeartBeatManagementException(Throwable cause) {
|
|
||||||
super(cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
2
pom.xml
2
pom.xml
@ -35,7 +35,7 @@
|
|||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>components/task-allocation</module>
|
<module>components/heartbeat-management</module>
|
||||||
<module>components/device-mgt</module>
|
<module>components/device-mgt</module>
|
||||||
<module>components/device-mgt-extensions</module>
|
<module>components/device-mgt-extensions</module>
|
||||||
<module>components/identity-extensions</module>
|
<module>components/identity-extensions</module>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user