-
Notifications
You must be signed in to change notification settings - Fork 161
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 #3924 from elbert3/feature-disconnectDevice
Feature - Add option to disconnect a device from the broker
Showing
29 changed files
with
734 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2023, 2022 Eurotech and/or its affiliates and others | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
Eurotech - initial API and implementation | ||
--> | ||
<!DOCTYPE xml> | ||
<locator-config> | ||
<provided> | ||
<provide> | ||
<interceptor>annotation</interceptor> | ||
<with>Impl</with> | ||
</provide> | ||
</provided> | ||
|
||
<packages> | ||
<package>org.eclipse.kapua.commons</package> | ||
<package>org.eclipse.kapua.message</package> | ||
<package>org.eclipse.kapua.service</package> | ||
</packages> | ||
</locator-config> |
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
46 changes: 46 additions & 0 deletions
46
...main/java/org/eclipse/kapua/broker/artemis/plugin/security/BrokerJAXBContextProvider.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,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023, 2022 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.broker.artemis.plugin.security; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import javax.xml.bind.JAXBContext; | ||
import javax.xml.bind.JAXBException; | ||
|
||
import org.eclipse.kapua.commons.util.xml.JAXBContextProvider; | ||
import org.eclipse.kapua.event.ServiceEvent; | ||
import org.eclipse.persistence.jaxb.JAXBContextFactory; | ||
import org.eclipse.persistence.jaxb.MarshallerProperties; | ||
|
||
public class BrokerJAXBContextProvider implements JAXBContextProvider { | ||
|
||
private JAXBContext context; | ||
|
||
@Override | ||
public JAXBContext getJAXBContext() { | ||
try { | ||
if (context == null) { | ||
Map<String, Object> properties = new HashMap<>(1); | ||
properties.put(MarshallerProperties.JSON_WRAPPER_AS_ARRAY_NAME, true); | ||
context = JAXBContextFactory.createContext(new Class<?>[]{ | ||
// KapuaEvent | ||
ServiceEvent.class, | ||
}, properties); | ||
} | ||
return context; | ||
} catch (JAXBException e) { | ||
throw new ExceptionInInitializerError(e); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.