Skip to content

Commit 7784da3

Browse files
authored
chore: type field on data flow (#63)
1 parent e32e815 commit 7784da3

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/main/java/org/eclipse/dataplane/Dataplane.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public Result<DataFlowStatusMessage> prepare(String controlplaneId, DataFlowPrep
132132
.counterPartyId(message.counterPartyId())
133133
.dataspaceContext(message.dataspaceContext())
134134
.controlplaneId(controlplaneId)
135+
.type(DataFlow.Type.CONSUMER)
135136
.build();
136137

137138
return checkControlPlane(controlplaneId)
@@ -166,6 +167,7 @@ public Result<DataFlowStatusMessage> start(String controlplaneId, DataFlowStartM
166167
.counterPartyId(message.counterPartyId())
167168
.dataspaceContext(message.dataspaceContext())
168169
.controlplaneId(controlplaneId)
170+
.type(DataFlow.Type.PROVIDER)
169171
.build();
170172

171173
return checkControlPlane(controlplaneId)

src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlow.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class DataFlow {
3939
private Map<String, Object> metadata;
4040
private DataAddress dataAddress;
4141
private String controlplaneId;
42+
private Type type;
4243

4344
public static DataFlow.Builder newInstance() {
4445
return new Builder();
@@ -162,6 +163,14 @@ public String getControlplaneId() {
162163
return controlplaneId;
163164
}
164165

166+
public Type getType() {
167+
return type;
168+
}
169+
170+
public enum Type {
171+
PROVIDER, CONSUMER
172+
}
173+
165174
public static class Builder {
166175
private final DataFlow dataFlow = new DataFlow();
167176

@@ -243,6 +252,11 @@ public Builder controlplaneId(String controlplaneId) {
243252
dataFlow.controlplaneId = controlplaneId;
244253
return this;
245254
}
255+
256+
public Builder type(Type type) {
257+
dataFlow.type = type;
258+
return this;
259+
}
246260
}
247261

248262
public enum State {

0 commit comments

Comments
 (0)