-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from SoftwareAG/develop
Adding monitoring of connector connections
- Loading branch information
Showing
67 changed files
with
1,793 additions
and
1,687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
dynamic-mapping-service/src/main/java/dynamic/mapping/core/ConnectorStatusEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright (c) 2022 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, | ||
* and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed 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. | ||
* | ||
* @authors Christof Strack, Stefan Witschel | ||
*/ | ||
|
||
package dynamic.mapping.core; | ||
|
||
import java.io.Serializable; | ||
import java.text.DateFormat; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class ConnectorStatusEvent implements Serializable { | ||
@NotNull | ||
public ConnectorStatus status; | ||
|
||
@NotNull | ||
public String message; | ||
|
||
@NotNull | ||
public String date; | ||
|
||
public ConnectorStatusEvent() { | ||
this.status = ConnectorStatus.UNKNOWN; | ||
} | ||
|
||
public ConnectorStatusEvent(ConnectorStatus status) { | ||
this.status = status; | ||
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
Date now = new Date(); | ||
this.date = dateFormat.format(now); | ||
this.message = ""; | ||
} | ||
|
||
public static ConnectorStatusEvent connected() { | ||
return new ConnectorStatusEvent(ConnectorStatus.CONNECTED); | ||
} | ||
|
||
public static ConnectorStatusEvent disconnected() { | ||
return new ConnectorStatusEvent(ConnectorStatus.DISCONNECTED); | ||
} | ||
|
||
public static ConnectorStatusEvent enabled() { | ||
return new ConnectorStatusEvent(ConnectorStatus.ENABLED); | ||
} | ||
|
||
public static ConnectorStatusEvent failed(String errorMessage) { | ||
return new ConnectorStatusEvent(ConnectorStatus.FAILED); | ||
} | ||
|
||
public static ConnectorStatusEvent unknown() { | ||
return new ConnectorStatusEvent(ConnectorStatus.UNKNOWN); | ||
} | ||
|
||
public void updateStatus(ConnectorStatus st) { | ||
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
Date now = new Date(); | ||
date = dateFormat.format(now); | ||
status = st; | ||
} | ||
|
||
public void clearMessage() { | ||
this.message = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
dynamic-mapping-service/src/main/java/dynamic/mapping/core/Status.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.