Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

DummyExtension should use Backend Provider #17

Closed
Alexander-Krause-Glau opened this issue Jan 30, 2018 · 3 comments
Closed

DummyExtension should use Backend Provider #17

Alexander-Krause-Glau opened this issue Jan 30, 2018 · 3 comments

Comments

@Alexander-Krause-Glau
Copy link
Contributor

I open this issue here, otherwise we will probably loose track of spread tickets.

Tl;Dr; The source code lines are necessary for extensions to convert Java to JSON-API-conform payload using the backend JSON-API providers.

The DummyExtension uses a seperate provider for JSONAPI. Since the GenericTypeFinder solves our problem of finding runtime (generic) type information, we can fully use the backend JSONAPI providers.

Use the DiscoveryExtension as example for implementing this feature. Additionally add:

GenericTypeFinder.typeMap.putIfAbsent("Timestamp", Timestamp.class);
GenericTypeFinder.typeMap.putIfAbsent("Landscape", Landscape.class);
GenericTypeFinder.typeMap.putIfAbsent("System", net.explorviz.model.System.class);
GenericTypeFinder.typeMap.putIfAbsent("NodeGroup", NodeGroup.class);
GenericTypeFinder.typeMap.putIfAbsent("Node", Node.class);
GenericTypeFinder.typeMap.putIfAbsent("Application", Application.class);
GenericTypeFinder.typeMap.putIfAbsent("Component", Component.class);
GenericTypeFinder.typeMap.putIfAbsent("Clazz", Clazz.class);
GenericTypeFinder.typeMap.putIfAbsent("CommunicationClazz", CommunicationClazz.class);
GenericTypeFinder.typeMap.putIfAbsent("Communication", Communication.class);
GenericTypeFinder.typeMap.putIfAbsent("CommunicationAccumulator", CommunicationAccumulator.class);
GenericTypeFinder.typeMap.putIfAbsent("CommunicationTileAccumulator", CommunicationTileAccumulator.class);
GenericTypeFinder.typeMap.putIfAbsent("DatabaseQuery", DatabaseQuery.class);
GenericTypeFinder.typeMap.putIfAbsent("User", User.class);

to Extension-Application constructor. GenericTypeFinder is a static class, but it seems that both applications have their own scope. Therefore, they do not share this class.

@czirkelbach
Copy link
Contributor

czirkelbach commented Jan 31, 2018

Add three method, one as serving as a register handler for the core (registerAllCoreModels()) and two API methods as a wrapper for enabling core model types in extensions (allCoreModels() or registerAllCoreModels(Map<String, Class<?>>).

@czirkelbach czirkelbach added this to the Release v1.2.0 milestone Feb 1, 2018
@czirkelbach czirkelbach self-assigned this Feb 1, 2018
@czirkelbach
Copy link
Contributor

Testing via an extension necessary

@Alexander-Krause-Glau
Copy link
Contributor Author

Works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants