-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Provider push implementation * Complete Provider instances can be pushed * Notifications are now handled via EMF Change Adapters Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * bumped http to 5.0.0 and moved servlet api to parent - helps resolver Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed tests Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Moved Metdataupdate to Change Adapters Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * satisfy EditorConfig check Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed test and editor config Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * excluded ecore and genmodel from editorconfig check Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Removed debug printout Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Wait for the result before we query Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Hopefully fixed test Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Added some Tests and fixed bugs Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * removed some loose ends Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * removed some loose ends Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * added missing Capability Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Handling of unset resources Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Split models into provider and internal metadata Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed extended model Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * reworked model push to work without emfcompare Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Fixed Metadata access Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Adds Metadata annotation support Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed Version bump issue Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * revert license tool version change Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed tests and the definition of eIsSet for Services Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed the isSert determination Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Returns observations only if the resource has been set * Added comments on row count in ObservationHistoryTest * Added a location in tests to have circular links for all resources * downgraded to geckoEMF 4.6.0-SNAPSHOT Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Added back the test for timescale-history-provider * Updated bndrun files * Fixed test for Windows * fixed wrong parent version Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * fixed feature Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * satisfying EditorConfig Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * modified xml config Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * Bumped geckoemf to 4.6.2 Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * updated bndruns Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> * reverted editor config Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> --------- Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz> Co-authored-by: Thomas Calmant <thomas.calmant@gmail.com>
- Loading branch information
1 parent
58eaad9
commit 5e27485
Showing
202 changed files
with
3,405 additions
and
10,907 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
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
22 changes: 11 additions & 11 deletions
22
prototype/core/api/src/main/java/org/eclipse/sensinact/prototype/package-info.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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation. | ||
* | ||
* 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: Kentyou - initial implementation | ||
**********************************************************************/ | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation. | ||
* | ||
* 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: Kentyou - initial implementation | ||
**********************************************************************/ | ||
@org.osgi.annotation.bundle.Export | ||
@org.osgi.annotation.versioning.Version("0.2.0") | ||
package org.eclipse.sensinact.prototype; | ||
package org.eclipse.sensinact.prototype; |
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
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
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
49 changes: 49 additions & 0 deletions
49
...ype/core/impl/src/main/java/org/eclipse/sensinact/prototype/impl/SaveProviderCommand.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,49 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2023 Contributors to the Eclipse Foundation. | ||
* | ||
* 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: | ||
* Kentyou - initial implementation | ||
**********************************************************************/ | ||
package org.eclipse.sensinact.prototype.impl; | ||
|
||
import java.time.Instant; | ||
|
||
import org.eclipse.sensinact.model.core.provider.Provider; | ||
import org.eclipse.sensinact.prototype.command.AbstractSensinactCommand; | ||
import org.eclipse.sensinact.prototype.model.Model; | ||
import org.eclipse.sensinact.prototype.model.SensinactModelManager; | ||
import org.eclipse.sensinact.prototype.twin.SensinactDigitalTwin; | ||
import org.eclipse.sensinact.prototype.twin.SensinactProvider; | ||
import org.osgi.util.promise.Promise; | ||
import org.osgi.util.promise.PromiseFactory; | ||
|
||
public class SaveProviderCommand extends AbstractSensinactCommand<Void> { | ||
|
||
private Provider provider; | ||
|
||
public SaveProviderCommand(Provider provider) { | ||
this.provider = provider; | ||
} | ||
|
||
@Override | ||
protected Promise<Void> call(SensinactDigitalTwin twin, SensinactModelManager modelMgr, | ||
PromiseFactory promiseFactory) { | ||
|
||
Model model = modelMgr.getModel(provider.eClass()); | ||
if (model == null) { | ||
model = modelMgr.createModel(provider.eClass()).withCreationTime(Instant.now()).build(); | ||
} | ||
SensinactProvider sp = twin.getProvider(model.getName(), provider.getId()); | ||
if (sp == null) { | ||
sp = twin.createProvider(model.getName(), provider.getId(), Instant.now()); | ||
} | ||
|
||
return sp.update(provider); | ||
} | ||
} |
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.