Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions entsoe/build.gradle
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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.openremote.extension.entsoe.agent.protocol;
Comment thread
ebariaux marked this conversation as resolved.

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;
}
}
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;
}
}
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;
}
}
Loading
Loading