Skip to content
Snippets Groups Projects
Commit 6b4a60d3 authored by Mohamed Anis Koubaa's avatar Mohamed Anis Koubaa :speech_balloon:
Browse files

Add Source interface, actual and manager.

parent 5320515b
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,26 @@
## Use Cases
### Use Case #1 (Main use case)
### Use Case #UC1 (Main use case)
A user plugs in the EDR at a certain location, connects it with its laptop and starts the recording of a campaign.
At the same time the user starts the publishing tool REGIMO (from this git repository).
All new created files are tracked by the tool and automatically uploaded to the cloud and then published to the databus using its cloud URL.
All new created files are tracked by the tool and automatically uploaded to the cloud and then published to the databus
using its cloud URL.
### Use Case #2 (Secondary use case)
The existing database of the EDR is analyzed and all existing valid data sets (correct filesystem structure and metadata json files exist) get published to the cloud and registered in the databus.
### Use Case #UC2 (Secondary use case)
The existing database of the EDR is analyzed and all existing valid data sets (correct filesystem structure and metadata
json files exist) get published to the cloud and registered in the databus.
### Use Case #UC_US01_01 (Display already defined Metadata Sources)
The menu Configure/Data Sources displays the existent already configured Data Sources and a button to add a new one.
## User Stories
### User Story #01
As an admin I want to add a metadata source.
### User Story #02
As an admin I want to configure a metadata source.
Properties of a metadata source are the ip, the adapter and the sink.
The front end should display the already configured metadata sources.
......@@ -18,6 +18,7 @@ target/
*.iws
*.iml
*.ipr
.DS_Store
### NetBeans ###
/nbproject/private/
......
package iai.product.source;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/api")
public class DataSourceController {
private final MetaSourceManager dataSourceManager;
@Autowired
public DataSourceController(MetaSourceManager dataSourceManager) {
this.dataSourceManager = dataSourceManager;
}
@GetMapping("/metaSources")
public List<MetaSource> getDataSources() {
return dataSourceManager.getDataSources();
}
}
package iai.product.source;
public interface MetaSource {
String name = null;
String getName();
}
package iai.product.source;
import java.util.ArrayList;
import java.util.List;
public class MetaSourceManager {
private final List<MetaSource> dataSources;
public MetaSourceManager() {
this.dataSources = new ArrayList<>();
}
public void addDataSource(MetaSource dataSource) {
dataSources.add(dataSource);
}
public List<MetaSource> getDataSources() {
return dataSources;
}
}
package iai.product.source;
public class RDFSource implements MetaSource{
String name;
public RDFSource(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment