Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@
"CamelIec60870Value": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The value", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_VALUE" },
"CamelIec60870Timestamp": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The timestamp of the value", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_TIMESTAMP" },
"CamelIec60870Quality": { "index": 2, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.asdu.types.QualityInformation", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The quality information of the value", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY" },
"CamelIec60870Overflow": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Is overflow", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_OVERFLOW" }
"CamelIec60870Overflow": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Is overflow", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_OVERFLOW" },
"CamelIec60870ConnectionState": { "index": 4, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.client.AutoConnectClient.State", "enum": [ "SLEEPING", "DISCONNECTED", "LOOKUP", "CONNECTING", "CONNECTED" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The connection state (CONNECTED, DISCONNECTED, etc.)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CONNECTION_STATE" },
"CamelIec60870ConnectionError": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Throwable", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The connection state error if any", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CONNECTION_ERROR" },
"CamelIec60870ConnectionUptime": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Connection uptime in milliseconds since last connected", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CONNECTION_UPTIME" },
"CamelIec60870CommandType": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The command type: 'value' (default), 'interrogation', 'read', or 'status'", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_COMMAND_TYPE" },
"CamelIec60870AsduAddress": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.asdu.types.ASDUAddress", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ASDU address for interrogation (optional, defaults to broadcast)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_ASDU_ADDRESS" },
"CamelIec60870Qoi": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "short", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The qualifier of interrogation: 20 (global) or 21-36 (groups 1-16)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QOI" },
"CamelIec60870QualityBlocked": { "index": 10, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Blocked (BL)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_BLOCKED" },
"CamelIec60870QualitySubstituted": { "index": 11, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Substituted (SB)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_SUBSTITUTED" },
"CamelIec60870QualityNotTopical": { "index": 12, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Not topical (NT)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_NOT_TOPICAL" },
"CamelIec60870QualityValid": { "index": 13, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Invalid (IV)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_VALID" },
"CamelIec60870CauseOfTransmission": { "index": 14, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.asdu.types.CauseOfTransmission", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The cause of transmission", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CAUSE_OF_TRANSMISSION" }
},
"properties": {
"uriPath": { "index": 0, "kind": "path", "displayName": "Uri Path", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.iec60870.ObjectAddress", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The object information address" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@
"CamelIec60870Value": { "index": 0, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The value", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_VALUE" },
"CamelIec60870Timestamp": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The timestamp of the value", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_TIMESTAMP" },
"CamelIec60870Quality": { "index": 2, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.asdu.types.QualityInformation", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The quality information of the value", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY" },
"CamelIec60870Overflow": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Is overflow", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_OVERFLOW" }
"CamelIec60870Overflow": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Is overflow", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_OVERFLOW" },
"CamelIec60870ConnectionState": { "index": 4, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.client.AutoConnectClient.State", "enum": [ "SLEEPING", "DISCONNECTED", "LOOKUP", "CONNECTING", "CONNECTED" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The connection state (CONNECTED, DISCONNECTED, etc.)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CONNECTION_STATE" },
"CamelIec60870ConnectionError": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Throwable", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The connection state error if any", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CONNECTION_ERROR" },
"CamelIec60870ConnectionUptime": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Connection uptime in milliseconds since last connected", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CONNECTION_UPTIME" },
"CamelIec60870CommandType": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The command type: 'value' (default), 'interrogation', 'read', or 'status'", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_COMMAND_TYPE" },
"CamelIec60870AsduAddress": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.asdu.types.ASDUAddress", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ASDU address for interrogation (optional, defaults to broadcast)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_ASDU_ADDRESS" },
"CamelIec60870Qoi": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "short", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The qualifier of interrogation: 20 (global) or 21-36 (groups 1-16)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QOI" },
"CamelIec60870QualityBlocked": { "index": 10, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Blocked (BL)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_BLOCKED" },
"CamelIec60870QualitySubstituted": { "index": 11, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Substituted (SB)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_SUBSTITUTED" },
"CamelIec60870QualityNotTopical": { "index": 12, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Not topical (NT)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_NOT_TOPICAL" },
"CamelIec60870QualityValid": { "index": 13, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Quality flag: Invalid (IV)", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_QUALITY_VALID" },
"CamelIec60870CauseOfTransmission": { "index": 14, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.eclipse.neoscada.protocol.iec60870.asdu.types.CauseOfTransmission", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The cause of transmission", "constantName": "org.apache.camel.component.iec60870.Constants#IEC60870_CAUSE_OF_TRANSMISSION" }
},
"properties": {
"uriPath": { "index": 0, "kind": "path", "displayName": "Uri Path", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.iec60870.ObjectAddress", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The object information address" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,97 @@ include::partial$component-endpoint-options.adoc[]
include::partial$component-endpoint-headers.adoc[]
// component options: END

== Producer Command Types

The producer supports different command types via the `CamelIec60870CommandType` header:

[cols="1,3"]
|===
|Command Type |Description

|`value`
|Send value command (default). Body type determines command: Boolean→Single, Integer→Scaled, Float→Float setpoint.

|`interrogation`
|Trigger interrogation (C_IC_NA_1). Use `CamelIec60870Qoi` header for group interrogation (21-36).

|`read`
|Read single data point (C_RD_NA_1).

|`status`
|Get connection state only. No protocol command sent.
|===

=== Getting Connection Status (Producer)

[source,java]
----
from("direct:status")
.setHeader("CamelIec60870CommandType", constant("status"))
.to("iec60870-client:localhost:2404/00-01-00-00-01");

// Usage
Exchange result = producerTemplate.send("direct:status", e -> {});
State state = result.getMessage().getHeader("CamelIec60870ConnectionState", State.class);
Long uptime = result.getMessage().getHeader("CamelIec60870ConnectionUptime", Long.class);
----

=== Triggering Interrogation

[source,java]
----
from("direct:interrogate")
.setHeader("CamelIec60870CommandType", constant("interrogation"))
.to("iec60870-client:localhost:2404/00-01-00-00-01");

from("direct:interrogateGroup")
.setHeader("CamelIec60870CommandType", constant("interrogation"))
.setHeader("CamelIec60870Qoi", constant((short) 21))
.to("iec60870-client:localhost:2404/00-01-00-00-01");
----

=== Sending Value Commands

[source,java]
----
from("direct:bool").setBody(constant(true))
.to("iec60870-client:localhost:2404/00-01-00-00-01");

from("direct:float").setBody(constant(42.5f))
.to("iec60870-client:localhost:2404/00-01-00-00-01");
----

== Consumer Examples

Each message received by the consumer includes connection state and quality headers.

=== Getting Connection Status (Consumer)

[source,java]
----
from("iec60870-client:localhost:2404/00-01-00-00-01")
.process(exchange -> {
// Connection state is included in every message
State state = exchange.getIn().getHeader("CamelIec60870ConnectionState", State.class);
Long uptime = exchange.getIn().getHeader("CamelIec60870ConnectionUptime", Long.class);

// Get the value and quality
Object value = exchange.getIn().getHeader("CamelIec60870Value");
Boolean valid = exchange.getIn().getHeader("CamelIec60870QualityValid", Boolean.class);

log.info("State: {}, Uptime: {} ms, Value: {}, Valid: {}", state, uptime, value, valid);
})
.to("log:values");
----

=== Filtering by Quality

[source,java]
----
from("iec60870-client:localhost:2404/00-01-00-00-01")
.filter(header("CamelIec60870QualityValid").isEqualTo(true))
.log("Good value: ${header.CamelIec60870Value}")
.to("seda:process");
----

include::spring-boot:partial$starter.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,54 @@ public interface Constants {
String TYPE = "type";
@Metadata(label = "consumer", description = "Is execute", javaType = "boolean", applicableFor = SCHEME_SERVER)
String EXECUTE = "execute";

// Connection state headers
@Metadata(label = "consumer", description = "The connection state (CONNECTED, DISCONNECTED, etc.)",
javaType = "org.eclipse.neoscada.protocol.iec60870.client.AutoConnectClient.State", applicableFor = SCHEME_CLIENT)
String IEC60870_CONNECTION_STATE = "CamelIec60870ConnectionState";
@Metadata(label = "consumer", description = "The connection state error if any",
javaType = "Throwable", applicableFor = SCHEME_CLIENT)
String IEC60870_CONNECTION_ERROR = "CamelIec60870ConnectionError";
@Metadata(label = "consumer", description = "Connection uptime in milliseconds since last connected",
javaType = "long", applicableFor = SCHEME_CLIENT)
String IEC60870_CONNECTION_UPTIME = "CamelIec60870ConnectionUptime";

// Producer command types
@Metadata(label = "producer",
description = "The command type: 'value' (default), 'interrogation', 'read', or 'status'",
javaType = "String", applicableFor = SCHEME_CLIENT)
String IEC60870_COMMAND_TYPE = "CamelIec60870CommandType";

// Command type values
String COMMAND_TYPE_VALUE = "value";
String COMMAND_TYPE_INTERROGATION = "interrogation";
String COMMAND_TYPE_READ = "read";
String COMMAND_TYPE_STATUS = "status";

// Interrogation headers
@Metadata(label = "producer", description = "The ASDU address for interrogation (optional, defaults to broadcast)",
javaType = "org.eclipse.neoscada.protocol.iec60870.asdu.types.ASDUAddress", applicableFor = SCHEME_CLIENT)
String IEC60870_ASDU_ADDRESS = "CamelIec60870AsduAddress";
@Metadata(label = "producer", description = "The qualifier of interrogation: 20 (global) or 21-36 (groups 1-16)",
javaType = "short", applicableFor = SCHEME_CLIENT)
String IEC60870_QOI = "CamelIec60870Qoi";

// Individual quality flag headers
@Metadata(label = "consumer", description = "Quality flag: Blocked (BL)", javaType = "boolean",
applicableFor = SCHEME_CLIENT)
String IEC60870_QUALITY_BLOCKED = "CamelIec60870QualityBlocked";
@Metadata(label = "consumer", description = "Quality flag: Substituted (SB)", javaType = "boolean",
applicableFor = SCHEME_CLIENT)
String IEC60870_QUALITY_SUBSTITUTED = "CamelIec60870QualitySubstituted";
@Metadata(label = "consumer", description = "Quality flag: Not topical (NT)", javaType = "boolean",
applicableFor = SCHEME_CLIENT)
String IEC60870_QUALITY_NOT_TOPICAL = "CamelIec60870QualityNotTopical";
@Metadata(label = "consumer", description = "Quality flag: Invalid (IV)", javaType = "boolean",
applicableFor = SCHEME_CLIENT)
String IEC60870_QUALITY_VALID = "CamelIec60870QualityValid";

// Cause of transmission header
@Metadata(label = "consumer", description = "The cause of transmission",
javaType = "org.eclipse.neoscada.protocol.iec60870.asdu.types.CauseOfTransmission", applicableFor = SCHEME_CLIENT)
String IEC60870_CAUSE_OF_TRANSMISSION = "CamelIec60870CauseOfTransmission";
}
Loading