-
Notifications
You must be signed in to change notification settings - Fork 1
ENTSO-E agent #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
ENTSO-E agent #15
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
04c5e9f
Set-up to make running tests in extensions repo work
ebariaux 745d1a4
Implement an ENTSO-E agent
ebariaux 703d7fa
Merge branch 'main' into feature/entsoe-agent
wborn 63478fc
Support multiple <Period> entries in a single <TimeSeries>
ebariaux dfbc582
Add licence header
ebariaux bd1a943
Improve fetching so that if multiple attributes sahre the same zone f…
ebariaux 01852fd
Use proper package
ebariaux eda80dc
Ensure an unexpected exception does not stop the scheduling
ebariaux 676f6c0
Harden XML parsing
ebariaux 1c7170a
Better parsing of reason text in case of errors
ebariaux 7095bcc
Properly close Resteasy client in test cleanup
ebariaux 45582d0
Don't run tests for now in CI/CD, the pipeline does not properly setu…
ebariaux d4eefda
Merge branch 'main' into feature/entsoe-agent
wborn c6e420c
Add documentation for ENTSO-E agent in this repo
ebariaux f9099de
Improve documentation discoverability
wborn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,87 @@ | ||
| apply plugin: "groovy" | ||
| apply plugin: "java-library" | ||
| apply plugin: "maven-publish" | ||
| apply plugin: "signing" | ||
|
|
||
| base { | ||
| archivesName = "openremote-${project.name}-extension" | ||
| } | ||
|
|
||
| dependencies { | ||
| api "io.openremote:openremote-manager:$openremoteVersion" | ||
| api "io.openremote:openremote-model:$openremoteVersion" | ||
|
|
||
| api "org.jboss.resteasy:resteasy-client-api:$resteasyVersion" | ||
| api "org.jboss.resteasy:resteasy-jaxb-provider:$resteasyVersion" | ||
|
|
||
| testImplementation "io.openremote:openremote-test:$openremoteVersion" | ||
| } | ||
|
|
||
| jar { | ||
| from sourceSets.main.allJava | ||
| } | ||
|
|
||
| javadoc { | ||
| failOnError = false | ||
| } | ||
|
|
||
| java { | ||
| withJavadocJar() | ||
| withSourcesJar() | ||
| } | ||
|
|
||
| publishing { | ||
| publications { | ||
| maven(MavenPublication) { | ||
| group = "io.openremote.extension" | ||
| artifactId = "openremote-${project.name}-extension" | ||
| from components.java | ||
| pom { | ||
| name = 'OpenRemote ENTSO-E extension' | ||
| description = 'Adds the ENTSO-E extension' | ||
| url = 'https://github.com/openremote/extensions' | ||
| licenses { | ||
| license { | ||
| name = 'GNU Affero General Public License v3.0' | ||
| url = 'https://www.gnu.org/licenses/agpl-3.0.en.html' | ||
| } | ||
| } | ||
| developers { | ||
| developer { | ||
| id = 'developers' | ||
| name = 'Developers' | ||
| email = 'developers@openremote.io' | ||
| organization = 'OpenRemote' | ||
| organizationUrl = 'https://openremote.io' | ||
| } | ||
| } | ||
| scm { | ||
| connection = 'scm:git:git://github.com/openremote/extensions.git' | ||
| developerConnection = 'scm:git:ssh://github.com:openremote/extensions.git' | ||
| url = 'https://github.com/openremote/extensions/tree/main' | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| maven { | ||
| if (!version.endsWith('-LOCAL')) { | ||
| credentials { | ||
| username = findProperty("publishUsername") | ||
| password = findProperty("publishPassword") | ||
| } | ||
| } | ||
| url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| signing { | ||
| def signingKey = findProperty("signingKey") | ||
| def signingPassword = findProperty("signingPassword") | ||
| if (signingKey && signingPassword) { | ||
| useInMemoryPgpKeys(signingKey, signingPassword) | ||
| sign publishing.publications.maven | ||
| } | ||
| } |
50 changes: 50 additions & 0 deletions
50
entsoe/src/main/java/org/openremote/extension/entsoe/agent/protocol/EntsoeAgent.java
This file contains hidden or 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,50 @@ | ||
| package org.openremote.extension.entsoe.agent.protocol; | ||
|
|
||
| import jakarta.persistence.Entity; | ||
| import org.openremote.model.asset.agent.Agent; | ||
| import org.openremote.model.asset.agent.AgentDescriptor; | ||
| import org.openremote.model.value.AttributeDescriptor; | ||
| import org.openremote.model.value.ValueType; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| @Entity | ||
| public class EntsoeAgent extends Agent<EntsoeAgent, EntsoeProtocol, EntsoeAgentLink> { | ||
|
|
||
| public static final AgentDescriptor<EntsoeAgent, EntsoeProtocol, EntsoeAgentLink> DESCRIPTOR = new AgentDescriptor<>( | ||
| EntsoeAgent.class, EntsoeProtocol.class, EntsoeAgentLink.class); | ||
|
|
||
| public static final AttributeDescriptor<String> SECURITY_TOKEN = new AttributeDescriptor<>("securityToken", ValueType.TEXT); | ||
|
|
||
| public static final AttributeDescriptor<String> BASE_URL = new AttributeDescriptor<>("baseURL", ValueType.TEXT).withOptional(true); | ||
|
|
||
| public EntsoeAgent() { | ||
| } | ||
|
|
||
| public EntsoeAgent(String name) { | ||
| super(name); | ||
| } | ||
|
|
||
| @Override | ||
| public EntsoeProtocol getProtocolInstance() { | ||
| return new EntsoeProtocol(this); | ||
| } | ||
|
|
||
| public Optional<String> getSecurityToken() { | ||
| return getAttributes().getValue(SECURITY_TOKEN); | ||
| } | ||
|
|
||
| public EntsoeAgent setSecurityToken(String value) { | ||
| getAttributes().getOrCreate(SECURITY_TOKEN).setValue(value); | ||
| return this; | ||
| } | ||
|
|
||
| public Optional<String> getBaseURL() { | ||
| return getAttributes().getValue(BASE_URL); | ||
| } | ||
|
|
||
| public EntsoeAgent setBaseURL(String value) { | ||
| getAttributes().getOrCreate(BASE_URL).setValue(value); | ||
| return this; | ||
| } | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
entsoe/src/main/java/org/openremote/extension/entsoe/agent/protocol/EntsoeAgentLink.java
This file contains hidden or 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,30 @@ | ||
| package org.openremote.extension.entsoe.agent.protocol; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonPropertyDescription; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Pattern; | ||
| import org.openremote.model.asset.agent.AgentLink; | ||
|
|
||
| public class EntsoeAgentLink extends AgentLink<EntsoeAgentLink> { | ||
|
|
||
| @NotNull | ||
| @JsonPropertyDescription("Energy Identification Code of zone to fetch data for") | ||
| @Pattern(regexp = "^\\d{2}[A-Z][A-Z0-9-]{12}[A-Z0-9]$") | ||
| private String zone; | ||
|
|
||
| // For Hydrators | ||
| public EntsoeAgentLink() { | ||
| } | ||
|
|
||
| public EntsoeAgentLink(String id) { | ||
| super(id); | ||
| } | ||
|
|
||
| public String getZone() { | ||
| return zone; | ||
| } | ||
|
|
||
| public void setZone(String zone) { | ||
| this.zone = zone; | ||
| } | ||
| } |
11 changes: 11 additions & 0 deletions
11
...rc/main/java/org/openremote/extension/entsoe/agent/protocol/EntsoeAgentModelProvider.java
This file contains hidden or 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 @@ | ||
| package org.openremote.extension.entsoe.agent.protocol; | ||
|
|
||
| import org.openremote.model.AssetModelProvider; | ||
|
|
||
| public class EntsoeAgentModelProvider implements AssetModelProvider { | ||
|
|
||
| @Override | ||
| public boolean useAutoScan() { | ||
| return true; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.