-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
Binary file added
BIN
+514 Bytes
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725.ca.jks
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725.client.chain.crt
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,27 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBuTCCAT6gAwIBAgIJAJyocudrOQz/MAoGCCqGSM49BAMCMBoxGDAWBgNVBAMM | ||
D2NhLmVhYS5vcGVubmVzczAeFw0yMDA3MjIxMDIzMDBaFw0yMzA3MjIxMDIzMDBa | ||
MBoxGDAWBgNVBAMMD2NhLmVhYS5vcGVubmVzczB2MBAGByqGSM49AgEGBSuBBAAi | ||
A2IABJ6Pp2KBXz99OZXmE6apCHwhedyA3preCioHnfkfMS/FPz5KXg0zQi75N6ap | ||
Nr5APeerDsvzS+I9cm4hXiLpTOdufFxHfBF5sJE1w+U2F+sObDygfVlHuelHLABF | ||
VkE3CaNQME4wHQYDVR0OBBYEFPfn70Y5sxgZ5aXmungdnYuo4QUeMB8GA1UdIwQY | ||
MBaAFPfn70Y5sxgZ5aXmungdnYuo4QUeMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0E | ||
AwIDaQAwZgIxAJWjHlvd80Y6yvx7Gt9CdENCA+tmkw3ZDPZx/lCuMIcf7bdW8cTB | ||
HY+Ij2FQdZlb6AIxANlDzlxBfLh9q5K/DycPDkYqHKPZKSEwjjlfl6Noa++MtT5D | ||
f0Aj5LwjHHA/FvZm2g== | ||
-----END CERTIFICATE----- | ||
-----BEGIN CERTIFICATE----- | ||
MIIBljCCARugAwIBAgIIsfTo7cW6Sq0wCgYIKoZIzj0EAwIwGjEYMBYGA1UEAwwP | ||
Y2EuZWFhLm9wZW5uZXNzMB4XDTIwMTEwMjE1NDkzM1oXDTIzMDcyMjEwMjMwMFow | ||
QjEUMBIGA1UEChMLRElQSVVuaU1vcmUxKjAoBgNVBAMTIWNvbnN1bWVyZGVtbzpv | ||
cGVubmVzc0NvbnN1bWVyRGVtbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDQD | ||
FUu96psW2X+YwOn29hN7YRIrjxqivdZUgBApWJj6NkwbJ0Fjc9ctW4Qe1PDmuW0D | ||
grfb7BtXwtY9XjWJXb6jIzAhMB8GA1UdIwQYMBaAFPfn70Y5sxgZ5aXmungdnYuo | ||
4QUeMAoGCCqGSM49BAMCA2kAMGYCMQCfasd5JNFt2LFXlFxrLupWFxje6+ISLWQH | ||
6IqpGP9IhtA/jYutR3y/Zf3tnR7zb9YCMQD01TjX2UAYCFJppcM2ADOX+4HJN2GW | ||
2/Z96lNNDtL7Mav3d8nBpCBx0mt/rwa5PGg= | ||
-----END CERTIFICATE----- | ||
-----BEGIN PRIVATE KEY----- | ||
MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCD+dHJ3ccevJIwZ+BUl | ||
Zi1tG1iBRCDFLF3Be61437FJ5Q== | ||
-----END PRIVATE KEY----- |
Binary file added
BIN
+1.46 KB
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725.client.p12
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725.crt
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,11 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBljCCARugAwIBAgIIsfTo7cW6Sq0wCgYIKoZIzj0EAwIwGjEYMBYGA1UEAwwP | ||
Y2EuZWFhLm9wZW5uZXNzMB4XDTIwMTEwMjE1NDkzM1oXDTIzMDcyMjEwMjMwMFow | ||
QjEUMBIGA1UEChMLRElQSVVuaU1vcmUxKjAoBgNVBAMTIWNvbnN1bWVyZGVtbzpv | ||
cGVubmVzc0NvbnN1bWVyRGVtbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDQD | ||
FUu96psW2X+YwOn29hN7YRIrjxqivdZUgBApWJj6NkwbJ0Fjc9ctW4Qe1PDmuW0D | ||
grfb7BtXwtY9XjWJXb6jIzAhMB8GA1UdIwQYMBaAFPfn70Y5sxgZ5aXmungdnYuo | ||
4QUeMAoGCCqGSM49BAMCA2kAMGYCMQCfasd5JNFt2LFXlFxrLupWFxje6+ISLWQH | ||
6IqpGP9IhtA/jYutR3y/Zf3tnR7zb9YCMQD01TjX2UAYCFJppcM2ADOX+4HJN2GW | ||
2/Z96lNNDtL7Mav3d8nBpCBx0mt/rwa5PGg= | ||
-----END CERTIFICATE----- |
12 changes: 12 additions & 0 deletions
12
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725_ca_chain.crt
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,12 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBuTCCAT6gAwIBAgIJAJyocudrOQz/MAoGCCqGSM49BAMCMBoxGDAWBgNVBAMM | ||
D2NhLmVhYS5vcGVubmVzczAeFw0yMDA3MjIxMDIzMDBaFw0yMzA3MjIxMDIzMDBa | ||
MBoxGDAWBgNVBAMMD2NhLmVhYS5vcGVubmVzczB2MBAGByqGSM49AgEGBSuBBAAi | ||
A2IABJ6Pp2KBXz99OZXmE6apCHwhedyA3preCioHnfkfMS/FPz5KXg0zQi75N6ap | ||
Nr5APeerDsvzS+I9cm4hXiLpTOdufFxHfBF5sJE1w+U2F+sObDygfVlHuelHLABF | ||
VkE3CaNQME4wHQYDVR0OBBYEFPfn70Y5sxgZ5aXmungdnYuo4QUeMB8GA1UdIwQY | ||
MBaAFPfn70Y5sxgZ5aXmungdnYuo4QUeMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0E | ||
AwIDaQAwZgIxAJWjHlvd80Y6yvx7Gt9CdENCA+tmkw3ZDPZx/lCuMIcf7bdW8cTB | ||
HY+Ij2FQdZlb6AIxANlDzlxBfLh9q5K/DycPDkYqHKPZKSEwjjlfl6Noa++MtT5D | ||
f0Aj5LwjHHA/FvZm2g== | ||
-----END CERTIFICATE----- |
12 changes: 12 additions & 0 deletions
12
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725_ca_pool.crt
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,12 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBuTCCAT6gAwIBAgIJAJyocudrOQz/MAoGCCqGSM49BAMCMBoxGDAWBgNVBAMM | ||
D2NhLmVhYS5vcGVubmVzczAeFw0yMDA3MjIxMDIzMDBaFw0yMzA3MjIxMDIzMDBa | ||
MBoxGDAWBgNVBAMMD2NhLmVhYS5vcGVubmVzczB2MBAGByqGSM49AgEGBSuBBAAi | ||
A2IABJ6Pp2KBXz99OZXmE6apCHwhedyA3preCioHnfkfMS/FPz5KXg0zQi75N6ap | ||
Nr5APeerDsvzS+I9cm4hXiLpTOdufFxHfBF5sJE1w+U2F+sObDygfVlHuelHLABF | ||
VkE3CaNQME4wHQYDVR0OBBYEFPfn70Y5sxgZ5aXmungdnYuo4QUeMB8GA1UdIwQY | ||
MBaAFPfn70Y5sxgZ5aXmungdnYuo4QUeMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0E | ||
AwIDaQAwZgIxAJWjHlvd80Y6yvx7Gt9CdENCA+tmkw3ZDPZx/lCuMIcf7bdW8cTB | ||
HY+Ij2FQdZlb6AIxANlDzlxBfLh9q5K/DycPDkYqHKPZKSEwjjlfl6Noa++MtT5D | ||
f0Aj5LwjHHA/FvZm2g== | ||
-----END CERTIFICATE----- |
4 changes: 4 additions & 0 deletions
4
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725_id
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,4 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCD+dHJ3ccevJIwZ+BUl | ||
Zi1tG1iBRCDFLF3Be61437FJ5Q== | ||
-----END PRIVATE KEY----- |
4 changes: 4 additions & 0 deletions
4
certs/9deee18b10f2ca7876bae2cb3b594d0b222c6817cf2f067e1115d91d5225d725_id.pub
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,4 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENAMVS73qmxbZf5jA6fb2E3thEiuP | ||
GqK91lSAEClYmPo2TBsnQWNz1y1bhB7U8Oa5bQOCt9vsG1fC1j1eNYldvg== | ||
-----END PUBLIC KEY----- |
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
44 changes: 44 additions & 0 deletions
44
src/main/java/it/unimore/dipi/openness/consumer/MyNotificationsHandler.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,44 @@ | ||
package it.unimore.dipi.openness.consumer; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import it.unimore.dipi.iot.openness.dto.service.NotificationToConsumer; | ||
import it.unimore.dipi.iot.openness.dto.service.TerminateNotification; | ||
import it.unimore.dipi.iot.openness.notification.AbstractWebSocketHandler; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* @author Stefano Mariani, Ph.D. - [email protected] | ||
* @project openness-connector | ||
* @created 07/10/2020 - 14:03 | ||
*/ | ||
public class MyNotificationsHandler extends AbstractWebSocketHandler { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(MyNotificationsHandler.class); | ||
private ObjectMapper objectMapper; | ||
|
||
public MyNotificationsHandler() { | ||
this.objectMapper = new ObjectMapper(); | ||
} | ||
|
||
@Override | ||
public void onWebSocketText(String msg) { | ||
|
||
logger.info("Message got: {}", msg); | ||
|
||
try { | ||
final NotificationToConsumer shutdown = this.objectMapper.readValue(msg, NotificationToConsumer.class); | ||
final TerminateNotification tn = new TerminateNotification(); | ||
if (shutdown.getName().equals(tn.getName()) && shutdown.getVersion().equals(tn.getVersion())) { | ||
logger.info("Received notifications termination request, closing web socket..."); | ||
session.close(); | ||
session.disconnect(); | ||
} | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} |
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