-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I4.0 extension based on BaSys4IPPS (#445)
* I4.0 extension based on BaSys4IPPS * add SubmodelElementCollectionMessage to directly send SMCs * provide unit tests for the i4dot0 extension
- Loading branch information
Showing
18 changed files
with
1,220 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/main/java/org/eclipse/basyx/extensions/i4dot0/domain/Message.java
This file contains 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,43 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 the Eclipse BaSyx Authors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
package org.eclipse.basyx.extensions.i4dot0.domain; | ||
|
||
/** | ||
* Represents a I4.0 language message - VDI/VDE 2193. Please use either of the subclasses, depending on if you want to publish a list of submodels or a list of key-value pairs. A message consists of a frame and interactionsElements. | ||
* | ||
* @author wand | ||
*/ | ||
public abstract class Message { | ||
|
||
private MessageFrame frame; | ||
|
||
public MessageFrame getFrame() { | ||
return frame; | ||
} | ||
|
||
public void setFrame(MessageFrame frame) { | ||
this.frame = frame; | ||
} | ||
} |
117 changes: 117 additions & 0 deletions
117
src/main/java/org/eclipse/basyx/extensions/i4dot0/domain/MessageFrame.java
This file contains 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,117 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 the Eclipse BaSyx Authors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
package org.eclipse.basyx.extensions.i4dot0.domain; | ||
|
||
import org.eclipse.basyx.extensions.i4dot0.domain.message.frame.Participant; | ||
import org.eclipse.basyx.extensions.i4dot0.domain.message.frame.SemanticProtocol; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* Represents the frame of an I4.0 language message. All NotNull member variables are mandatory to create a valid I4.0 message. | ||
* | ||
* @author wand | ||
*/ | ||
|
||
public class MessageFrame { | ||
|
||
@NotNull | ||
private String type; | ||
private Participant sender; | ||
private Participant receiver; | ||
@NotNull | ||
private String conversationId; | ||
@NotNull | ||
private Object messageId; | ||
private String inReplyTo; | ||
private String replyBy; | ||
@NotNull | ||
private SemanticProtocol semanticProtocol; | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public Participant getSender() { | ||
return sender; | ||
} | ||
|
||
public void setSender(Participant sender) { | ||
this.sender = sender; | ||
} | ||
|
||
public Participant getReceiver() { | ||
return receiver; | ||
} | ||
|
||
public void setReceiver(Participant receiver) { | ||
this.receiver = receiver; | ||
} | ||
|
||
public String getConversationId() { | ||
return conversationId; | ||
} | ||
|
||
public void setConversationId(String conversationId) { | ||
this.conversationId = conversationId; | ||
} | ||
|
||
public Object getMessageId() { | ||
return messageId; | ||
} | ||
|
||
public void setMessageId(Object messageId) { | ||
this.messageId = messageId; | ||
} | ||
|
||
public String getInReplyTo() { | ||
return inReplyTo; | ||
} | ||
|
||
public void setInReplyTo(String inReplyTo) { | ||
this.inReplyTo = inReplyTo; | ||
} | ||
|
||
public String getReplyBy() { | ||
return replyBy; | ||
} | ||
|
||
public void setReplyBy(String replyBy) { | ||
this.replyBy = replyBy; | ||
} | ||
|
||
public SemanticProtocol getSemanticProtocol() { | ||
return semanticProtocol; | ||
} | ||
|
||
public void setSemanticProtocol(SemanticProtocol semanticProtocol) { | ||
this.semanticProtocol = semanticProtocol; | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/eclipse/basyx/extensions/i4dot0/domain/message/GenericMessage.java
This file contains 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,48 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 the Eclipse BaSyx Authors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
package org.eclipse.basyx.extensions.i4dot0.domain.message; | ||
|
||
import org.eclipse.basyx.extensions.i4dot0.domain.Message; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* This extension of {@link Message} is used to create a I4.0 message where the interactionElements are represented as List of key-value-pairs. | ||
* | ||
* @author wand | ||
*/ | ||
public class GenericMessage extends Message { | ||
|
||
private List<Map<String, Object>> interactionElements; | ||
|
||
public List<Map<String, Object>> getInteractionElements() { | ||
return interactionElements; | ||
} | ||
|
||
public void setInteractionElements(List<Map<String, Object>> interactionElements) { | ||
this.interactionElements = interactionElements; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
.../org/eclipse/basyx/extensions/i4dot0/domain/message/SubmodelElementCollectionMessage.java
This file contains 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,48 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 the Eclipse BaSyx Authors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
package org.eclipse.basyx.extensions.i4dot0.domain.message; | ||
|
||
import org.eclipse.basyx.extensions.i4dot0.domain.Message; | ||
import org.eclipse.basyx.submodel.metamodel.map.submodelelement.SubmodelElementCollection; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This extension of {@link Message} is used to create a I4.0 message where the interactionElements are represented as List of SubmodelElementCollections. | ||
* | ||
* @author wand | ||
*/ | ||
public class SubmodelElementCollectionMessage extends Message { | ||
|
||
private List<SubmodelElementCollection> interactionElements; | ||
|
||
public List<SubmodelElementCollection> getInteractionElements() { | ||
return interactionElements; | ||
} | ||
|
||
public void setInteractionElements(List<SubmodelElementCollection> interactionElements) { | ||
this.interactionElements = interactionElements; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/eclipse/basyx/extensions/i4dot0/domain/message/SubmodelMessage.java
This file contains 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,48 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 the Eclipse BaSyx Authors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
package org.eclipse.basyx.extensions.i4dot0.domain.message; | ||
|
||
import org.eclipse.basyx.extensions.i4dot0.domain.Message; | ||
import org.eclipse.basyx.submodel.metamodel.map.Submodel; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* This extension of {@link Message} is used to create a I4.0 message where the interactionElements are represented as List of AAS submodels. | ||
* | ||
* @author wand | ||
*/ | ||
public class SubmodelMessage extends Message { | ||
|
||
private List<Submodel> interactionElements; | ||
|
||
public List<Submodel> getInteractionElements() { | ||
return interactionElements; | ||
} | ||
|
||
public void setInteractionElements(List<Submodel> interactionElements) { | ||
this.interactionElements = interactionElements; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/org/eclipse/basyx/extensions/i4dot0/domain/message/frame/Participant.java
This file contains 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,52 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 the Eclipse BaSyx Authors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
******************************************************************************/ | ||
package org.eclipse.basyx.extensions.i4dot0.domain.message.frame; | ||
|
||
/** | ||
* Part of the I4.0 language message frame. | ||
* | ||
* @author wand | ||
*/ | ||
public class Participant { | ||
|
||
private ParticipantIdentification participantIdentification; | ||
private ParticipantRole participantRole; | ||
|
||
public ParticipantIdentification getIdentification() { | ||
return participantIdentification; | ||
} | ||
|
||
public void setIdentification(ParticipantIdentification participantIdentification) { | ||
this.participantIdentification = participantIdentification; | ||
} | ||
|
||
public ParticipantRole getRole() { | ||
return participantRole; | ||
} | ||
|
||
public void setRole(ParticipantRole participantRole) { | ||
this.participantRole = participantRole; | ||
} | ||
} |
Oops, something went wrong.