Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Korb2017-09-01 08:26:35 -0400
committerFelix Korb2017-09-01 08:26:35 -0400
commit81fbffdd504f3ade1f51f840cac863e54a83412c (patch)
treefa75b98a9553586a6492c30367719e53419b49db
parente784faf9c93537edfa8515304a9e644450473a19 (diff)
downloadorg.eclipse.openk-platform.openk-repo-81fbffdd504f3ade1f51f840cac863e54a83412c.tar.gz
org.eclipse.openk-platform.openk-repo-81fbffdd504f3ade1f51f840cac863e54a83412c.tar.xz
org.eclipse.openk-platform.openk-repo-81fbffdd504f3ade1f51f840cac863e54a83412c.zip
Missing artifacts added.
Reason: Problem with file-name lengths in Windows-paths.
-rw-r--r--cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Forecast.java35
-rw-r--r--cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/IntervalSchedule.java32
-rw-r--r--cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/NonRotatingEnergy.java17
-rw-r--r--cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Schedule.java35
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/.gitignore8
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/pom.xml54
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/OpenKonsequenz.java79
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/api/topology/TopologyId.java12
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/resources/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/java/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/resources/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.common/.gitignore8
-rw-r--r--cim-cache/org.eclipse.openk.common/pom.xml121
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/AbstractContext.java62
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IContext.java22
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IVersion.java19
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/Version.java73
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/collection/AlreadyExistingItemException.java64
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/Command.java59
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandController.java95
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecution.java87
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecutionId.java71
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandType.java66
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/ICommandExecutor.java34
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/CommunicationTechnology.java15
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeDefaults.java25
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeFormat.java172
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/IDataExchangeFormat.java72
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/Cim.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimModelDefinition.java75
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimVersion.java163
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimDatatype.java12
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimEntity.java10
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimIdentifiedObject.java18
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimRevision.java18
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/AbstractRdf1_1PayloadReader.java101
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageDefaults.java51
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageErrorLevel.java19
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageHeader.java137
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageResult.java15
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageStereotype.java16
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageVerb.java26
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageWriter.java337
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/ErrorCreatingUriException.java27
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/FailedToWriteMessageException.java63
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/IPayloadWriter.java42
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadReader.java85
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadWriter.java472
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadReader.java421
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadWriter.java311
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueDecoder.java260
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueEncoder.java490
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueDecoder.java220
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueEncoder.java278
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvFileReader.java109
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvReader.java189
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorReadingCsvException.java62
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorWritingCsvException.java62
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlConverter.java58
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlReader.java231
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlWriter.java113
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/ErrorReadingXmlException.java76
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/IXmlNamespaceSolver.java69
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/UnsupportedXmlVersion.java27
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlAttribute.java97
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlDefaults.java76
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespace.java156
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceMapping.java79
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceSolver.java201
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTag.java290
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTagTermination.java14
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlUtilities.java95
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlVersion.java15
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlWriter.java367
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Reader.java681
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Writer.java286
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/ErrorWritingRdfException.java40
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/IRdfExternalObjectReferenceSolver.java30
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfDefaults.java27
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfObjectReference.java48
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubject.java46
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubjectUriType.java13
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfTagType.java16
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfVersion.java13
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimHeaderException.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimPayloadException.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlException.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/MissingSchemaException.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaBuilder.java118
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaResource.java52
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateDefaults.java39
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateUtilities.java37
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/ITimer.java27
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/Timer.java25
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/Charset.java22
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileEvent.java75
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileNotFoundException.java24
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcher.java230
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcherIOException.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IFileSystemListener.java35
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IIndentedWriter.java221
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IODefaults.java31
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IOUtilities.java161
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IndentedWriter.java340
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/IKeyOwner.java26
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/IUniqueIdProvider.java123
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/Key.java193
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/KeyType.java105
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/UniqueIdProvider.java317
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/AbstractException.java76
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/AbstractIOException.java78
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/AbstractMessage.java63
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/AbstractRuntimeException.java76
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/ILogger.java101
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/INotification.java27
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/Logger.java158
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/LoggerFactory.java28
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/NotificationDelegate.java90
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/FailedToConvertException.java82
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/FailedToCreateException.java71
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/FailedToDeleteException.java72
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/FailedToFindException.java72
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/FailedToImportException.java81
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/FailedToPublishException.java81
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/InvalidParameterException.java71
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/ObjectIgnoredMessage.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/SuccessfullyConvertedMessage.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/SuccessfullyCreatedMessage.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/SuccessfullyDeletedMessage.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/messaging/messages/SuccessfullyFoundMessage.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/IBuilder.java21
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/IModelChangedEvent.java20
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/IModelDefinition.java30
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/IModelListener.java18
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/IModelMapper.java28
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/IModelTreeWalkerVisitor.java12
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/ModelChangedEvent.java53
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/model/ModelTreeWalker.java199
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/net/NetUtilities.java77
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/net/UrlDefaults.java19
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/net/UrlQueryParameter.java95
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/net/UrlQueryString.java96
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/number/NumberUtilities.java37
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/string/ISplitter.java9
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/string/StringDefaults.java22
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/string/StringSplitter.java44
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/string/StringUtilities.java200
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/string/UuidSplitter.java48
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/FatalException.java30
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/InvalidOperationException.java24
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/type/EntityCounter.java331
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/type/ITypeInformationProvider.java136
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/type/TypeDefaults.java22
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/type/TypeInformationProvider.java150
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/system/type/TypeUtilities.java325
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/InvalidValueException.java109
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/MissingValueException.java54
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/ValueOutOfRangeException.java198
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/AbstractParameter.java137
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/BooleanParameter.java36
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/IParameter.java59
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/IParameters.java109
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/IntegerParameter.java92
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/ListParameter.java103
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/LocalDateTimeParameter.java96
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/MissingParameterException.java57
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/MissingParametersException.java20
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/Parameters.java399
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/StringParameter.java92
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/TimestampParameter.java71
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/UnexpectedParameterException.java57
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/parameter/UuidParameter.java52
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/ICustomParameterValidator.java40
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/IXParameters.java9
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/NoParameters.java17
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/ParameterUtilities.java300
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/ByteValidator.java46
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/CharacterValidator.java37
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/DateValidator.java56
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/DoubleValidator.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/FileValidator.java38
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/FloatValidator.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/IntegerValidator.java46
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/ListValidator.java59
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/LocalDateTimeValidator.java56
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/LongValidator.java46
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/Parameter.java52
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/ParameterValidator.java24
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/ShortValidator.java46
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/annotations/StringValidator.java55
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/AbstractParameterDefinition.java248
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/BooleanParameterDefinition.java81
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/ByteParameterDefinition.java130
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/CharacterParameterDefinition.java120
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/DateParameterDefinition.java113
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/DoubleParameterDefinition.java138
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/EnumParameterDefinition.java50
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/FileParameterDefinition.java89
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/FloatParameterDefinition.java138
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/IParameterDefinition.java195
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/IntegerParameterDefinition.java130
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/ListParameterDefinition.java139
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/LocalDateTimeParameterDefinition.java112
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/LongParameterDefinition.java130
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/ShortParameterDefinition.java130
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/StringParameterDefinition.java119
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/UUIDParameterDefinition.java39
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/items/AbstractItemDecoder.java128
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/items/IItemDecoder.java28
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/items/IItemEncoder.java25
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/items/ItemEncoder.java38
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/items/StringItemDecoder.java15
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/definitions/items/UUIDItemDecoder.java17
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/AbstractParameterException.java49
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/AbstractParameterRuntimeException.java49
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/InterParameterException.java34
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/InvalidParameterDefinitionException.java45
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/InvalidParameterValueException.java56
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/InvalidParametersException.java93
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/MissingParameterException.java36
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/value/xparameter/exceptions/ParameterValueOutOfRangeException.java197
-rw-r--r--cim-cache/org.eclipse.openk.common/src/main/resources/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/org/eclipse/openk/common/Mock.java19
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/org/eclipse/openk/common/dataexchange/cim/message/ACLineSegment.java16
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/org/eclipse/openk/common/dataexchange/cim/message/BaseVoltage.java25
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageWriterTest.java82
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/org/eclipse/openk/common/dataexchange/cim/message/IdentifiedObject.java47
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/java/org/eclipse/openk/common/dataexchange/cim/message/Voltage.java44
-rw-r--r--cim-cache/org.eclipse.openk.common/src/test/resources/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/AbstractServiceAdapterController.java49
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/IServiceAdapterController.java43
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/CimMessageUtilities.java396
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/CimModelConverter.java300
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/CimModelMapper.java36
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/deserializer/CimRdfDeserializer.java101
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/deserializer/CimXmlDeserializer.java100
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/importer/AbstractCimRestImporter.java126
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/importer/CimRestImporterConfiguration.java61
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/responder/AbstractCimResponder.java92
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/responder/AbstractCimRestResponder.java86
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/responder/CimRequestParameters.java30
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/responder/CimResponderConfiguration.java16
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/responder/CimRestResponderConfiguration.java14
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/responder/ICimHeaderParameters.java51
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/serializer/CimRdfSerializer.java92
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/cim/serializer/CimXmlSerializer.java93
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/deserializer/AbstractDeserializer.java159
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/deserializer/AbstractDeserializerFactory.java114
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/deserializer/DeserializerConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/deserializer/IDeserializer.java57
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/deserializer/IDeserializerFactory.java52
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/exporter/AbstractExporter.java190
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/exporter/AbstractExporterFactory.java114
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/exporter/ExporterConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/exporter/IExportListener.java21
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/exporter/IExporter.java88
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/exporter/IExporterFactory.java50
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/AbstractFileImporter.java51
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/AbstractImporter.java356
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/AbstractImporterFactory.java114
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/AbstractRestImporter.java228
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/FileImporterConfiguration.java28
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/IImportListener.java28
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/IImporter.java85
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/IImporterFactory.java50
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/ImportFinishedEvent.java47
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/ImporterConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/importer/RestImporterConfiguration.java24
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/AbstractResponder.java274
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/AbstractResponderFactory.java114
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/AbstractRestResponder.java199
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/IHttpResponse.java127
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/IResponder.java78
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/IResponderFactory.java50
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/ResponderConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/responder/RestResponderConfiguration.java11
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/serializer/AbstractSerializer.java157
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/serializer/AbstractSerializerFactory.java114
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/serializer/ISerializer.java59
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/serializer/ISerializerFactory.java52
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/dataexchange/serializer/SerializerConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/mock/ServiceAdapterContextMock.java51
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/mock/ServiceAdapterControllerMock.java56
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/mock/dataexchange/serializer/SerializerFactoryMock.java23
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/java/org/eclipse/openk/service/adapter/mock/dataexchange/serializer/SerializerMock.java83
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/resources/copy-mapping.xml15
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/resources/export-mapping.xml66
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/main/resources/import-mapping.xml23
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/AbstractServiceAdapterControllerTest.java127
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/dataexchange/responder/BreakersResponderTest.java50
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/dataexchange/serializer/AbstractSerializerFactoryTest.java37
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/dataexchange/serializer/AbstractSerializerTest.java260
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/dataexchange/serializer/ModelDefinitionMock.java79
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/dataexchange/serializer/SerializerFactoryMock.java43
-rw-r--r--cim-cache/org.eclipse.openk.service/service-adapter/src/test/java/org/eclipse/openk/service/adapter/dataexchange/serializer/SerializerMock.java77
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/pom.xml35
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/main/java/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/main/java/org/eclipse/openk/service/servicecommon/UnitMultiplier.java90
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/main/java/org/eclipse/openk/service/servicecommon/UnitMultiplierUtilities.java86
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/main/java/org/eclipse/openk/service/servicecommon/UnitSymbol.java619
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/main/resources/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/test/java/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.service/service-common/src/test/resources/.gitignore0
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/AbstractServiceComponent.java168
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/AbstractServiceContext.java39
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/AbstractServiceCoreController.java41
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/IServiceComponent.java57
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/IServiceContext.java23
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/IServiceCoreController.java30
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/command/CommandAcceptor.java115
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/configuration/AbstractConfigurationDataProvider.java71
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/configuration/AbstractPropertiesFileConfigurationDataProvider.java134
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/configuration/IConfigurationDataProvider.java31
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/configuration/MissingConfigurationFileException.java31
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/event/IServiceEventListener.java20
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/event/ServiceEvent.java67
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/event/ServiceEventListenerAdapter.java12
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/event/ServiceEventType.java15
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/mock/ConfigurationMock.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/mock/ServiceComponentMock.java87
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/mock/ServiceCoreContextMock.java51
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/main/java/org/eclipse/openk/service/servicecore/mock/ServiceCoreControllerMock.java39
-rw-r--r--cim-cache/org.eclipse.openk.service/service-core/src/test/java/org/eclipse/openk/service/servicecore/AbstractServiceCoreControllerTest.java77
-rw-r--r--cim-cache/org.eclipse.openk.service/service-infrastructure/src/main/java/org/eclipse/openk/service/infrastructure/dataexchange/rest/AbstractHttpRestEndPoint.java157
-rw-r--r--cim-cache/org.eclipse.openk.service/service-infrastructure/src/main/java/org/eclipse/openk/service/infrastructure/dataexchange/rest/HttpResponseWriter.java177
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/AbstractServiceLogicController.java21
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/IServiceLogicController.java19
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/modifier/AbstractModifier.java107
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/modifier/IModifier.java20
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/modifier/ModifierConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/view/AbstractView.java109
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/view/AbstractViewFactory.java103
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/view/IView.java40
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/view/IViewFactory.java42
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/dataexchange/view/ViewConfiguration.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/mock/ServiceLogicContextMock.java51
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/mock/ServiceLogicControllerMock.java24
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/mock/dataexchange/view/ViewFactoryMock.java21
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/main/java/org/eclipse/openk/service/servicelogic/mock/dataexchange/view/ViewMock.java42
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/test/java/org/eclipse/openk/service/servicelogic/AbstractServiceLogicControllerTest.java32
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/test/java/org/eclipse/openk/service/servicelogic/dataexchange/view/AbstractViewFactoryTest.java45
-rw-r--r--cim-cache/org.eclipse.openk.service/service-logic/src/test/java/org/eclipse/openk/service/servicelogic/dataexchange/view/AbstractViewTest.java165
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/AbstractServiceModelController.java89
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/IServiceModelController.java48
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/mock/EntityMock.java26
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/mock/ServiceModelContextMock.java51
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/mock/ServiceModelControllerMock.java40
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/EntityLookup.java10
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/EntityPersister.java10
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/IDomainObject.java8
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/IEntity.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/IKeyRepository.java25
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/IModification.java5
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/INode.java33
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/INodeVisitor.java118
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/IRepository.java72
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/ITraversalStrategy.java48
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/IValueObject.java8
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/InMemoryEntityRepository.java56
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/InMemoryRepository.java127
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/Key.java56
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/Relation.java27
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ACDCTerminal.java96
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ACLineSegment.java106
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/AbstractMeasurement.java120
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/AbstractObjectBuilder.java28
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/AnalogToDigitalLogicKind.java30
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ApparentPower.java76
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/AssetInfo.java50
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/BaseVoltage.java92
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Breaker.java62
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/BusbarSection.java76
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/CollectingEquipmentVisitor.java196
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ConductingEquipment.java111
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Conductor.java41
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ConformLoad.java44
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ConnectivityNode.java48
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ConnectivityNodeContainer.java38
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Connector.java21
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/CurrentFlow.java76
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Disconnector.java41
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/EnergyConsumer.java127
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/EnergySource.java139
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Equipment.java105
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/EquipmentContainer.java87
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/GateLogicKind.java36
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/IEquipmentVisitor.java115
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/IdentifiedObject.java281
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Junction.java41
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Length.java76
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Line.java24
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/LoadBreakSwitch.java38
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Measurement.java67
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/MeasurementPoint.java131
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/MeasurementPointType.java13
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/MeasurementType.java81
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/MeasurementValue.java65
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/MktEnergyConsumer.java44
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Name.java96
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/NameType.java132
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/NameTypeAuthority.java83
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/NonConformLoad.java45
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PSRType.java18
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PerCent.java83
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PerLengthImpedance.java63
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PerLengthLineParameter.java17
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PerLengthSequenceImpedance.java78
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PhaseCode.java97
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PowerSystemResource.java63
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PowerTransformer.java350
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/PowerTransformerEnd.java201
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ProtectedSwitch.java44
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/RatioTapChanger.java56
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Reactance.java77
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/ResistancePerLength.java78
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Seconds.java63
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/StationSupply.java43
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Substation.java72
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Switch.java189
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/TapChanger.java273
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Terminal.java124
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/TimeSeries.java129
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/TransformerEnd.java237
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/Voltage.java104
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/VoltageInterval.java38
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/VoltageLevel.java88
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/main/java/org/eclipse/openk/service/model/repository/model/WireInfo.java336
-rw-r--r--cim-cache/org.eclipse.openk.service/service-model/src/test/java/org/eclipse/openk/service/model/AbstractServiceModelControllerTest.java47
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/AbstractMockUpTopologyResponder.java104
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/AcLineSegmentsResponder_V2.java47
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/AcLineSegmentsResponder_V3.java50
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BaseVoltagesResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BaseVoltagesResponder_V3.java50
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BaysResponder_V2.java49
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BreakersResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BreakersResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BusbarSectionsResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/BusbarSectionsResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/DisconnectorsResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/DisconnectorsResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/EarthFaultCompensatorsResponder_V1.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/EnergyConsumersResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/EnergyConsumersResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/EnergySourcesResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/EnergySourcesResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/GeographicalRegionsResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/GroundingImpedancesResponder_V1.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/GroundsResponder_V1.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/JunctionsResponder_V2.java46
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/JunctionsResponder_V3.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/LinesResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/LinesResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/LinesTypesResponder_V2.java50
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/LoadBreakSwitchesResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/LoadBreakSwitchesResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/PetersenCoilsResponder_V1.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/PlantsResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/PowerTransformersResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/PowerTransformersResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/SubGeographicalRegionsResponder_V2.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/SubstationTypesResponder_V3.java50
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/SubstationsResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/SubstationsResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/SwitchesResponder_V2.java45
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/SwitchesResponder_V3.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/TopologyIdResponder_V1.java101
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/TopologyResponder_V2.java112
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/VoltageLevelsResponder_V2.java43
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/responder/VoltageLevelsResponder_V3.java49
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/test/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/BusbarSectionsResponderTest.java41
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/test/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/DisconnectorsResponder_V3Test.java59
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-adapter/src/test/java/org/eclipse/openk/sourcesystem/mockuptopology/adapter/dataexchange/Responder_V3Tests.java34
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/AcLineSegmentsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/BaseVoltagesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/BaysRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/BreakersRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/BusbarSectionsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/DisconnectorsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/EarthFaultCompensatorsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/EnergyConsumersRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/EnergySourcesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/GeographicalRegionsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/GroundingImpedancesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/GroundsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/JunctionsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/LineTypesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/LinesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/LoadBreakSwitchesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/PetersenCoilsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/PlantsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/PowerTransformersRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/SubGeographicalRegionsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/SubstationTypesRestEndPoint.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/SubstationsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/SwitchesRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/TopologyIdRestEndPoint.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/TopologyRestEndPoint.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-infrastructure/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/infrastructure/dataexchange/rest/VoltageLevelsRestEndPoint.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/AbstractMockUpTopologyView.java87
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/AcLineSegmentsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/BaseVoltagesView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/BaysView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/BreakersView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/BusbarSectionsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/DisconnectorsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/EarthFaultCompensatorsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/EnergyConsumersView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/EnergySourcesView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/GeographicalRegionsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/GroundingImpedancesView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/GroundsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/JunctionsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/LineTypesView.java88
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/LinesView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/LoadBreakSwitchesView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/PetersenCoilsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/PlantsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/PowerTransformersView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/SubGeographicalRegionsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/SubstationTypesView.java88
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/SubstationsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/SwitchesView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/TopologyIdView.java75
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/TopologyView.java69
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/dataexchange/view/VoltageLevelsView.java44
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/generator/IObjectGenerator.java19
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/generator/ITopologyElementGenerator.java25
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/generator/ITopologyGenerator.java25
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/AbstractConductingEquipmentFactory.java159
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/AbstractTopologyElementFactory.java135
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/AcLineSegmentFactory.java141
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/BaseVoltageFactory.java26
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/BaseVoltageFactoryParameters.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/BayFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/BreakerFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/BusbarSectionFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/ConductingEquipmentFactoryParameters.java120
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/DisconnectorFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/EarthFaultCompensatorFactory.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/EnergyConsumerFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/EnergySourceFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/GeographicalRegionFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/GroundFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/GroundingImpedanceFactory.java30
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/ITopologyElementFactory.java32
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/ITopologyFactory.java31
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/JunctionFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/LineFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/LineTypeFactory.java18
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/LoadBreakSwitchFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/MockUpTopologyUtilities.java600
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/PetersenCoilFactory.java51
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/PlantFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/PowerTransformerFactory.java124
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/PowerTransformerFactoryParameters.java114
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/SubGeographicalRegionFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/SubstationFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/SubstationTypeFactory.java18
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/SwitchFactory.java52
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/TopologyElementFactoryParameters.java138
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/TopologyIdFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/VoltageLevelFactory.java17
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-logic/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/logic/processor/topologyfactory/referencetopology/ReferenceTopologyFactory.java364
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-service/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/service/dataexchange/serializer/SerializerFactory.java246
-rw-r--r--cim-cache/org.eclipse.openk.sourcesystem.mockuptopology/mock-up-topology-service/src/main/java/org/eclipse/openk/sourcesystem/mockuptopology/service/dataexchange/view/ViewFactory.java226
567 files changed, 44525 insertions, 0 deletions
diff --git a/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Forecast.java b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Forecast.java
new file mode 100644
index 00000000..c71c1f6b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Forecast.java
@@ -0,0 +1,35 @@
+package org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.BTC;
+
+import org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.Core.ConductingEquipment;
+
+/**
+ * @author BTC AG (generated); modelled by migruend
+ * @version 1.0
+ * @created 10-Aug-2017 18:10:15
+ */
+ @SuppressWarnings("javadoc")
+ public class Forecast extends IntervalSchedule {
+
+ private ConductingEquipment m_ConductingEquipment;
+
+ public Forecast(){
+
+ }
+
+ /**
+ * @return the m_ConductingEquipment
+ */
+ public ConductingEquipment getM_ConductingEquipment() {
+
+ return m_ConductingEquipment;
+ }
+
+ /**
+ * @param m_ConductingEquipment the m_ConductingEquipment to set
+ */
+ public void setM_ConductingEquipment(ConductingEquipment m_ConductingEquipment) {
+
+ this.m_ConductingEquipment = m_ConductingEquipment;
+ }
+
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/IntervalSchedule.java b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/IntervalSchedule.java
new file mode 100644
index 00000000..072451d2
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/IntervalSchedule.java
@@ -0,0 +1,32 @@
+package org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.BTC;
+
+import java.util.Date;
+
+import org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.Core.RegularIntervalSchedule;
+import org.eclipse.openk.common.dataexchange.cim.*;
+
+/**
+ * @author BTC AG (generated); modelled by migruend
+ * @version 1.0
+ * @created 10-Aug-2017 18:10:36
+ */
+ @SuppressWarnings("javadoc")
+ public class IntervalSchedule extends RegularIntervalSchedule {
+
+ @Cim(originalType = "DateTime")
+ private Date createdDateTime;
+
+
+ public Date getCreatedDateTime() {
+ return createdDateTime;
+ }
+
+ public void setCreatedDateTime(final Date value) {
+ this.createdDateTime = value;
+ }
+
+ public IntervalSchedule(){
+
+ }
+
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/NonRotatingEnergy.java b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/NonRotatingEnergy.java
new file mode 100644
index 00000000..b2721c47
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/NonRotatingEnergy.java
@@ -0,0 +1,17 @@
+package org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.BTC;
+
+import org.eclipse.openk.common.dataexchange.cim.*;
+
+/**
+ * @author BTC AG (generated); modelled by migruend
+ * @version 1.0
+ * @created 10-Aug-2017 18:10:59
+ */
+ @SuppressWarnings("javadoc")
+ public class NonRotatingEnergy implements ICimEntity {
+
+ public NonRotatingEnergy(){
+
+ }
+
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Schedule.java b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Schedule.java
new file mode 100644
index 00000000..7dd1ad9e
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.cim17v07/src/main/java/org/eclipse/openk/cim/cim17v07/TC57CIM/IEC61970/Base/BTC/Schedule.java
@@ -0,0 +1,35 @@
+package org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.BTC;
+
+import org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.Core.ConductingEquipment;
+
+/**
+ * @author BTC AG (generated); modelled by migruend
+ * @version 1.0
+ * @created 10-Aug-2017 18:11:34
+ */
+ @SuppressWarnings("javadoc")
+ public class Schedule extends IntervalSchedule {
+
+ private ConductingEquipment m_ConductingEquipment;
+
+ public Schedule(){
+
+ }
+
+ /**
+ * @return the m_ConductingEquipment
+ */
+ public ConductingEquipment getM_ConductingEquipment() {
+
+ return m_ConductingEquipment;
+ }
+
+ /**
+ * @param m_ConductingEquipment the m_ConductingEquipment to set
+ */
+ public void setM_ConductingEquipment(ConductingEquipment m_ConductingEquipment) {
+
+ this.m_ConductingEquipment = m_ConductingEquipment;
+ }
+
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/.gitignore b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/.gitignore
new file mode 100644
index 00000000..e35a172b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/.gitignore
@@ -0,0 +1,8 @@
+/target/
+/.checkstyle
+/.classpath
+/.idea
+*.iml
+/.project
+/.settings/
+/.springBeans \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/pom.xml b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/pom.xml
new file mode 100644
index 00000000..c9d2713a
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/pom.xml
@@ -0,0 +1,54 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.openk.cim.profile</groupId>
+ <artifactId>openkonsequenz</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <name>${project.groupId}.${project.artifactId}</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
+ <checkstyle.version>7.1.2</checkstyle.version>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <!-- Checkstyle -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>${checkstyle.plugin.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>${checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!-- com.btc -->
+ <dependency>
+ <groupId>org.eclipse.openk.cim</groupId>
+ <artifactId>cim17v07</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/.gitignore b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/.gitignore
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/OpenKonsequenz.java b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/OpenKonsequenz.java
new file mode 100644
index 00000000..7da3e313
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/OpenKonsequenz.java
@@ -0,0 +1,79 @@
+package org.eclipse.openk.cim.profile.openkonsequenz;
+
+import org.eclipse.openk.common.Version;
+import org.eclipse.openk.common.model.IModelDefinition;
+
+/**
+ * The <i>Openkonsequenz</i> model definition.
+ *
+ * @author Michael Kotten
+ */
+public final class OpenKonsequenz implements IModelDefinition {
+
+ // Constants
+ public static final OpenKonsequenz INSTANCE = new OpenKonsequenz(new Version(1));
+
+ // Attributes
+ private Version version;
+
+ // Constructors
+ /**
+ * @param version
+ * the <i>CIM</i> version
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>version</code> is <code>null</code></li>
+ * </ul>
+ */
+ private OpenKonsequenz(Version version) {
+
+ if(version == null)
+ throw new IllegalArgumentException("version", new NullPointerException());
+ else
+ this.version = version;
+ }
+
+ // Methods
+ @Override
+ public int compareTo(IModelDefinition value) {
+
+ int result;
+
+ if(value == null)
+ result = 1;
+ else {
+ if(value instanceof OpenKonsequenz)
+ result = version.compareTo(((OpenKonsequenz) value).version);
+ else
+ result = encode().compareTo(value.encode());
+ }
+
+ return result;
+ }
+
+ @Override
+ public String encode() {
+
+ return version.encode();
+ }
+
+ @Override
+ public String toString() {
+
+ return encode();
+ }
+
+ // Properties
+ @Override
+ public Package getPackage() {
+
+ return getClass().getPackage();
+ }
+
+ @Override
+ public Version getVersion() {
+
+ return version;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/api/topology/TopologyId.java b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/api/topology/TopologyId.java
new file mode 100644
index 00000000..785307e9
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/java/org/eclipse/openk/cim/profile/openkonsequenz/api/topology/TopologyId.java
@@ -0,0 +1,12 @@
+package org.eclipse.openk.cim.profile.openkonsequenz.api.topology;
+
+import org.eclipse.openk.cim.cim17v07.TC57CIM.IEC61970.Base.Core.IdentifiedObject;
+
+/**
+ * The identifier of the topology.
+ *
+ * @author Christian Brunzendorf
+ */
+public final class TopologyId extends IdentifiedObject {
+
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/resources/.gitignore b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/resources/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/main/resources/.gitignore
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/java/.gitignore b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/java/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/java/.gitignore
diff --git a/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/resources/.gitignore b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/resources/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.cim.profile.openkonsequenz/src/test/resources/.gitignore
diff --git a/cim-cache/org.eclipse.openk.common/.gitignore b/cim-cache/org.eclipse.openk.common/.gitignore
new file mode 100644
index 00000000..e35a172b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/.gitignore
@@ -0,0 +1,8 @@
+/target/
+/.checkstyle
+/.classpath
+/.idea
+*.iml
+/.project
+/.settings/
+/.springBeans \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/pom.xml b/cim-cache/org.eclipse.openk.common/pom.xml
new file mode 100644
index 00000000..f9d38f4d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/pom.xml
@@ -0,0 +1,121 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.openk</groupId>
+ <artifactId>common</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <name>${project.groupId}.${project.artifactId}</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
+ <checkstyle.version>7.1.2</checkstyle.version>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.0.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Checkstyle -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>${checkstyle.plugin.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>${checkstyle.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- SLF4J -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.22</version>
+ </dependency>
+
+ <!-- org.apache -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-csv</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.5</version>
+ </dependency>
+
+ <!-- junit -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.10.19</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- xml-unit -->
+ <dependency>
+ <groupId>org.xmlunit</groupId>
+ <artifactId>xmlunit-matchers</artifactId>
+ <version>2.3.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- com.google -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>20.0</version>
+ </dependency>
+
+ <!-- apache commons -->
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <!-- org.springframework -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>4.3.3.RELEASE</version>
+ </dependency>
+ </dependencies>
+
+</project> \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/AbstractContext.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/AbstractContext.java
new file mode 100644
index 00000000..3a1c7e75
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/AbstractContext.java
@@ -0,0 +1,62 @@
+package org.eclipse.openk.common;
+
+import org.eclipse.openk.common.date.ITimer;
+import org.eclipse.openk.common.date.Timer;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The base of all contexts.
+ *
+ * @author Casjen Schnars
+ * @author Felix Korb
+ * @author Renko Ortgies
+ */
+public abstract class AbstractContext implements IContext {
+
+ // Attributes
+ private String componentId;
+ private transient ITimer timer;
+
+ // Constructors
+ /**
+ * @param componentId
+ * the identifier of the component (usually the name of the application)
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>componentId</code> is <code>null</code> or <code>""</code></li>
+ * </ul>
+ */
+ protected AbstractContext(String componentId) {
+
+ if(!StringUtilities.hasContent(componentId))
+ throw new IllegalArgumentException("version", new NullPointerException());
+ else
+ this.componentId = componentId;
+ }
+
+ // Methods
+ /**
+ * @return the timer; not <code>null</code>
+ */
+ protected ITimer createTimer() {
+
+ return new Timer();
+ }
+
+ // Properties
+ @Override
+ public final String getComponentId() {
+
+ return componentId;
+ }
+
+ @Override
+ public final ITimer getTimer() {
+
+ if(timer == null)
+ timer = createTimer();
+
+ return timer;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IContext.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IContext.java
new file mode 100644
index 00000000..91778254
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IContext.java
@@ -0,0 +1,22 @@
+package org.eclipse.openk.common;
+
+import org.eclipse.openk.common.date.ITimer;
+
+/**
+ * Defines the commonalities of all application/component contexts; for example revision/version for input and output
+ *
+ * @author Felix Korb
+ */
+public interface IContext {
+
+ // Properties
+ /**
+ * @return the identifier of the component (usually the name of the application) that owns the context; not <code>null</code> and not <code>""</code>
+ */
+ String getComponentId();
+
+ /**
+ * @return the timer-object; not <code>null</code>
+ */
+ ITimer getTimer();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IVersion.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IVersion.java
new file mode 100644
index 00000000..1804cf27
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/IVersion.java
@@ -0,0 +1,19 @@
+package org.eclipse.openk.common;
+
+import org.eclipse.openk.common.key.IKeyOwner;
+
+/**
+ * Defines the commonalities of all versions.
+ *
+ * @author Felix Korb
+ */
+public interface IVersion extends Comparable<IVersion>, IKeyOwner<String> {
+
+ // Methods
+ /**
+ * Encodes the current version.
+ *
+ * @return the encoded version; not <code>null</code> and not <code>""</code>
+ */
+ String encode();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/Version.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/Version.java
new file mode 100644
index 00000000..88c12a86
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/Version.java
@@ -0,0 +1,73 @@
+package org.eclipse.openk.common;
+
+/**
+ * The default implementation of a version.
+ *
+ * @author Felix Korb
+ */
+public final class Version implements IVersion {
+
+ // Constants
+ /**
+ * The default version number of all NEDIM importers.
+ */
+ public static final IVersion VERSION_ONE = new Version(1);
+
+ // Attributes
+ private int number;
+
+ // Constructors
+ /**
+ * @param number
+ * the number of the version
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>number</code> is less than <code>0</code></li>
+ * </ul>
+ */
+ public Version(int number) {
+
+ if(number < 0)
+ throw new IllegalArgumentException("number");
+ else
+ this.number = number;
+ }
+
+ // Methods
+ @Override
+ public int compareTo(IVersion version) {
+
+ if(version == null)
+ return 1;
+ else
+ return encode().compareTo(version.encode());
+ }
+
+ @Override
+ public String encode() {
+
+ return Integer.toString(number);
+ }
+
+ @Override
+ public boolean hasKey() {
+
+ return true;
+ }
+
+ // Properties
+ @Override
+ public String getKey() {
+
+ return encode();
+ }
+
+ /**
+ * @return the number of the version; greater than or equal to <code>0</code>
+ */
+ public int getNumber() {
+
+ return number;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/collection/AlreadyExistingItemException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/collection/AlreadyExistingItemException.java
new file mode 100644
index 00000000..d96c532b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/collection/AlreadyExistingItemException.java
@@ -0,0 +1,64 @@
+package org.eclipse.openk.common.collection;
+
+import org.eclipse.openk.common.messaging.AbstractRuntimeException;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.value.parameter.StringParameter;
+
+/**
+ * The notification for already existing items.
+ *
+ * @author Felix Korb
+ */
+public class AlreadyExistingItemException extends AbstractRuntimeException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ // Constructors
+ /**
+ * @param item
+ * the item, can be <code>null</code> or <code>""</code>
+ */
+ public AlreadyExistingItemException(String item) {
+
+ this(item, null);
+ }
+
+ /**
+ * @param item
+ * the item, can be <code>null</code> or <code>""</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public AlreadyExistingItemException(String item, Throwable cause) {
+
+ super(createText(item), cause);
+
+ addParameter(new StringParameter("item", item));
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public AlreadyExistingItemException(Throwable cause) {
+
+ super("The operation is invalid!", cause);
+ }
+
+ // Methods
+ /**
+ * Creates the message-text.
+ *
+ * @param item
+ * the item, can be <code>null</code> or <code>""</code>
+ * @return the text
+ */
+ private static String createText(String item) {
+
+ if(StringUtilities.hasContent(item))
+ return "The item '" + item + "' already exists!";
+ else
+ return "The item already exists!";
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/Command.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/Command.java
new file mode 100644
index 00000000..aa34374b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/Command.java
@@ -0,0 +1,59 @@
+package org.eclipse.openk.common.command;
+
+import static java.util.Collections.emptyMap;
+import static java.util.Collections.unmodifiableMap;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * A specific command instance.
+ * A command contains its {@link CommandType} and corresponding parameters with values.
+ *
+ * @author Arne Limburg
+ */
+public final class Command {
+
+ // Attributes
+ private CommandType type;
+ private Map<String, Object> parameters;
+
+ // Constructors
+ /**
+ * @param type
+ * the {@link CommandType}
+ * @param parameters
+ * the mandatory and optional parameters belonging to the command
+ * @throws NullPointerException
+ * when type is null
+ */
+ public Command(CommandType type, Map<String, Object> parameters) {
+
+ if(type == null)
+ throw new NullPointerException("command type is mandatory");
+ this.type = type;
+ if(parameters == null)
+ this.parameters = emptyMap();
+ else
+ this.parameters = unmodifiableMap(new TreeMap<>(parameters));
+ }
+
+ // Properties
+ /**
+ * Returns the command type
+ * @return the {@link CommandType}; never <code>null</code>
+ */
+ public CommandType getType() {
+
+ return type;
+ }
+
+ /**
+ * Returns the parameters belonging to this command.
+ * @return the parameters of this command; never null, but can be emtpy
+ */
+ public Map<String, Object> getParameters() {
+
+ return parameters;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandController.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandController.java
new file mode 100644
index 00000000..f7396aa0
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandController.java
@@ -0,0 +1,95 @@
+package org.eclipse.openk.common.command;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.eclipse.openk.common.value.xparameter.exceptions.InvalidParametersException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+
+/**
+ * The class that is responsible for the execution of a {@link Command}.
+ * It creates a corresponding command execution, finds a matching executor and applies the execution to it.
+ * Furthermore the command controller provides access to the progress of a specific {@link CommandExecution}.
+ *
+ * @author Arne Limburg
+ *
+ */
+@Controller
+public final class CommandController {
+
+ // Attributes
+ @Autowired
+ private Optional<List<ICommandExecutor>> executors;
+ private Map<CommandExecutionId, CommandExecution> executions;
+
+ // Constructors
+ /**
+ * Initializes this controller
+ */
+ public CommandController() {
+ executions = new ConcurrentHashMap<>();
+ }
+
+ // Methods
+ /**
+ * Executes the specified command.
+ * @param command
+ * the command to be executed
+ * @return the id of the started command execution. It may be used to obtain status via {@link #getCommandExecutionProgress(CommandExecutionId)}
+ * @throws NullPointerException
+ * if the specified command is null
+ * @throws InvalidParametersException
+ * if the parameters of the specified command don't match the command type
+ * @throws UnsupportedOperationException
+ * if no {@link ICommandExecutor} is found for the specified command
+ */
+ public CommandExecutionId executeCommand(Command command) throws InvalidParametersException {
+
+ if (command == null)
+ throw new NullPointerException("command is mandatory");
+
+ CommandExecution execution = new CommandExecution(command);
+ CommandExecutionId id = execution.getId();
+
+ if (executors.isPresent()) {
+ for (ICommandExecutor executor: executors.get()) {
+ if (executor.canExecute(command)) {
+ executions.put(id, execution);
+ executor.execute(execution);
+ break;
+ }
+ }
+ }
+
+ if (!executions.containsKey(id))
+ throw new UnsupportedOperationException("No matching " + ICommandExecutor.class.getSimpleName() + " found for command of type " + command.getType());
+
+ return id;
+ }
+
+ /**
+ * Returns the progress log of the specified command execution.
+ * @param id
+ * the id of the command execution
+ * @return the log
+ * @throws NullPointerException
+ * if the specified id is null
+ * @throws IllegalStateException
+ * if no execution could be found for the specified id
+ */
+ public List<String> getCommandExecutionProgress(CommandType type, CommandExecutionId id) {
+
+ if (id == null)
+ throw new NullPointerException("id is mandatory");
+ CommandExecution execution = executions.get(id);
+ if (execution == null)
+ throw new IllegalStateException("no execution could be found for id " + id.getUuid());
+ if (!execution.getCommand().getType().equals(type))
+ throw new IllegalStateException("no execution could be found for type " + type + " id " + id.getUuid());
+
+ return execution.getProgressLog();
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecution.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecution.java
new file mode 100644
index 00000000..0cc9e891
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecution.java
@@ -0,0 +1,87 @@
+package org.eclipse.openk.common.command;
+
+import static java.util.Collections.unmodifiableList;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * A concrete execution of a specific {@link Command}.
+ * Besides the executed command, an execution contains a unique id and progress information,
+ * that may be updated by the corresponding {@link ICommandExecutor}:
+ *
+ * @author Arne Limburg
+ */
+public final class CommandExecution {
+
+ // Attributes
+ private final CommandExecutionId id;
+ private final Command command;
+ private final List<String> progressLog;
+ private final List<String> unmodifiableProgressLog;
+
+ // Constructors
+ /**
+ * Creates a command execution.
+ * Besides storing the corresponding command, this constructor generates a unique id
+ * for this command execution.
+ *
+ * @param value
+ * the corresponding command,
+ * @throws NullPointerException
+ * when value is null
+ */
+ public CommandExecution(Command value) {
+ if (value == null)
+ throw new NullPointerException("command is mandatory");
+ command = value;
+ id = new CommandExecutionId();
+ progressLog = new CopyOnWriteArrayList<>();
+ unmodifiableProgressLog = unmodifiableList(progressLog);
+ }
+
+ // Methods
+ /**
+ * This method may be used by the {@link ICommandExecutor} to report progress.
+ * Because this method may be executed by different threads, it is thread-safe.
+ *
+ * @param value
+ * a {@link String} containing information about the progress of this execution
+ * @throws NullPointerException
+ * when value is null
+ */
+ public void reportProgress(String value) {
+ if (value == null)
+ throw new NullPointerException("command is mandatory");
+ progressLog.add(value);
+ }
+
+
+ // Properties
+ /**
+ * Returns the id of this command execution.
+ * @return the id
+ */
+ public CommandExecutionId getId() {
+
+ return id;
+ }
+
+ /**
+ * Returns the command of this command execution.
+ * @return the command
+ */
+ public Command getCommand() {
+
+ return command;
+ }
+
+ /**
+ * Returns the progress log of this command execution.
+ * @return the progress log
+ */
+ public List<String> getProgressLog() {
+
+ return unmodifiableProgressLog;
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecutionId.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecutionId.java
new file mode 100644
index 00000000..e7d1eebb
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandExecutionId.java
@@ -0,0 +1,71 @@
+package org.eclipse.openk.common.command;
+
+import java.util.UUID;
+
+/**
+ * The id of a {@link CommandExecution}.
+ * It is generated by the corresponding command execution.
+ *
+ * @author Arne Limburg
+ */
+public final class CommandExecutionId {
+
+ // Attributes
+ private final UUID uuid;
+
+ // Constructors
+ /**
+ * Creates a command execution id
+ */
+ public CommandExecutionId() {
+ uuid = UUID.randomUUID();
+ }
+
+ /**
+ * Creates a command execution id for the specified uuid
+ *
+ * @param id
+ * the uuid
+ * @throws NullPointerException
+ * if the uuid is null
+ */
+ public CommandExecutionId(UUID id) {
+ if(id == null)
+ throw new NullPointerException("id is mandatory");
+ uuid = id;
+ }
+
+ // Properties
+ /**
+ * Returns the uuid of this command execution id.
+ *
+ * @return the uuid of this command execution id; never <code>null</code>
+ */
+ public UUID getUuid() {
+
+ return uuid;
+ }
+
+ @Override
+ public String toString() {
+
+ return "CommandExecutionId(" + uuid + ")";
+ }
+
+ @Override
+ public int hashCode() {
+
+ return uuid.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object object) {
+
+ if(this == object)
+ return true;
+ if(!(object instanceof CommandExecutionId))
+ return false;
+ CommandExecutionId id = (CommandExecutionId) object;
+ return uuid.equals(id.uuid);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandType.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandType.java
new file mode 100644
index 00000000..ef1f8345
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/CommandType.java
@@ -0,0 +1,66 @@
+package org.eclipse.openk.common.command;
+
+/**
+ * The type of a {@link Command}.
+ * The command type is a grouping element for commands,
+ * that means, that commands of the same type have the same list of possible and mandatory parameters
+ * and are exceuted by the same {@link ICommandExecutor}.
+ *
+ * @author Arne Limburg
+ *
+ */
+public final class CommandType {
+
+ // Attributes
+ private final String name;
+
+ // Constructors
+ /**
+ * Creates a command type
+ *
+ * @param value
+ * the name of the command type
+ * @throws NullPointerException
+ * when value is null
+ */
+ public CommandType(String value) {
+
+ if(value == null) {
+ throw new NullPointerException("The name of a command type is mandatory");
+ }
+ name = value;
+ }
+
+ // Properties
+ /**
+ * Returns the name of this command type.
+ * @return the name of this command type; never <code>null</code>
+ */
+ public String getName() {
+
+ return name;
+ }
+
+ @Override
+ public String toString() {
+
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+
+ return name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object object) {
+
+ if(this == object)
+ return true;
+ if(!(object instanceof CommandType))
+ return false;
+ CommandType type = (CommandType) object;
+ return name.equals(type.name);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/ICommandExecutor.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/ICommandExecutor.java
new file mode 100644
index 00000000..95907ce7
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/command/ICommandExecutor.java
@@ -0,0 +1,34 @@
+package org.eclipse.openk.common.command;
+
+import org.eclipse.openk.common.messaging.messages.InvalidParameterException;
+import org.springframework.scheduling.annotation.Async;
+
+/**
+ * Instances of this interface are used to execute {@link Command}s.
+ *
+ * @author Arne Limburg
+ */
+public interface ICommandExecutor {
+
+ /**
+ * Tests, if the specified command is executable by this {@link ICommandExecutor}.
+ * That means, that this {@link ICommandExecutor} is able to execute commands of the specified type
+ * and that the specified parameters are valid.
+ *
+ * @return <tt>true</tt>, if this executor is able to execute commands of the specified type.
+ * @throws InvalidParameterException
+ * if this executor is appropriate for the specified command, but the parameters are invalid
+ */
+ boolean canExecute(Command command) throws InvalidParameterException;
+
+ /**
+ * Executes the command specified by the execution.
+ * Implementations of this method may be annotated with \@{@link Async} to be executed asynchronously.
+ * During execution, implementations should call {@link CommandExecution#reportProgress(String)}
+ * to inform listeners about the progress of this command execution.
+ *
+ * @param execution
+ * the command execution to execute
+ */
+ void execute(CommandExecution execution);
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/CommunicationTechnology.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/CommunicationTechnology.java
new file mode 100644
index 00000000..3ca2786b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/CommunicationTechnology.java
@@ -0,0 +1,15 @@
+package org.eclipse.openk.common.dataexchange;
+
+/**
+ * Defines all communication technologies.
+ *
+ * @author Felix Korb
+ */
+public enum CommunicationTechnology {
+
+ // Constants
+ DataBase,
+ File,
+ InProcess,
+ REST
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeDefaults.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeDefaults.java
new file mode 100644
index 00000000..4ed6c4d4
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeDefaults.java
@@ -0,0 +1,25 @@
+package org.eclipse.openk.common.dataexchange;
+
+/**
+ * Provides some data exchange default values.
+ *
+ * @author Felix Korb
+ */
+@Deprecated
+public final class DataExchangeDefaults {
+
+ // Constants
+ // public static final String IMPORT_FORMAT_XML_1_0_UTF_8_CIM_17_7 = "XML 1.0 UTF-8 CIM 17.7";
+ // public static final String INPUT_DATA_MODEL_CIM_17_7 = "CIM 17.7";
+ // public static final String INPUT_FORMAT_XML_1_0 = "XML 1.0 UTF-8";
+ // public static final String OUTPUT_DATA_MODEL_CIM_17_7 = "CIM 17.7";
+ // public static final String OUTPUT_FORMAT_XML_1_0 = "XML 1.0 UTF-8";
+ // public static final String OUTPUT_FORMAT_XML_1_0_UTF_RDF_1_1 = "XML 1.0 UTF-8 RDF 1.1";
+ // public static final String RESPONSE_FORMAT_TEXT_PLAIN = "text/plain";
+ // public static final String RESPONSE_FORMAT_XML_1_0_UTF_8_CIM_17_7 = "XML 1.0 UTF-8 CIM 17.7";
+
+ // Constructors
+ private DataExchangeDefaults() {
+ /* suppresses the instantiation! */
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeFormat.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeFormat.java
new file mode 100644
index 00000000..b44d13c5
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/DataExchangeFormat.java
@@ -0,0 +1,172 @@
+package org.eclipse.openk.common.dataexchange;
+
+import org.eclipse.openk.common.io.IODefaults;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The standard implementation of the {@link IDataExchangeFormat}.
+ *
+ * @author Felix Korb
+ * @author Michael Korta
+ */
+public final class DataExchangeFormat implements IDataExchangeFormat {
+
+ // Constants
+ private static final DataExchangeFormat FORMAT_UTF_8 = new DataExchangeFormat(IODefaults.CHARSET_NAME_UTF_8);
+ private static final DataExchangeFormat FORMAT_XML_1_0 = new DataExchangeFormat("XML 1.0");
+ private static final DataExchangeFormat FORMAT_RDF_1_1 = new DataExchangeFormat("RDF 1.1");
+ public static final DataExchangeFormat FORMAT_CSV = new DataExchangeFormat("csv");
+ public static final DataExchangeFormat FORMAT_MODEL = new DataExchangeFormat("model");
+ public static final DataExchangeFormat FORMAT_TEXT_PLAIN = new DataExchangeFormat("text/plain");
+ public static final DataExchangeFormat FORMAT_XML_1_0_UTF_8 = new DataExchangeFormat(FORMAT_XML_1_0.getKey(), FORMAT_UTF_8);
+ public static final DataExchangeFormat FORMAT_XML_1_0_UTF_8_RDF_1_1 = new DataExchangeFormat(FORMAT_XML_1_0.getKey(), new DataExchangeFormat(FORMAT_UTF_8.getKey(), FORMAT_RDF_1_1));
+ public static final String FORMAT_CSV_ENCODED = FORMAT_CSV.encode();
+ public static final String FORMAT_TEXT_PLAIN_ENCODED = FORMAT_TEXT_PLAIN.encode();
+ public static final String FORMAT_XML_1_0_UTF_8_ENCODED = "XML 1.0_UTF-8";
+ public static final String FORMAT_XML_1_0_UTF_8_RDF_1_1_ENCODED = FORMAT_XML_1_0_UTF_8_RDF_1_1.encode();
+
+ // Attributes
+ private String key;
+ private IDataExchangeFormat subFormat;
+
+ // Constructors
+ /**
+ * @param key
+ * the key
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>key</code> is <code>null</code> or <code>""</code></li>
+ * <li><code>key</code> is set, but doesn't match {@link #PATTERN_KEY}</li>
+ * </ul>
+ */
+ public DataExchangeFormat(String key) {
+
+ this(key, null);
+ }
+
+ /**
+ * @param key
+ * the key
+ * @param subFormat
+ * the sub-format; can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>key</code> is <code>null</code> or <code>""</code></li>
+ * <li><code>key</code> is set, but doesn't match {@link #PATTERN_KEY}</li>
+ * </ul>
+ */
+ public DataExchangeFormat(String key, IDataExchangeFormat subFormat) {
+
+ if(StringUtilities.matches(key, PATTERN_KEY))
+ throw new IllegalArgumentException("key");
+ else {
+ this.key = key;
+ this.subFormat = subFormat;
+ }
+ }
+
+ // Methods
+ @Override
+ public int compareTo(IDataExchangeFormat value) {
+
+ int result;
+
+ if(value == null)
+ result = 1;
+ else {
+ if(value == this)
+ result = 0;
+ else
+ result = encode().compareTo(value.encode());
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean contains(IDataExchangeFormat value) {
+
+ if(value == null)
+ throw new IllegalArgumentException("value", new NullPointerException());
+ else {
+ boolean result;
+
+ if(value.getKey().equals(key))
+ result = true;
+ else {
+ if(subFormat == null)
+ result = false;
+ else
+ result = subFormat.contains(value);
+ }
+
+ return result;
+ }
+ }
+
+ @Override
+ public String encode() {
+
+ StringBuffer result = new StringBuffer();
+
+ /* add key */
+ result.append(key);
+
+ /* add sub-format */
+ if(hasSubFormat()) {
+ result.append(SUB_FORMAT_SEPARATOR);
+ result.append(subFormat.encode());
+ }
+
+ return result.toString();
+ }
+
+ @Override
+ public boolean hasKey() {
+
+ return true;
+ }
+
+ @Override
+ public boolean hasSubFormat() {
+
+ return (subFormat != null);
+ }
+
+ // Properties
+ @Override
+ @SuppressWarnings("hiding")
+ public IDataExchangeFormat getFormat(String key) {
+
+ if(!StringUtilities.hasContent(key))
+ throw new IllegalArgumentException("key");
+ else {
+ IDataExchangeFormat result;
+
+ if(this.key.equals(key))
+ result = this;
+ else {
+ if(subFormat == null)
+ result = null;
+ else
+ result = subFormat.getFormat(key);
+ }
+
+ return result;
+ }
+ }
+
+ @Override
+ public String getKey() {
+
+ return key;
+ }
+
+ @Override
+ public IDataExchangeFormat getSubFormat() {
+
+ return subFormat;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/IDataExchangeFormat.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/IDataExchangeFormat.java
new file mode 100644
index 00000000..1b7e64d8
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/IDataExchangeFormat.java
@@ -0,0 +1,72 @@
+package org.eclipse.openk.common.dataexchange;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.openk.common.key.IKeyOwner;
+
+/**
+ * Defines the commonalities of all data exchange formats.
+ *
+ * @author Felix Korb
+ */
+public interface IDataExchangeFormat extends Comparable<IDataExchangeFormat>, IKeyOwner<String> {
+
+ // Constants
+ char SUB_FORMAT_SEPARATOR = '_';
+
+ /* regular expressions */
+ String REGEX_KEY = "^[_]";
+
+ /* patterns */
+ Pattern PATTERN_KEY = Pattern.compile(REGEX_KEY);
+
+ // Methods
+ /**
+ * Checks if the specified {@link IDataExchangeFormat} is contained in the current {@link IDataExchangeFormat}.
+ *
+ * @param value
+ * the {@link IDataExchangeFormat}
+ * @return the result
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>value</code> is <code>null</code></li>
+ * </ul>
+ */
+ boolean contains(IDataExchangeFormat value);
+
+ /**
+ * Encodes the current data exchange format.
+ *
+ * @return the encoded data exchange format; not <code>null</code> and not <code>""</code>
+ */
+ String encode();
+
+ /**
+ * Checks if the sub-format is set.
+ *
+ * @return the result
+ */
+ boolean hasSubFormat();
+
+ // Properties
+ /**
+ * Returns the format or sub-format with the specified key.
+ *
+ * @param key
+ * the key
+ * @return the {@link IDataExchangeFormat}<br/>
+ * <code>null</code> if there is no format or sub-format with the specified key.
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>key</code> is <code>null</code> or <code>""</code></li>
+ * </ul>
+ */
+ IDataExchangeFormat getFormat(String key);
+
+ /**
+ * @return the sub-format; can be <code>null</code> if there is sub-format
+ */
+ IDataExchangeFormat getSubFormat();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/Cim.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/Cim.java
new file mode 100644
index 00000000..7285a0ce
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/Cim.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.eclipse.openk.common.string.StringDefaults;
+
+/**
+ * Provides additional information of a <i>CIM</i> type.
+ * Can be used to handle type collisions with <i>Java</i>
+ * and naming collisions with <i>Java</i> keywords.
+ *
+ * @author Renko Ortgies
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.FIELD })
+public @interface Cim {
+
+ // Parameter
+ /**
+ * The original name in <i>CIM</i>.
+ */
+ String originalName() default StringDefaults.EMPTY_STRING;
+
+ /**
+ * The original type in <i>CIM</i>.
+ */
+ String originalType() default StringDefaults.EMPTY_STRING;
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimModelDefinition.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimModelDefinition.java
new file mode 100644
index 00000000..08478fa5
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimModelDefinition.java
@@ -0,0 +1,75 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+import org.eclipse.openk.common.model.IModelDefinition;
+
+/**
+ * The <i>CIM</i> model definition.
+ *
+ * @author Felix Korb
+ */
+public class CimModelDefinition implements IModelDefinition {
+
+ // Attributes
+ private CimVersion version;
+
+ // Constructors
+ /**
+ * @param version
+ * the <i>CIM</i> version
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>version</code> is <code>null</code></li>
+ * </ul>
+ */
+ public CimModelDefinition(CimVersion version) {
+
+ if(version == null)
+ throw new IllegalArgumentException("version", new NullPointerException());
+ else
+ this.version = version;
+ }
+
+ // Methods
+ @Override
+ public int compareTo(IModelDefinition value) {
+
+ int result;
+
+ if(value == null)
+ result = 1;
+ else {
+ if(value instanceof CimModelDefinition)
+ result = version.compareTo(((CimModelDefinition) value).version);
+ else
+ result = encode().compareTo(value.encode());
+ }
+
+ return result;
+ }
+
+ @Override
+ public String encode() {
+
+ return version.encode();
+ }
+
+ @Override
+ public final String toString() {
+
+ return encode();
+ }
+
+ // Properties
+ @Override
+ public Package getPackage() {
+
+ return getClass().getPackage();
+ }
+
+ @Override
+ public final CimVersion getVersion() {
+
+ return version;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimVersion.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimVersion.java
new file mode 100644
index 00000000..658f3f6d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/CimVersion.java
@@ -0,0 +1,163 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+import org.eclipse.openk.common.IVersion;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The <i>CIM</i> version.
+ *
+ * The form of a cim version is <code>cim{<b>XX</b>}v{<b>YY</b>}[<b>z</b>]</code>:
+ * <ul>
+ * <li><code><b>XX</b></code> is the major <i>CIM</i> package version</li>
+ * <li><code><b>YY</b></code> is the minor version</li>
+ * <li><code><b>z</b></code> is the sub-minor version (optional)</li>
+ * </ul>
+ *
+ * For example:<br/>
+ * <code>cim16v26a</code>
+ *
+ * @author Felix Korb
+ */
+public final class CimVersion implements IVersion {
+
+ // Attributes
+ private int majorVersion;
+ private int minorVersion;
+ private String subMinorVersion;
+
+ // Constructors
+ /**
+ * @param majorVersion
+ * the major <i>CIM</i> package version
+ * @param minorVersion
+ * the minor version
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>majorVersion</code> is less than <code>0</code></li>
+ * <li><code>minorVersion</code> is less than <code>0</code></li>
+ * </ul>
+ */
+ public CimVersion(int majorVersion, int minorVersion) {
+
+ this(majorVersion, minorVersion, null);
+ }
+
+ /**
+ * @param majorVersion
+ * the major <i>CIM</i> package version
+ * @param minorVersion
+ * the minor version
+ * @param subMinorVersion
+ * the sub-minor version; can be <code>null</code> or <code>""</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>majorVersion</code> is less than <code>0</code></li>
+ * <li><code>minorVersion</code> is less than <code>0</code></li>
+ * </ul>
+ */
+ public CimVersion(int majorVersion, int minorVersion, String subMinorVersion) {
+
+ if((majorVersion < 0) || (minorVersion < 0))
+ if(majorVersion < 0)
+ throw new IllegalArgumentException("majorVersion");
+ else
+ throw new IllegalArgumentException("minorVersion");
+ else {
+ this.majorVersion = majorVersion;
+ this.minorVersion = minorVersion;
+ this.subMinorVersion = subMinorVersion;
+ }
+ }
+
+ // Methods
+ @Override
+ public int compareTo(IVersion value) {
+
+ int result;
+
+ if(value == null)
+ result = 1;
+ else {
+ if(value == this)
+ result = 0;
+ else {
+ if(value instanceof CimVersion) {
+ result = Integer.compare(majorVersion, ((CimVersion) value).majorVersion);
+
+ if(result == 0)
+ result = Integer.compare(minorVersion, ((CimVersion) value).minorVersion);
+
+ if(result == 0)
+ result = StringUtilities.compare(subMinorVersion, ((CimVersion) value).subMinorVersion);
+ }
+ else
+ result = encode().compareTo(value.encode());
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public String encode() {
+
+ StringBuffer result = new StringBuffer();
+
+ result.append("cim");
+ result.append(String.format("%02d", Integer.valueOf(majorVersion)));
+ result.append('v');
+ result.append(String.format("%02d", Integer.valueOf(minorVersion)));
+ if(StringUtilities.hasContent(subMinorVersion))
+ result.append(subMinorVersion);
+
+ return result.toString();
+ }
+
+ @Override
+ public boolean hasKey() {
+
+ return true;
+ }
+
+ @Override
+ public String toString() {
+
+ return encode();
+ }
+
+ // Properties
+ @Override
+ public String getKey() {
+
+ return encode();
+ }
+
+ /**
+ * @return the major <i>CIM</i> package version;<br/>
+ * greater than <code>0</code>
+ */
+ public int getMajorVersion() {
+
+ return majorVersion;
+ }
+
+ /**
+ * @return the minor version;<br/>
+ * greater than or equal to <code>0</code>
+ */
+ public int getMinorVersion() {
+
+ return minorVersion;
+ }
+
+ /**
+ * @return the sub-minor version;<br/>
+ * can be <code>null</code> or <code>""</code>
+ */
+ public String getSubMinorVersion() {
+
+ return subMinorVersion;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimDatatype.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimDatatype.java
new file mode 100644
index 00000000..357f7bb0
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimDatatype.java
@@ -0,0 +1,12 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+/**
+ * Defines the commonalities of all <i>CIM</i> datatypes.
+ *
+ * @author Felix Korb
+ * @author Renko Ortgies
+ */
+public interface ICimDatatype extends ICimEntity {
+
+ /* this is a marker-interface with no methods */
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimEntity.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimEntity.java
new file mode 100644
index 00000000..6d632d8a
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimEntity.java
@@ -0,0 +1,10 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+/**
+ * Defines the commonalities of all <i>CIM</i> entities.
+ *
+ * @author Felix Korb
+ */
+public interface ICimEntity {
+ /* this is a marker-interface with no methods */
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimIdentifiedObject.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimIdentifiedObject.java
new file mode 100644
index 00000000..23d510dc
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimIdentifiedObject.java
@@ -0,0 +1,18 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+import org.eclipse.openk.common.key.IKeyOwner;
+
+/**
+ * Defines the commonalities of all <i>CIM IdentifiedObject</i>s.
+ *
+ * @author Felix Korb
+ */
+public interface ICimIdentifiedObject extends ICimEntity, IKeyOwner<String> {
+
+ // Properties
+ /**
+ * @param value
+ * the key; can be <code>null</code> or <code>""</code>
+ */
+ void setKey(String value);
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimRevision.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimRevision.java
new file mode 100644
index 00000000..40023fd3
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/ICimRevision.java
@@ -0,0 +1,18 @@
+package org.eclipse.openk.common.dataexchange.cim;
+
+import org.eclipse.openk.common.IVersion;
+
+/**
+ * Defines the commonalities of all <i>CIM</i> revisions.
+ *
+ * @author Felix Korb
+ */
+public interface ICimRevision extends IVersion {
+
+ // Properties
+ /**
+ * @return the <i>CIM</i> revision;<br/>
+ * greater than or equal to <code>0</code>
+ */
+ int getRevision();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/AbstractRdf1_1PayloadReader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/AbstractRdf1_1PayloadReader.java
new file mode 100644
index 00000000..aac1750f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/AbstractRdf1_1PayloadReader.java
@@ -0,0 +1,101 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.net.URI;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.cim.ICimIdentifiedObject;
+import org.eclipse.openk.common.dataexchange.converter.IValueDecoder;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespaceMapping;
+import org.eclipse.openk.common.dataexchange.xml.rdf.AbstractRdf1_1Reader;
+import org.eclipse.openk.common.dataexchange.xml.rdf.IRdfExternalObjectReferenceSolver;
+import org.eclipse.openk.common.dataexchange.xml.rdf.RdfObjectReference;
+import org.eclipse.openk.common.net.UrlDefaults;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+
+/**
+ * Transforms a valid <i>RDF 1.1</i> message into a <i>CIM</i> model.
+ *
+ * @author Felix Korb
+ *
+ * @param <R>
+ * the result type
+ */
+public abstract class AbstractRdf1_1PayloadReader<R> extends AbstractRdf1_1Reader<ICimEntity, R> {
+
+ // Constructors
+ /**
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueDecoder
+ * the {@link IValueDecoder}
+ * @param externalEntityReferenceSolver
+ * the {@link IRdfExternalObjectReferenceSolver} to solve external entity references; can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ protected AbstractRdf1_1PayloadReader(ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueDecoder valueDecoder, IRdfExternalObjectReferenceSolver<ICimEntity> externalEntityReferenceSolver) {
+
+ super(ICimEntity.class, typeInformationProvider, xmlNamespaceSolver, valueDecoder, externalEntityReferenceSolver);
+ }
+
+ // Methods
+ @Override
+ protected final void setSubjectKey(ICimEntity subject, URI subjectUri) {
+
+ if(subject instanceof ICimIdentifiedObject)
+ ((ICimIdentifiedObject) subject).setKey(subjectUri.toString());
+ }
+
+ @Override
+ protected final ICimEntity solveExternalReferencedObject(RdfObjectReference<ICimEntity> reference) {
+
+ ICimEntity result;
+
+ if(!Enum.class.isAssignableFrom(reference.attribute.getType()))
+ result = super.solveExternalReferencedObject(reference);
+ else {
+ Enum<?> currentEnum;
+ String enumName;
+ String namespaceUri;
+
+ /* determine enum name & namespace uri */
+ {
+ String uriAsString = reference.objectUri.toString();
+ int hashPosition = uriAsString.lastIndexOf(UrlDefaults.FRAGMENT_SEPARATOR);
+
+ /* enum name */
+ enumName = uriAsString.substring(hashPosition + 1);
+
+ /* namespace uri */
+ namespaceUri = uriAsString.substring(0, hashPosition + 1);
+ }
+
+ /* find enum */
+ {
+ /* determine namespace mapping */
+ XmlNamespaceMapping namespaceMapping = getXmlNamespaceSolver().getNamespaceMappingByUri(namespaceUri);
+
+ if(namespaceMapping == null)
+ throw new UnsupportedOperationException("There is no namespace-mapping for '" + namespaceUri + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+
+ /* find enum */
+ currentEnum = getEntityInformationProvider().findEnum(namespaceMapping.getModelDefinitionPackage(), enumName);
+
+ if(currentEnum == null)
+ throw new UnsupportedOperationException("Missing enum '" + enumName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+
+ result = (ICimEntity) currentEnum;
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageDefaults.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageDefaults.java
new file mode 100644
index 00000000..2af5dc3d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageDefaults.java
@@ -0,0 +1,51 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.net.URI;
+
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespace;
+import org.eclipse.openk.common.net.NetUtilities;
+
+/**
+ * Defines some <i>CIM</i> defaults.
+ *
+ * @author Carsten Meyer
+ */
+public final class CimMessageDefaults {
+
+ // Constants
+ /* header tag names */
+ public static final String TAG_NAME_CORRELATION_ID = "CorrelationID";
+ public static final String TAG_NAME_HEADER = "Header";
+ public static final String TAG_NAME_MESSAGE_ID = "MessageID";
+ public static final String TAG_NAME_NOUN = "Noun";
+ public static final String TAG_NAME_REVISION = "Revision";
+ public static final String TAG_NAME_SOURCE = "Source";
+ public static final String TAG_NAME_TIMESTAMP = "Timestamp";
+ public static final String TAG_NAME_USER = "User";
+ public static final String TAG_NAME_USER_ID = "UserID";
+ public static final String TAG_NAME_VERB = "Verb";
+
+ /* reply tag names */
+ public static final String TAG_NAME_ERROR = "Error";
+ public static final String TAG_NAME_ERROR_CODE = "Code";
+ public static final String TAG_NAME_ERROR_DETAILS = "Details";
+ public static final String TAG_NAME_ERROR_LEVEL = "Level";
+ public static final String TAG_NAME_REPLY = "Reply";
+ public static final String TAG_NAME_RESULT = "Result";
+
+ /* payload tag names */
+ public static final String TAG_NAME_PAYLOAD = "Payload";
+
+ // REFACTOR 2017-03-15 Felix => Felix: maximale Längen aus API-Beschreibung
+ public static final int MAX_SOURCE_LENGTH = 1024;
+ public static final int MAX_USER_ID_LENGTH = 1024;
+
+ /* namespaces */
+ public static final URI CIM_URI = NetUtilities.toURI("http://iec.ch/TC57/2008/CIM-schema-cim17");
+ public static final XmlNamespace CIM_NAMESPACE = new XmlNamespace(CimMessageDefaults.CIM_URI + "#", "cim");
+
+ // Constructors
+ private CimMessageDefaults() {
+ /* suppresses the instantiation! */
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageErrorLevel.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageErrorLevel.java
new file mode 100644
index 00000000..ceb3c8c9
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageErrorLevel.java
@@ -0,0 +1,19 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+/**
+ * Defines all error levels that can be used in a <i>CIM</i> response message.
+ *
+ * @author Felix Korb
+ * @author Frank Jäger
+ *
+ * @see <a href="https://www.beuth.de/de/norm/din-en-61968-100/207326915">DIN EN 61968-100:2014-08</a>
+ */
+public enum CimMessageErrorLevel {
+
+ CATASTROPHIC,
+ DEBUG,
+ ERROR,
+ FATAL,
+ INFORM,
+ WARNING
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageHeader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageHeader.java
new file mode 100644
index 00000000..f8d81ae1
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageHeader.java
@@ -0,0 +1,137 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.time.LocalDateTime;
+import java.util.UUID;
+
+import org.eclipse.openk.common.date.DateDefaults;
+import org.eclipse.openk.common.value.xparameter.annotations.IntegerValidator;
+import org.eclipse.openk.common.value.xparameter.annotations.LocalDateTimeValidator;
+import org.eclipse.openk.common.value.xparameter.annotations.Parameter;
+import org.eclipse.openk.common.value.xparameter.annotations.StringValidator;
+
+/**
+ * The <i>CIM</i> message header.
+ *
+ * @author Felix Korb
+ * @author Frank Jäger
+ */
+public class CimMessageHeader {
+
+ // Constants
+ public static final String PARAMETER_MESSAGE_ID = "message-id";
+ public static final String PARAMETER_NOUN = "noun";
+ public static final String PARAMETER_REVISION = "revision";
+ public static final String PARAMETER_SOURCE = "source";
+ public static final String PARAMETER_TIMESTAMP = "timestamp";
+ public static final String PARAMETER_USER_ID = "user-id";
+
+ // Attributes
+ @Parameter(name = PARAMETER_MESSAGE_ID, optional = false)
+ private UUID messageId;
+
+ @StringValidator(minLength = 1)
+ @Parameter(name = PARAMETER_NOUN, optional = true)
+ private String noun;
+
+ @IntegerValidator(minValue = 1)
+ @Parameter(name = PARAMETER_REVISION, optional = false)
+ private int revision;
+
+ @StringValidator(minLength = 1, maxLength = CimMessageDefaults.MAX_SOURCE_LENGTH)
+ @Parameter(name = PARAMETER_SOURCE, optional = false)
+ private String source;
+
+ @LocalDateTimeValidator(dateFormat = DateDefaults.DATE_TIME_FORMATTER_PATTERN_UTC_TIMESTAMP)
+ @Parameter(name = PARAMETER_TIMESTAMP, optional = false)
+ private LocalDateTime timestamp;
+
+ @StringValidator(minLength = 1, maxLength = CimMessageDefaults.MAX_USER_ID_LENGTH)
+ @Parameter(name = PARAMETER_USER_ID, optional = false)
+ private String userId;
+
+ // Methods
+ /**
+ * Builds the {@link CimMessageHeader} with the specified parameters.
+ *
+ * @param messageId
+ * the message id
+ * @param noun
+ * the noun
+ * @param revision
+ * the revision
+ * @param source
+ * the source
+ * @param timestamp
+ * the timestamp
+ * @param userId
+ * the user id
+ * @return the {@link CimMessageHeader}; not <code>null</code>
+ */
+ public static CimMessageHeader buildMessageHeader(UUID messageId, String noun, int revision, String source, LocalDateTime timestamp, String userId) {
+
+ CimMessageHeader result = new CimMessageHeader();
+
+ result.messageId = messageId;
+ result.noun = noun;
+ result.revision = revision;
+ result.source = source;
+ result.timestamp = timestamp;
+ result.userId = userId;
+
+ return result;
+ }
+
+ // Properties
+ /**
+ * @return the message ID
+ * unique for the this request, created by sender, not <code>null</code>
+ */
+ public final UUID getMessageId() {
+
+ return messageId;
+ }
+
+ /**
+ * @return the noun
+ * unique name describing the topology element, not <code>null</code> and not <code>""</code>
+ */
+ public final String getNoun() {
+
+ return noun;
+ }
+
+ /**
+ * @return the revision number; greater or equal than <code>0</code>
+ */
+ public final int getRevision() {
+
+ return revision;
+ }
+
+ /**
+ * @return the source
+ * unique sender of this message, not <code>null</code> and not <code>""</code>
+ */
+ public final String getSource() {
+
+ return source;
+ }
+
+ /**
+ * @return the timestamp
+ * time when the message was sent (in UTC), not <code>null</code>
+ */
+ public final LocalDateTime getTimestamp() {
+
+ return timestamp;
+ }
+
+ /**
+ * @return the user ID
+ * unique identifier of the logged user (sender), not <code>null</code> and not <code>""</code>
+ */
+ public final String getUserId() {
+
+ return userId;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageResult.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageResult.java
new file mode 100644
index 00000000..4aa81c86
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageResult.java
@@ -0,0 +1,15 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+/**
+ * Defines all reply results that can be used in a <i>CIM</i> response message.
+ *
+ * @author Felix Korb
+ *
+ * @see <a href="https://www.beuth.de/de/norm/din-en-61968-100/207326915">DIN EN 61968-100:2014-08</a>
+ */
+public enum CimMessageResult {
+
+ FAILED,
+ OK,
+ PARTIAL
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageStereotype.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageStereotype.java
new file mode 100644
index 00000000..7fc34c7e
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageStereotype.java
@@ -0,0 +1,16 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+/**
+ * Defines all message stereotypes that can be used in a <i>CIM</i> message.
+ *
+ * @author Felix Korb
+ *
+ * @see <a href="https://www.beuth.de/de/norm/din-en-61968-100/207326915">DIN EN 61968-100:2014-08</a>
+ */
+public enum CimMessageStereotype {
+
+ EventMessage,
+ FaultMessage,
+ RequestMessage,
+ ResponseMessage
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageVerb.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageVerb.java
new file mode 100644
index 00000000..ab0971b1
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageVerb.java
@@ -0,0 +1,26 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+/**
+ * Defines all verbs that can be used in a <i>CIM</i> message.
+ *
+ * @author Felix Korb
+ *
+ * @see <a href="https://www.beuth.de/de/norm/din-en-61968-100/207326915">DIN EN 61968-100:2014-08</a>
+ */
+public enum CimMessageVerb {
+
+ cancel,
+ canceled,
+ change,
+ changed,
+ close,
+ closed,
+ create,
+ created,
+ delete,
+ deleted,
+ execute,
+ executed,
+ get,
+ reply
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageWriter.java
new file mode 100644
index 00000000..4bf0b34f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/CimMessageWriter.java
@@ -0,0 +1,337 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.converter.IValueEncoder;
+import org.eclipse.openk.common.dataexchange.xml.AbstractXmlWriter;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespace;
+import org.eclipse.openk.common.dataexchange.xml.XmlTag;
+import org.eclipse.openk.common.dataexchange.xml.XmlTagTermination;
+import org.eclipse.openk.common.dataexchange.xml.XmlWriter;
+import org.eclipse.openk.common.messaging.INotification;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+
+/**
+ * The base of all <i>CIM</i> <i>XML</i> messages writers.
+ *
+ * @author Felix Korb
+ *
+ * @see <a href="https://www.beuth.de/de/norm/din-en-61968-100/207326915">DIN EN 61968-100:2014-08</a>
+ */
+public class CimMessageWriter extends AbstractXmlWriter {
+
+ private IPayloadWriter payloadWriter;
+
+ // Constructors
+ /**
+ * @param writer
+ * the {@link XmlWriter}
+ * @param payloadWriter
+ * the {@link IPayloadWriter}
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueEncoder
+ * the {@link IValueEncoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * <li><code>payloadWriter</code> is <code>null</code></li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ public CimMessageWriter(XmlWriter writer, IPayloadWriter payloadWriter, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueEncoder valueEncoder) {
+
+ super(writer, typeInformationProvider, xmlNamespaceSolver, valueEncoder);
+
+ if(payloadWriter == null)
+ throw new IllegalArgumentException("payloadWriter", new NullPointerException());
+ else
+ this.payloadWriter = payloadWriter;
+ }
+
+ // Methods
+ /**
+ * Writes the <i>CIM</i> message header.
+ *
+ * @param header
+ * the {@link CimMessageHeader}; must not be <code>null</code>
+ * @param verb
+ * the <i>CIM</i> message verb; must not be <code>null</code>
+ * @throws IOException
+ */
+ private void writeHeader(CimMessageHeader header, CimMessageVerb verb) throws IOException {
+
+ XmlTag headerTag = new XmlTag(CimMessageDefaults.TAG_NAME_HEADER);
+
+ writer.writeTagLine(headerTag, XmlTagTermination.ForceEndTag);
+
+ writer.indent();
+
+ /* write verb */
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_VERB), valueEncoder.encodeEnum(verb));
+
+ /* write noun */
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_NOUN), valueEncoder.encodeValue(header.getNoun()));
+
+ /* write revision */
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_REVISION), valueEncoder.encodeInt(header.getRevision()));
+
+ /* write timestamp */
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_TIMESTAMP), valueEncoder.encodeValue(header.getTimestamp()));
+
+ /* write source */
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_SOURCE), valueEncoder.encodeValue(header.getSource()));
+
+ /* write user & user-id */
+ if(header.getUserId() != null) {
+ XmlTag userTag = new XmlTag(CimMessageDefaults.TAG_NAME_USER);
+
+ /* write user */
+ writer.writeTagLine(userTag, XmlTagTermination.ForceEndTag);
+ writer.indent();
+
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_USER_ID), valueEncoder.encodeValue(header.getUserId()));
+
+ writer.outdent();
+ writer.writeEndTagLine(userTag);
+ }
+
+ /* write message-id */
+ writer.writeTaggedValue(new XmlTag(CimMessageDefaults.TAG_NAME_MESSAGE_ID), valueEncoder.encodeValue(header.getMessageId()));
+
+ writer.outdent();
+
+ writer.writeEndTagLine(headerTag);
+ }
+
+ /**
+ * Writes the <i>CIM</i> message end.
+ *
+ * @param messageTag
+ * the message tag ; must not be <code>null</code>
+ * @throws IOException
+ */
+ private void writeMessageEnd(XmlTag messageTag) throws IOException {
+
+ writer.writeEndTag(messageTag);
+ }
+
+ /**
+ * Writes the <i>CIM</i> message start.
+ *
+ * @param messageTag
+ * the message tag ; must not be <code>null</code>
+ * @throws IOException
+ */
+ private void writeMessageStart(XmlTag messageTag) throws IOException {
+
+ writer.writeDeclaration();
+
+ writer.writeTagLine(messageTag, XmlTagTermination.ForceEndTag);
+ }
+
+ /**
+ * Writes the <i>CIM</i> message reply.
+ *
+ * @param errors
+ * the errors; can be <code>null</code> or empty
+ * @throws IOException
+ */
+ private void writeReply(List<? extends INotification> errors) throws IOException {
+
+ XmlTag replyTag = new XmlTag(CimMessageDefaults.TAG_NAME_REPLY);
+
+ /* start reply */
+ writer.writeTagLine(replyTag, XmlTagTermination.ForceEndTag);
+ writer.indent();
+
+ /* write result */
+ {
+ XmlTag resultTag = new XmlTag(CimMessageDefaults.TAG_NAME_RESULT);
+
+ if((errors != null) && !errors.isEmpty()) {
+ XmlTag errorCodeTag = new XmlTag(CimMessageDefaults.TAG_NAME_ERROR_CODE);
+ XmlTag errorDetailsTag = new XmlTag(CimMessageDefaults.TAG_NAME_ERROR_DETAILS);
+ XmlTag errorLevelTag = new XmlTag(CimMessageDefaults.TAG_NAME_ERROR_LEVEL);
+ XmlTag errorTag = new XmlTag(CimMessageDefaults.TAG_NAME_ERROR);
+
+ writer.writeTaggedValue(resultTag, valueEncoder.encodeEnum(CimMessageResult.FAILED));
+
+ /* write errors */
+ for(INotification error : errors) {
+ writer.writeTagLine(errorTag, XmlTagTermination.ForceEndTag);
+ writer.indent();
+
+ writer.writeTaggedValue(errorCodeTag, valueEncoder.encodeValue(error.getNotificationCode()));
+ writer.writeTaggedValue(errorLevelTag, valueEncoder.encodeEnum(CimMessageErrorLevel.ERROR)); // REMIND 2017-04-22 Felix Korb: use correct error levels => not always 'ERROR'
+ writer.writeTaggedValue(errorDetailsTag, valueEncoder.encodeValue(error.getText()));
+
+ writer.outdent();
+ writer.writeEndTagLine(errorTag);
+ }
+ }
+ else
+ writer.writeTaggedValue(resultTag, valueEncoder.encodeEnum(CimMessageResult.OK));
+ }
+
+ /* end reply */
+ writer.outdent();
+ writer.writeEndTagLine(replyTag);
+ }
+
+ /**
+ * Writes the <i>CIM</i> response message with the specified header and payload.
+ *
+ * @param header
+ * the <i>CIM</i> message header
+ * @param payload
+ * the payload; can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>header</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ public final void writeResponseMessage(CimMessageHeader header, ICimEntity payload) throws IOException {
+
+ writeResponseMessage(header, null, (Object) payload);
+ }
+
+ /**
+ * Writes the <i>CIM</i> response message with the specified header and payload.
+ *
+ * @param header
+ * the <i>CIM</i> message header
+ * @param errors
+ * the errors; can be <code>null</code> or empty
+ * @param payload
+ * the payload; can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>header</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ public final void writeResponseMessage(CimMessageHeader header, List<? extends INotification> errors, ICimEntity payload) throws IOException {
+
+ writeResponseMessage(header, errors, payload);
+ }
+
+ /**
+ * Writes the <i>CIM</i> response message with the specified header and payload.
+ *
+ * @param header
+ * the <i>CIM</i> message header
+ * @param payload
+ * the payload; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>header</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ public final void writeResponseMessage(CimMessageHeader header, List<? extends ICimEntity> payload) throws IOException {
+
+ writeResponseMessage(header, null, (Object) payload);
+ }
+
+ /**
+ * Writes the <i>CIM</i> response message with the specified header and payload.
+ *
+ * @param header
+ * the <i>CIM</i> message header
+ * @param errors
+ * the errors; can be <code>null</code> or empty
+ * @param payload
+ * the payload; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>header</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ public final void writeResponseMessage(CimMessageHeader header, List<? extends INotification> errors, List<? extends ICimEntity> payload) throws IOException {
+
+ writeResponseMessage(header, errors, payload);
+ }
+
+ /**
+ * Writes the <i>CIM</i> response message with the specified header and payload.
+ *
+ * @param header
+ * the <i>CIM</i> message header
+ * @param payload
+ * the payload; can be <code>null</code>
+ * @param errors
+ * the errors; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>header</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ private void writeResponseMessage(CimMessageHeader header, List<? extends INotification> errors, Object payload) throws IOException {
+
+ if(header == null)
+ throw new IllegalArgumentException("header", new NullPointerException());
+ else {
+ XmlTag messageTag;
+ List<XmlNamespace> namespacesToDefine = getXmlNamespaceSolver().getNamespacesToDefine();
+
+ /* create message tag */
+ if(namespacesToDefine != null)
+ messageTag = new XmlTag(CimMessageStereotype.ResponseMessage.name(), getXmlNamespaceSolver().getNamespacesToDefine().<XmlNamespace> toArray(new XmlNamespace[namespacesToDefine.size()]));
+ else
+ messageTag = new XmlTag(CimMessageStereotype.ResponseMessage.name());
+
+ /* start message */
+ writeMessageStart(messageTag);
+ writer.indent();
+
+ /* write header */
+ writeHeader(header, CimMessageVerb.reply);
+
+ /* write reply */
+ writeReply(errors);
+
+ /* write payload */
+ {
+ XmlTag payloadTag = new XmlTag(CimMessageDefaults.TAG_NAME_PAYLOAD);
+
+ /* start payload */
+ writer.writeTagLine(payloadTag, XmlTagTermination.ForceEndTag);
+ writer.indent();
+
+ if(payload != null) {
+ if(payload instanceof ICimEntity)
+ payloadWriter.writePayload((ICimEntity) payload);
+ else
+ payloadWriter.writePayload(new XmlTag(header.getNoun()), (List<? extends ICimEntity>) payload);
+ }
+
+ /* end payload */
+ writer.outdent();
+ writer.writeEndTagLine(payloadTag);
+ }
+
+ /* end message */
+ writer.outdent();
+ writeMessageEnd(messageTag);
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/ErrorCreatingUriException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/ErrorCreatingUriException.java
new file mode 100644
index 00000000..a3373ae0
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/ErrorCreatingUriException.java
@@ -0,0 +1,27 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import org.eclipse.openk.common.messaging.AbstractException;
+
+
+public class ErrorCreatingUriException extends AbstractException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "The URI is malformed or null or empty!";
+
+ // Constructors
+ public ErrorCreatingUriException() {
+
+ this(null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorCreatingUriException(Throwable cause) {
+
+ super(TEXT, cause);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/FailedToWriteMessageException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/FailedToWriteMessageException.java
new file mode 100644
index 00000000..514f6f9e
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/FailedToWriteMessageException.java
@@ -0,0 +1,63 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.openk.common.messaging.AbstractRuntimeException;
+
+/**
+ * Exception handling for: failed writing <i>CIM</i> message
+ *
+ * @author Frank Jäger
+ */
+public class FailedToWriteMessageException extends AbstractRuntimeException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @param objectName
+ * the objectName causing this Exception
+ * @param cause
+ * the cause; can be <code>null</code>
+ */
+ public FailedToWriteMessageException(String objectName, Throwable cause) {
+
+ super(createText(objectName, cause), cause);
+ }
+
+ // Methods
+ /**
+ * Creates the message-text.
+ *
+ * @param objectName
+ * the objectName causing this Exception; must not be <code>null</code> and not <code>empty</code>
+ * @param cause
+ * the cause
+ * @return the text
+ */
+ private static String createText(String objectName, Throwable cause) {
+
+ return findCause(cause) + objectName + "'.";
+ }
+
+ /**
+ * Finds the cause and produces text accordingly
+ *
+ * @param cause
+ * the cause
+ * @return
+ * a text representing the cause
+ */
+ private static String findCause(Throwable cause) {
+
+ if(cause instanceof IllegalAccessException)
+ return "Failed to access '";
+ else if(cause instanceof IllegalArgumentException)
+ return "Illegal argument for '";
+ else if(cause instanceof InvocationTargetException)
+ return "Invocation failed for '";
+ else
+ return "Failed to write message for '";
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/IPayloadWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/IPayloadWriter.java
new file mode 100644
index 00000000..5228a637
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/IPayloadWriter.java
@@ -0,0 +1,42 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.xml.XmlTag;
+
+/**
+ * Interface, that may be implemented by writers, that are able to write a payload for a CIM message.
+ * Implementations of this interface are used by {@link CimMessageWriter}s to write the actual payload.
+ *
+ * @author Arne Limburg
+ */
+public interface IPayloadWriter {
+
+ /**
+ * Writes the specified payload as <i>XML</i>.
+ *
+ * @param payload
+ * the payload; can be <code>null</code>
+ * @throws IOException
+ */
+ void writePayload(ICimEntity payload) throws IOException;
+
+ /**
+ * Writes the specified payload as <i>XML</i>.
+ *
+ * @param nounTag
+ * the tag of the <i>CIM</i> noun
+ * @param payload
+ * the payload; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>nounTag</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ void writePayload(XmlTag nounTag, List<? extends ICimEntity> payload) throws IOException;
+
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadReader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadReader.java
new file mode 100644
index 00000000..f27a43aa
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadReader.java
@@ -0,0 +1,85 @@
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.util.Map;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.converter.IValueDecoder;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.dataexchange.xml.rdf.IRdfExternalObjectReferenceSolver;
+import org.eclipse.openk.common.dataexchange.xml.rdf.RdfSubject;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.xml.sax.Attributes;
+
+/**
+ * Transforms a valid <i>RDF 1.1</i> message into a <i>CIM</i> payload model.
+ *
+ * @author Felix Korb
+ */
+public final class RdfPayloadReader extends AbstractRdf1_1PayloadReader<Map<String, RdfSubject<ICimEntity>>> {
+
+ // Constants
+ private static final String TAG_NAME_PAYLOAD = "Payload";
+
+ // Attributes
+ private boolean payloadSection;
+
+ // Constructors
+ /**
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueDecoder
+ * the {@link IValueDecoder}
+ * @param externalEntityReferenceSolver
+ * the {@link IRdfExternalObjectReferenceSolver} to solve external entity references; can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ public RdfPayloadReader(ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueDecoder valueDecoder, IRdfExternalObjectReferenceSolver<ICimEntity> externalEntityReferenceSolver) {
+
+ super(typeInformationProvider, xmlNamespaceSolver, valueDecoder, externalEntityReferenceSolver);
+
+ this.payloadSection = false;
+ }
+
+ // Methods
+ @Override
+ protected Map<String, RdfSubject<ICimEntity>> createResult(Map<String, RdfSubject<ICimEntity>> subjects, Map<String, RdfSubject<ICimEntity>> unreferencedSubjects) {
+
+ if(subjects.isEmpty())
+ return null;
+ else
+ return subjects;
+ }
+
+ @Override
+ protected boolean isPayloadEndElement(String uri, String localName, String qName) {
+
+ if(payloadSection)
+ if(localName.equals(TAG_NAME_PAYLOAD))
+ payloadSection = false;
+ else
+ return true;
+
+ return false;
+ }
+
+ @Override
+ protected boolean isPayloadStartElement(String uri, String localName, String qName, Attributes atts) {
+
+ if(!payloadSection) {
+ if(localName.equals(TAG_NAME_PAYLOAD))
+ payloadSection = true;
+ }
+ else
+ return true;
+
+ return false;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadWriter.java
new file mode 100644
index 00000000..a298df00
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/RdfPayloadWriter.java
@@ -0,0 +1,472 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.cim.ICimIdentifiedObject;
+import org.eclipse.openk.common.dataexchange.converter.IValueEncoder;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespace;
+import org.eclipse.openk.common.dataexchange.xml.XmlTag;
+import org.eclipse.openk.common.dataexchange.xml.XmlTagTermination;
+import org.eclipse.openk.common.dataexchange.xml.XmlWriter;
+import org.eclipse.openk.common.dataexchange.xml.rdf.AbstractRdf1_1Writer;
+import org.eclipse.openk.common.dataexchange.xml.rdf.RdfSubject;
+import org.eclipse.openk.common.dataexchange.xml.rdf.RdfSubjectUriType;
+import org.eclipse.openk.common.messaging.ILogger;
+import org.eclipse.openk.common.messaging.LoggerFactory;
+import org.eclipse.openk.common.net.UrlDefaults;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.system.FatalException;
+import org.eclipse.openk.common.system.type.EntityCounter;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.eclipse.openk.common.system.type.TypeInformationProvider;
+
+/**
+ * Writes <i>RDF</i> payloads for <i>CIM</i> messages.
+ *
+ * @author Felix Korb
+ * @author Frank Jäger
+ */
+public final class RdfPayloadWriter extends AbstractRdf1_1Writer implements IPayloadWriter {
+
+ // Constructors
+ private static final ILogger LOGGER = LoggerFactory.createLogger(RdfPayloadWriter.class);
+
+ // Attributes
+ private Set<URI> alreadyWrittenEntityIds;
+ private Map<ICimEntity, String> alreadyWrittenUnidentifiableEntityIds;
+
+ // Constructors
+ /**
+ * @param writer
+ * the {@link XmlWriter}
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueEncoder
+ * the {@link IValueEncoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ public RdfPayloadWriter(XmlWriter writer, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueEncoder valueEncoder) {
+
+ super(writer, typeInformationProvider, xmlNamespaceSolver, valueEncoder);
+
+ this.alreadyWrittenEntityIds = new TreeSet<>();
+ this.alreadyWrittenUnidentifiableEntityIds = new HashMap<>();
+ }
+
+ // Methods
+ /**
+ * Creates {@link URI} for the specified object.
+ *
+ * @param object
+ * the object; not <code>null</code>
+ * @param key
+ * the object key; not <code>null</code> and not <code>""</code>
+ * @return the {@link URI}; not <code>null</code>
+ */
+ protected URI createObjectUri(ICimEntity object, String key) {
+
+ URI result = null;
+
+ try {
+ result = new URI(UrlDefaults.FRAGMENT_SEPARATOR + key);
+ }
+ catch(URISyntaxException exception) {
+ throw new UnsupportedOperationException("The key '" + key + "' of the object '" + object.toString() + "' is not a valid URI!", exception); // FIXME 2017-05-11 Felix: geeignete Ausnahme schmeißen
+ }
+
+ return result;
+ }
+
+ /**
+ * Creates {@link URI} for the specified subject.
+ *
+ * @param subject
+ * the subject; not <code>null</code>
+ * @param key
+ * the subject key; not <code>null</code> and not <code>""</code>
+ * @return the {@link URI}; not <code>null</code>
+ */
+ protected URI createSubjectUri(ICimEntity subject, String key) {
+
+ URI result = null;
+
+ try {
+ result = new URI(key);
+ }
+ catch(URISyntaxException exception) {
+ throw new UnsupportedOperationException("The key '" + key + "' of the subject '" + subject.toString() + "' is not a valid URI!", exception); // FIXME 2017-05-11 Felix: geeignete Ausnahme schmeißen
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns the key of the specified {@link ICimEntity}.
+ *
+ * @param entity
+ * the <i>CIM</i> entity; not <code>null</code>
+ * @return the key; not <code>null</code> and not <code>""</code>
+ */
+ protected String getKey(ICimEntity entity) {
+
+ String result;
+
+ if(entity instanceof ICimIdentifiedObject)
+ result = ((ICimIdentifiedObject) entity).getKey();
+ else {
+ result = alreadyWrittenUnidentifiableEntityIds.get(entity);
+
+ /* add new identifier of the unidentifieable entity */
+ if(!StringUtilities.hasContent(result)) {
+ result = UUID.randomUUID().toString();
+ alreadyWrittenUnidentifiableEntityIds.put(entity, result);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Writes an attribute tag into the <i>RDF</i> document
+ *
+ * @param entity
+ * the {@link ICimEntity}, not <code>null</code>
+ * @param attribute
+ * the value to be written to the tag, not <code>null</code>
+ * @throws IOException
+ */
+ protected void writeAttribute(ICimEntity entity, Field attribute) throws IOException {
+
+ try {
+ if(attribute.get(entity) != null) {
+
+ XmlNamespace namespace = getXmlNamespaceSolver().getNamespace(entity.getClass());
+ XmlTag xmlTag = new XmlTag(namespace, attribute.getDeclaringClass().getSimpleName() + "." + attribute.getName());
+
+ if(attribute.get(entity) instanceof Enum) {
+ Enum<?> value = (Enum<?>) attribute.get(entity);
+
+ URI objectUri = new URI(CimMessageDefaults.CIM_URI.toString() + UrlDefaults.FRAGMENT_SEPARATOR + attribute.getType().getSimpleName() + "." + value.name());
+ writeObject(xmlTag, objectUri);
+ }
+ else {
+ /* start tag */
+ writer.writeTag(xmlTag, XmlTagTermination.ForceEndTag);
+
+ /* write attribute value */
+ writeValue(entity, attribute);
+
+ /* end tag */
+ writer.writeEndTag(xmlTag);
+ writer.writeLine();
+ }
+ }
+ }
+ catch(IllegalArgumentException | IllegalAccessException | URISyntaxException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ /**
+ * Iterates through all given entities of type {@link ICimEntity}, does nothing if entities is <code>null</code>
+ *
+ * @param entities
+ * a list of {@link ICimEntity}s, may be <code>null</code>
+ * @throws IOException
+ */
+ protected void writeEntities(List<RdfSubject<ICimEntity>> entities) throws IOException {
+
+ if((entities != null) && !entities.isEmpty()) {
+ List<RdfSubject<ICimEntity>> subjects = new ArrayList<>(entities);
+
+ while(!subjects.isEmpty()) {
+ subjects.addAll(writeEntity(subjects.get(0)));
+ subjects.remove(0);
+ }
+ }
+ }
+
+ /**
+ * Iterating method writing all elements of a {@link ICimEntity} into a RDF document
+ *
+ * @param subject
+ * the given {@link ICimEntity} subject
+ * @return the {@link RdfSubject} references; not <code>null</code> but can be empty
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ protected List<RdfSubject<ICimEntity>> writeEntity(RdfSubject<ICimEntity> subject) throws IOException {
+
+ List<RdfSubject<ICimEntity>> result = Collections.emptyList();
+
+ if((subject != null) && !alreadyWrittenEntityIds.contains(subject.subjectUri)) {/* check already written entities */
+ RdfSubject<ICimEntity> subjectReference;
+ XmlTag subjectTag;
+
+ /* create subject tag */
+ subjectTag = new XmlTag(getXmlNamespaceSolver().getNamespace(subject.subject.getClass()), subject.subject.getClass().getSimpleName());
+
+ alreadyWrittenEntityIds.add(subject.subjectUri);
+
+ /* write start tag */
+ writeSubjectStart(subjectTag, subject.subjectUri, subject.subjectUriType);
+
+ {
+ List<Field> attributes = getEntityInformationProvider().getAttributes(subject.subject);
+
+ writer.indent();
+
+ /* write entity attributes as predicates and objects */
+ if((attributes != null) && !attributes.isEmpty()) {
+ result = new ArrayList<>();
+
+ for(Field attribute : attributes)
+ try {
+ if(Collection.class.isAssignableFrom(attribute.getType()))
+ result.addAll(writeReferences(attribute, (List<ICimEntity>) attribute.get(subject.subject)));
+ // else if(ICimDatatype.class.isAssignableFrom(attribute.getType())) {
+ // subjectReference = writeDatatype(subject, attribute);
+ //
+ // if(subjectReference != null)
+ // subjectReferences.add(subjectReference);
+ // }
+ else if(ICimEntity.class.isAssignableFrom(attribute.getType()) && !attribute.getType().isEnum()) {
+ subjectReference = writeReference(attribute, (ICimEntity) attribute.get(subject.subject));
+
+ if((subjectReference != null) && !alreadyWrittenEntityIds.contains(subjectReference.subjectUri))
+ result.add(subjectReference);
+ }
+ else if(Map.class.isAssignableFrom(attribute.getType()))
+ result.addAll(writeReferences(attribute, (Map<?, ICimEntity>) attribute.get(subject.subject)));
+ else
+ writeAttribute(subject.subject, attribute);
+ }
+ catch(IllegalAccessException | IllegalArgumentException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ writer.outdent();
+ }
+
+ /* write end tag */
+ writeSubjectEnd(subjectTag);
+ }
+
+ return result;
+ }
+
+ @Override
+ public void writePayload(ICimEntity payload) throws IOException {
+
+ writePayload(null, Collections.singletonList(payload));
+ }
+
+ @Override
+ public void writePayload(XmlTag nounTag, List<? extends ICimEntity> payload) throws IOException {
+
+ /* write RDF start */
+ {
+ List<XmlNamespace> namespacesToDefine = getXmlNamespaceSolver().getNamespacesToDefine();
+
+ if(namespacesToDefine == null)
+ writeRdfStart();
+ else
+ writeRdfStart(namespacesToDefine.<XmlNamespace> toArray(new XmlNamespace[namespacesToDefine.size()]));
+ }
+
+ writer.indent();
+
+ /* log number of CIM entities within the payload */
+ if(LOGGER.isDebugEnabled()) {
+ EntityCounter<ICimEntity> entityCounter = new EntityCounter<>(TypeInformationProvider.DEFAULT_INSTANCE, ICimEntity.class);
+
+ LOGGER.debug("'" + entityCounter.countEntities(payload) + "' payload entities will be written to the RDF document!");
+ }
+
+ /* write payload */
+ if(payload != null) {
+ List<RdfSubject<ICimEntity>> entities = new ArrayList<>(payload.size());
+
+ /* copy payload to entities */
+ for(ICimEntity entity : payload)
+ if(entity != null)
+ entities.add(new RdfSubject<>(entity, createSubjectUri(entity, getKey(entity)), RdfSubjectUriType.Id));
+
+ /* write entities */
+ writeEntities(entities);
+ }
+
+ writer.outdent();
+
+ /* write RDF end */
+ writeRdfEnd();
+ }
+
+ // /**
+ // * Writes all attributes from given <i>CIM</i> datatype type
+ // *
+ // * @param entity
+ // * the entity {@link ICimEntity}
+ // * @param attribute
+ // * the attribute from which the datatype is derived through reflection
+ // * @throws IOException
+ // */
+ // protected RdfSubject<ICimEntity> writeDatatype(ICimEntity entity, Field attribute) throws IOException {
+ //
+ // try {
+ // /* read datatype */
+ // ICimDatatype datatype = (ICimDatatype) attribute.get(entity);
+ //
+ // if(datatype != null) {
+ // /* iterate over all attributes and write them */
+ // List<Field> datatypeAttributes = getEntityInformationProvider().getAttributes(datatype);
+ // String localTagNamePrefix = attribute.getDeclaringClass().getSimpleName() + "." + attribute.getName() + ".";
+ //
+ // if(datatypeAttributes != null) {
+ // XmlNamespace namespace = getNamespace(datatype.getClass());
+ //
+ // for(Field datatypeAttribute : datatypeAttributes) {
+ //
+ // XmlTag xmlTag = new XmlTag(namespace, localTagNamePrefix + datatypeAttribute.getName());
+ //
+ // if(datatypeAttribute.getType().isEnum()) {
+ // Enum<?> value = (Enum<?>) datatypeAttribute.get(datatype);
+ //
+ // URI objectUri = NetUtilities.toURI(CimMessageDefaults.CIM_URI.toString() + UrlDefaults.FRAGMENT_SEPARATOR + datatypeAttribute.getType().getSimpleName() + "." + value.name());
+ // writeObject(xmlTag, objectUri);
+ // }
+ // else {
+ // /* start tag */
+ // writer.writeTag(xmlTag, XmlTagTermination.ForceEndTag);
+ //
+ // /* write attribute value */
+ // writeValue(datatype, datatypeAttribute);
+ //
+ // /* end tag */
+ // writer.writeEndTag(xmlTag);
+ // writer.writeLine();
+ // }
+ // }
+ // }
+ // }
+ // }
+ // catch(IllegalArgumentException | IllegalAccessException exception) {
+ // throw new FatalException(exception); /* should be unreachable code */
+ // }
+ // }
+
+ /**
+ * Writes a <i>CIM</i> reference as <i>RDF</i> object tag and gives back the same <i>CIM</i> reference
+ *
+ * @param attribute
+ * the attribute from the referring reference entity
+ * @param reference
+ * the {@link ICimEntity} reference
+ * @return the {@link ICimEntity} reference; can be <code>null</code>
+ * @throws IOException
+ */
+ protected RdfSubject<ICimEntity> writeReference(Field attribute, ICimEntity reference) throws IOException {
+
+ RdfSubject<ICimEntity> result = null;
+
+ if(reference != null) {
+ String key = getKey(reference);
+ XmlTag tag = new XmlTag(getXmlNamespaceSolver().getNamespace(reference.getClass()), attribute.getDeclaringClass().getSimpleName() + "." + attribute.getName());
+
+ writeObject(tag, createObjectUri(reference, key));
+
+ result = new RdfSubject<>(reference, createSubjectUri(reference, key), RdfSubjectUriType.Id);
+ }
+
+ return result;
+ }
+
+ /**
+ * Writes the specified <i>CIM</i> references as <i>RDF</i> object tags and returns the matching {@link RdfSubject}s.
+ *
+ * @param attribute
+ * the attribute from the referring reference entity
+ * @param references
+ * the <i>CIM</i> references; can be <code>null</code> or empty
+ * @return the {@link RdfSubject}s; not <code>null</code> but can be empty
+ * @throws IOException
+ */
+ private List<RdfSubject<ICimEntity>> writeReferences(Field attribute, Collection<? extends ICimEntity> references) throws IOException {
+
+ List<RdfSubject<ICimEntity>> result;
+
+ if(references == null)
+ result = Collections.emptyList();
+ else {
+ RdfSubject<ICimEntity> subjectReference;
+
+ result = new ArrayList<>(references.size());
+
+ for(ICimEntity reference : references) {
+ subjectReference = writeReference(attribute, reference);
+
+ if((subjectReference != null) && !alreadyWrittenEntityIds.contains(subjectReference.subjectUri))
+ result.add(subjectReference);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Writes the specified <i>CIM</i> references as <i>RDF</i> object tags and returns the matching {@link RdfSubject}s.
+ *
+ * @param attribute
+ * the attribute from the referring reference entity
+ * @param references
+ * the <i>CIM</i> references; can be <code>null</code> or empty
+ * @return the {@link RdfSubject}s; not <code>null</code> but can be empty
+ * @throws IOException
+ */
+ private List<RdfSubject<ICimEntity>> writeReferences(Field attribute, Map<?, ? extends ICimEntity> references) throws IOException {
+
+ List<RdfSubject<ICimEntity>> result;
+
+ if(references == null)
+ result = Collections.emptyList();
+ else {
+ RdfSubject<ICimEntity> subjectReference;
+
+ result = new ArrayList<>(references.size());
+
+ for(ICimEntity reference : references.values()) {
+ subjectReference = writeReference(attribute, reference);
+
+ if((subjectReference != null) && !alreadyWrittenEntityIds.contains(subjectReference.subjectUri))
+ result.add(subjectReference);
+ }
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadReader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadReader.java
new file mode 100644
index 00000000..ee8f85dc
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadReader.java
@@ -0,0 +1,421 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimDatatype;
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.converter.IValueDecoder;
+import org.eclipse.openk.common.dataexchange.xml.AbstractXmlReader;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.system.FatalException;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * This reader converts <i>XML</i> into <i>CIM</i> data models.
+ *
+ * @author Felix Korb
+ * @author Frank Jäger
+ *
+ * @param <P>
+ * the payload type
+ */
+public final class XmlPayloadReader<P> extends AbstractXmlReader {
+
+ // Constants
+ private static final String TAG_NAME_PAYLOAD = "Payload";
+
+ // Attributes
+ private Field currentValueAttribute;
+ private P payload;
+ private boolean payloadSection;
+ private Stack<Object> payloadStack;
+ private Class<? extends P> payloadType;
+
+ // Constructors
+ /**
+ * @param payloadType
+ * the payload type
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueDecoder
+ * the {@link IValueDecoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>payloadType</code> is <code>null</code></li>
+ * <li><code>payloadType</code> is not an {@link ICimEntity} and not a {@link List} type</li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ public XmlPayloadReader(Class<? extends P> payloadType, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueDecoder valueDecoder) {
+
+ super(typeInformationProvider, xmlNamespaceSolver, valueDecoder);
+
+ if((payloadType == null) || (!ICimEntity.class.isAssignableFrom(payloadType) && !List.class.isAssignableFrom(payloadType)))
+ if(payloadType == null)
+ throw new IllegalArgumentException("payloadType", new NullPointerException());
+ else
+ throw new IllegalArgumentException("payloadType");
+ else {
+ this.currentValueAttribute = null;
+ this.payload = null;
+ this.payloadSection = false;
+ this.payloadStack = null;
+ this.payloadType = payloadType;
+ }
+ }
+
+ // Methods
+ private void addList(String uri, String localName, String qName, Attributes atts) {
+
+ List<ICimEntity> list;
+
+ /* create new list instance */
+ list = new ArrayList<>();
+
+ /* set attribute of parent entity */
+ {
+ ICimEntity parentEntity = (ICimEntity) payloadStack.lastElement();
+ Field attribute = getEntityInformationProvider().findAttribute(parentEntity, localName);
+
+ try {
+ attribute.set(parentEntity, list);
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ /* push the list instance to the payload stack */
+ payloadStack.push(list);
+ }
+
+ @SuppressWarnings({ "unchecked" })
+ private void addListItem(String uri, String localName, String qName, Attributes atts) {
+
+ ICimEntity entity = null;
+ List<ICimEntity> parentList = (List<ICimEntity>) payloadStack.lastElement();
+
+ /* find entity type & create new entity instance */
+ {
+ Class<?> entityType = getEntityType(uri, localName, qName, atts);
+
+ /* create new entity instance */
+ try {
+ entity = (ICimEntity) entityType.newInstance();
+ }
+ catch(InstantiationException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ /* add entity instance & push it to the payload stack */
+ {
+ parentList.add(entity);
+ payloadStack.push(entity);
+ }
+ }
+
+ private void addDatatype(String uri, String localName, String qName, Attributes atts) {
+
+ Field attribute;
+ ICimEntity parentEntity = (ICimEntity) payloadStack.lastElement();
+ ICimEntity datatype;
+
+ /* find attribute */
+ attribute = getEntityInformationProvider().findAttribute(parentEntity, localName);
+
+ /* create new datatype instance */
+ try {
+ datatype = (ICimEntity) attribute.getType().newInstance();
+ }
+ catch(InstantiationException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+
+ /* set attribute value to datatype instance */
+ try {
+ attribute.set(parentEntity, datatype);
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+
+ /* push the datatype instance to the payload stack */
+ payloadStack.push(datatype);
+ }
+
+ private void addReference(String uri, String localName, String qName, Attributes atts) {
+
+ Field attribute;
+ ICimEntity parentEntity;
+ ICimEntity reference;
+
+ /* create new reference instance */
+ try {
+ Class<?> referenceType = getEntityType(uri, localName, qName, atts);
+
+ reference = (ICimEntity) referenceType.newInstance();
+ }
+ catch(InstantiationException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+
+ /* find parent entity & reference attribute */
+ {
+ Object parent = payloadStack.lastElement();
+
+ if(parent instanceof Field) {
+ parentEntity = (ICimEntity) payloadStack.elementAt(payloadStack.size() - 2);
+ attribute = (Field) parent;
+ }
+ else {
+ parentEntity = (ICimEntity) parent;
+ attribute = getEntityInformationProvider().findAttribute(parentEntity, localName);
+ }
+ }
+
+ /* set attribute value to reference instance */
+ try {
+ attribute.set(parentEntity, reference);
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+
+ /* push the reference instance to the payload stack */
+ payloadStack.push(reference);
+ }
+
+ private void addReferenceAttribute(String uri, String localName, String qName, Attributes atts) {
+
+ Field referenceAttribute;
+
+ /* find reference attribute */
+ {
+ ICimEntity parentEntity = (ICimEntity) payloadStack.lastElement();
+ referenceAttribute = getEntityInformationProvider().findAttribute(parentEntity, localName);
+ }
+
+ /* push the reference attribute to the payload stack */
+ payloadStack.push(referenceAttribute);
+ }
+
+ private void addValue(String uri, String localName, String qName, Attributes atts) {
+
+ Field attribute;
+ ICimEntity parentEntity = (ICimEntity) payloadStack.lastElement();
+
+ /* find attribute */
+ attribute = getEntityInformationProvider().findAttribute(parentEntity, localName);
+
+ currentValueAttribute = attribute;
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length) throws SAXException {
+
+ if(currentValueAttribute != null) {
+ String valueAsString;
+
+ /* determine value as string */
+ {
+ char[] value = new char[length];
+
+ System.arraycopy(ch, start, value, 0, length);
+
+ valueAsString = new String(value);
+ }
+
+ /* set value attribute */
+ {
+ ICimEntity entity = (ICimEntity) payloadStack.lastElement();
+
+ setAttributeValue(entity, currentValueAttribute, valueAsString);
+ }
+ }
+ }
+
+ private void createPayloadAsEntity(String uri, String localName, String qName, Attributes atts) {
+
+ if(payloadStack == null)
+ payloadStack = new Stack<>();
+
+ /* find entity type & create new entity instance & push it to the payload stack */
+ {
+ /* find entity type */
+ Class<?> entityType = getEntityType(uri, localName, qName, atts);
+
+ if(!payloadType.isAssignableFrom(entityType))
+ throw new UnsupportedOperationException("The payload type '" + payloadType.getName() + "' is not assignable from the entity type '" + entityType.getName() + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen => z.B. IllegalStateException
+
+ /* create new entity instance & push it to the payload stack */
+ try {
+ payloadStack.push(payloadType.newInstance());
+ }
+ catch(InstantiationException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+ }
+
+ private void createPayloadAsList(String uri, String localName, String qName, Attributes atts) {
+
+ if(payloadStack == null)
+ payloadStack = new Stack<>();
+
+ payloadStack.push(new ArrayList<>());
+ }
+
+ /**
+ * Returns the {@link CimTagType} for the <i>XML</i> tag with the specified parameters.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ * @return the {@link CimTagType}; not <code>null</code>
+ */
+ private CimTagType determineTagType(String uri, String localName, String qName, Attributes atts) {
+
+ CimTagType result;
+
+ if(!payloadSection)
+ result = CimTagType.Unknown;
+ else {
+ if((payloadStack == null) || payloadStack.isEmpty()) {
+ if(List.class.isAssignableFrom(payloadType))
+ result = CimTagType.CreatePayloadAsList;
+ else
+ result = CimTagType.CreatePayloadAsEntity;
+ }
+ else {
+ Object parent = payloadStack.lastElement();
+
+ if(Field.class.isAssignableFrom(parent.getClass()))
+ result = CimTagType.AddReference;
+ else if(List.class.isAssignableFrom(parent.getClass()))
+ result = CimTagType.AddListItem;
+ else {
+ Field attribute = getEntityInformationProvider().findAttribute(parent, localName);
+
+ if(attribute == null)
+ throw new UnsupportedOperationException("'" + localName + "' is not an attribute of '" + parent.getClass().getName() + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen => z.B. IllegalStateException
+
+ if(List.class.isAssignableFrom(attribute.getType()))
+ result = CimTagType.AddList;
+ else if(ICimDatatype.class.isAssignableFrom(attribute.getType()))
+ result = CimTagType.AddDatatype;
+ else if(ICimEntity.class.isAssignableFrom(attribute.getType()) && !Enum.class.isAssignableFrom(attribute.getType()))
+ result = CimTagType.AddReferenceAttribute;
+ else
+ result = CimTagType.AddValue;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+
+ if(payloadSection)
+ if(localName.equals(TAG_NAME_PAYLOAD))
+ payloadSection = false;
+ else {
+ if(currentValueAttribute != null)
+ currentValueAttribute = null;
+ else {
+ if(payloadStack.size() == 1)
+ payload = (P) payloadStack.firstElement();
+
+ payloadStack.pop();
+ }
+ }
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+
+ if(!payloadSection) {
+ if(localName.equals(TAG_NAME_PAYLOAD))
+ payloadSection = true;
+ }
+ else {
+ CimTagType tagType = determineTagType(uri, localName, qName, atts);
+
+ switch(tagType) {
+ case AddList:
+ addList(uri, localName, qName, atts);
+ break;
+ case AddListItem:
+ addListItem(uri, localName, qName, atts);
+ break;
+ case AddDatatype:
+ addDatatype(uri, localName, qName, atts);
+ break;
+ case AddReference:
+ addReference(uri, localName, qName, atts);
+ break;
+ case AddReferenceAttribute:
+ addReferenceAttribute(uri, localName, qName, atts);
+ break;
+ case AddValue:
+ addValue(uri, localName, qName, atts);
+ break;
+ case CreatePayloadAsEntity:
+ createPayloadAsEntity(uri, localName, qName, atts);
+ break;
+ case CreatePayloadAsList:
+ createPayloadAsList(uri, localName, qName, atts);
+ break;
+ default:
+ throw new UnsupportedOperationException("Invalid tag '" + qName + "' at this position!");
+ }
+ }
+ }
+
+ // Properties
+ /**
+ * @return the <i>CIM</i> payload; can be <code>null</code>
+ */
+ public P getPayload() {
+
+ return payload;
+ }
+
+ // Classes
+ /**
+ * Defines the possible <i>CIM</i> tag types.
+ *
+ * @author Felix Korb
+ */
+ private static enum CimTagType {
+
+ AddList, /* Payload_ParentType_is_entity_attributeType_is_list */
+ AddListItem, /* Payload_ParentType_is_List */
+ AddDatatype, /* Payload_ParentType_is_entity_attributeType_is_cim_datatype */
+ AddReference, /* Payload_ParentType_is_entity_attributeType_is_entity */
+ AddReferenceAttribute,
+ AddValue, /* Payload_ParentType_is_entity_attributeType_is_attribute_value */
+ CreatePayloadAsEntity, /* PayloadStart_PayloadType_is_not_List */
+ CreatePayloadAsList, /* PayloadStart_PayloadType_is_List */
+ Unknown
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadWriter.java
new file mode 100644
index 00000000..ca7f479f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/cim/message/XmlPayloadWriter.java
@@ -0,0 +1,311 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.cim.message;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.List;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimDatatype;
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.converter.IValueEncoder;
+import org.eclipse.openk.common.dataexchange.xml.AbstractXmlWriter;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespace;
+import org.eclipse.openk.common.dataexchange.xml.XmlTag;
+import org.eclipse.openk.common.dataexchange.xml.XmlTagTermination;
+import org.eclipse.openk.common.dataexchange.xml.XmlWriter;
+import org.eclipse.openk.common.system.FatalException;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+
+/**
+ * Writes <i>XML</i> payloads for <i>CIM</i> messages.
+ *
+ * @author Casjen Schnars
+ * @author Felix Korb
+ * @author Frank Jäger
+ * @author Michael Korta
+ * @author Renko Ortgies
+ */
+public final class XmlPayloadWriter extends AbstractXmlWriter implements IPayloadWriter {
+
+ // Constructors
+ /**
+ * @param writer
+ * the {@link XmlWriter}
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueEncoder
+ * the {@link IValueEncoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ public XmlPayloadWriter(XmlWriter writer, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueEncoder valueEncoder) {
+
+ super(writer, typeInformationProvider, xmlNamespaceSolver, valueEncoder);
+ }
+
+ // Methods
+ /**
+ * Writes the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the entity
+ * @param attribute
+ * the attribute
+ * @throws IOException
+ */
+ protected void writeAttribute(ICimEntity entity, Field attribute) throws IOException {
+
+ try {
+ if(attribute.get(entity) != null) {
+ XmlNamespace namespace = getXmlNamespaceSolver().getNamespace(entity.getClass());
+ XmlTag xmlTag = new XmlTag(namespace, attribute.getName());
+
+ /* start tag */
+ writer.writeTag(xmlTag, XmlTagTermination.ForceEndTag);
+
+ /* write attribute value */
+ writeValue(entity, attribute);
+
+ /* end tag */
+ writer.writeEndTag(xmlTag);
+ writer.writeLine();
+ }
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ /**
+ * Writes the specified <i>CIM</i> datatype as attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li><code>datatype</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param datatype
+ * the <i>CIM</i> datatype
+ * @throws IOException
+ */
+ protected void writeDatatype(Field attribute, ICimEntity datatype) throws IOException {
+
+ if(datatype != null) {
+ XmlNamespace namespace = getXmlNamespaceSolver().getNamespace(attribute.getType());
+ XmlTag xmlTag = new XmlTag(namespace, attribute.getName());
+
+ /* start tag */
+ writer.writeTagLine(xmlTag, XmlTagTermination.ForceEndTag);
+
+ /* indent writer */
+ writer.indent();
+ /* iterate over all attributes and write them */
+ List<Field> entityAttributes = getEntityInformationProvider().getAttributes(datatype);
+
+ if(entityAttributes != null)
+ for(Field entityAttribute : entityAttributes)
+ writeAttribute(datatype, entityAttribute);
+
+ /* outdent writer */
+ writer.outdent();
+
+ /* end tag */
+ writer.writeEndTagLine(xmlTag);
+ }
+ }
+
+ /**
+ * Writes the {@link ICimEntity}s.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>parentTag</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entities
+ * the {@link ICimEntity}s; can be <code>null</code> or empty
+ * @param parentTag
+ * the parent {@link XmlTag}
+ * @throws IOException
+ */
+ protected void writeEntities(XmlTag parentTag, List<? extends ICimEntity> entities) throws IOException {
+
+ if(entities != null) {
+ /* start tag */
+ writer.writeTagLine(parentTag, XmlTagTermination.ForceEndTag);
+
+ /* indent writer */
+ writer.indent();
+
+ /* iterate over the list of entities */
+ for(ICimEntity entity : entities)
+ writeEntity(entity);
+
+ /* outdent writer */
+ writer.outdent();
+
+ /* end tag */
+ writer.writeEndTagLine(parentTag);
+ }
+ }
+
+ /**
+ * Writes the {@link ICimEntity}.
+ *
+ * @param entity
+ * the {@link ICimEntity}; can be <code>null</code>
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ protected void writeEntity(ICimEntity entity) throws IOException {
+
+ XmlNamespace namespace = getXmlNamespaceSolver().getNamespace(entity.getClass());
+ XmlTag xmlTag = new XmlTag(namespace, entity.getClass().getSimpleName());
+
+ /* start tag */
+ writer.writeTagLine(xmlTag, XmlTagTermination.ForceEndTag);
+
+ /* indent writer */
+ writer.indent();
+
+ /* iterate over all attributes and write them */
+ {
+ List<Field> attributes = getEntityInformationProvider().getAttributes(entity);
+
+ if(attributes != null)
+ for(Field attribute : attributes) {
+ try {
+ if(List.class.isAssignableFrom(attribute.getType()))
+ writeReferences(attribute, (List<? extends ICimEntity>) attribute.get(entity));
+ else if(ICimDatatype.class.isAssignableFrom(attribute.getType()))
+ writeDatatype(attribute, (ICimEntity) attribute.get(entity));
+ else if(ICimEntity.class.isAssignableFrom(attribute.getType()) && !Enum.class.isAssignableFrom(attribute.getType()))
+ writeReference(entity, attribute, (ICimEntity) attribute.get(entity));
+ else
+ writeAttribute(entity, attribute);
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+ }
+
+ /* outdent writer */
+ writer.outdent();
+
+ /* end tag */
+ writer.writeEndTagLine(xmlTag);
+ }
+
+ /**
+ * Writes the referenced {@link ICimEntity}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>parentEntity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param parentEntity
+ * the parent {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @param reference
+ * the referenced {@link ICimEntity}
+ * @throws IOException
+ */
+ protected void writeReference(ICimEntity parentEntity, Field attribute, ICimEntity reference) throws IOException {
+
+ if(reference != null) {
+ XmlNamespace namespace = getXmlNamespaceSolver().getNamespace(parentEntity.getClass());
+ XmlTag xmlTag = new XmlTag(namespace, attribute.getName());
+
+ /* start tag */
+ writer.writeTagLine(xmlTag, XmlTagTermination.ForceEndTag);
+
+ /* indent writer */
+ writer.indent();
+
+ /* write referenced entity */
+ writeEntity(reference);
+
+ /* outdent writer */
+ writer.outdent();
+
+ /* end tag */
+ writer.writeEndTagLine(xmlTag);
+ }
+ }
+
+ /**
+ * Writes the referenced {@link ICimEntity}s.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param references
+ * the referenced {@link ICimEntity}s; can be <code>null</code> or empty
+ * @throws IOException
+ */
+ protected void writeReferences(Field attribute, List<? extends ICimEntity> references) throws IOException {
+
+ if(references != null) {
+ XmlNamespace namespace = getXmlNamespaceSolver().getNamespace(attribute.getDeclaringClass());
+
+ writeEntities(new XmlTag(namespace, attribute.getName()), references);
+ }
+ }
+
+ @Override
+ public void writePayload(ICimEntity payload) throws IOException {
+
+ writeEntity(payload);
+ }
+
+ @Override
+ public void writePayload(XmlTag nounTag, List<? extends ICimEntity> payload) throws IOException {
+
+ if(nounTag == null)
+ throw new IllegalArgumentException("nounTag", new NullPointerException());
+ else
+ writeEntities(nounTag, payload);
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueDecoder.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueDecoder.java
new file mode 100644
index 00000000..398b4d77
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueDecoder.java
@@ -0,0 +1,260 @@
+package org.eclipse.openk.common.dataexchange.converter;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.openk.common.value.InvalidValueException;
+
+/**
+ * Defines the commonalities of all value decoders.<br/>
+ * Value decoders convert the {@link String} representation of a value into an instance of the appropriate type.<br/>
+ * The attribute context is also used for the decoding.
+ *
+ * @author Felix Korb
+ */
+public interface IValueDecoder {
+
+ // Methods
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ boolean decodeBoolean(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ byte decodeByte(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ char decodeChar(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ double decodeDouble(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param <E>
+ * the enum type
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value; can be <code>null</code>
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ <E extends Enum<E>> E decodeEnum(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ float decodeFloat(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ int decodeInt(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ long decodeLong(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value
+ * @return the decoded value
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ short decodeShort(Field attribute, String valueAsString);
+
+ /**
+ * Decodes the specified {@link String} representation of the value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param <V>
+ * the value type
+ * @param attribute
+ * the attribute
+ * @param valueAsString
+ * the {@link String} representation of the value; can be <code>null</code> or <code>""</code>
+ * @return the decoded value; can be <code>null</code>
+ * @throws InvalidValueException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>it is not possible to convert <code>valueAsString</code></li>
+ * </ul>
+ */
+ <V> V decodeValue(Field attribute, String valueAsString);
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueEncoder.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueEncoder.java
new file mode 100644
index 00000000..968ac9de
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/IValueEncoder.java
@@ -0,0 +1,490 @@
+package org.eclipse.openk.common.dataexchange.converter;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.string.StringDefaults;
+
+/**
+ * Defines the commonalities of all value encoders.<br/>
+ * Value encoders convert a value into its {@link String} representation.<br/>
+ * The attribute context is also used for the encoding.
+ *
+ * @author Felix Korb
+ */
+public interface IValueEncoder {
+
+ // Methods
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeBoolean(boolean value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeBoolean(Field attribute, boolean value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeBoolean(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeByte(byte value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeByte(Field attribute, byte value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeByte(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeChar(char value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeChar(Field attribute, char value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeChar(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeDouble(double value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeDouble(Field attribute, double value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeDouble(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value; can be <code>null</code>
+ * @return the {@link String} representation of the value; can be {@link StringDefaults#EMPTY_STRING}
+ */
+ String encodeEnum(Enum<?> value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value; can be {@link StringDefaults#EMPTY_STRING}
+ */
+ String encodeEnum(Field attribute, Enum<?> value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value; can be {@link StringDefaults#EMPTY_STRING}
+ */
+ String encodeEnum(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeFloat(float value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeFloat(Field attribute, float value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeFloat(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeInt(int value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeInt(Field attribute, int value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeInt(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeLong(long value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeLong(Field attribute, long value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeLong(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeShort(short value);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value
+ * @return the {@link String} representation of the value
+ */
+ String encodeShort(Field attribute, short value);
+
+ /**
+ * Encodes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @return the {@link String} representation of the value
+ */
+ String encodeShort(Object entity, Field attribute);
+
+ /**
+ * Encodes the specified value.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param <V>
+ * the value type
+ * @param attribute
+ * the attribute
+ * @param value
+ * the value; can be <code>null</code>
+ * @return the {@link String} representation of the value; can be {@link StringDefaults#EMPTY_STRING}
+ */
+ <V> String encodeValue(Field attribute, V value);
+
+ /**
+ * Encodes the specified value.
+ *
+ * @param <V>
+ * the value type
+ * @param value
+ * the value; can be <code>null</code>
+ * @return the {@link String} representation of the value; can be {@link StringDefaults#EMPTY_STRING}
+ */
+ <V> String encodeValue(V value);
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueDecoder.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueDecoder.java
new file mode 100644
index 00000000..9347b711
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueDecoder.java
@@ -0,0 +1,220 @@
+package org.eclipse.openk.common.dataexchange.converter;
+
+import java.lang.reflect.Field;
+import java.net.URI;
+import java.sql.Timestamp;
+import java.text.ParseException;
+import java.time.LocalDateTime;
+import java.util.Date;
+import java.util.UUID;
+
+import org.eclipse.openk.common.date.DateDefaults;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.value.InvalidValueException;
+
+/**
+ * The standard implementation of a {@link IValueDecoder}.
+ *
+ * @author Felix Korb
+ */
+public class ValueDecoder implements IValueDecoder {
+
+ // Constants
+ public static final IValueDecoder DEFAULT_INSTANCE = new ValueDecoder();
+
+ // Methods
+ @Override
+ public boolean decodeBoolean(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ return Boolean.parseBoolean(valueAsString);
+ }
+
+ @Override
+ public byte decodeByte(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ try {
+ return Byte.parseByte(valueAsString);
+ }
+ catch(NumberFormatException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ @Override
+ public char decodeChar(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString) || (valueAsString.length() != 1))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ return valueAsString.charAt(0);
+ }
+
+ @Override
+ public double decodeDouble(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ try {
+ return Double.parseDouble(valueAsString);
+ }
+ catch(NumberFormatException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ @Override
+ @SuppressWarnings({ "unchecked" })
+ public <E extends Enum<E>> E decodeEnum(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ return null;
+ else
+ return Enum.valueOf((Class<E>) attribute.getType(), valueAsString);
+ }
+
+ @Override
+ public float decodeFloat(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ try {
+ return Float.parseFloat(valueAsString);
+ }
+ catch(NumberFormatException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ @Override
+ public int decodeInt(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ try {
+ return Integer.parseInt(valueAsString);
+ }
+ catch(NumberFormatException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ @Override
+ public long decodeLong(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ try {
+ return Long.parseLong(valueAsString);
+ }
+ catch(NumberFormatException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ @Override
+ public short decodeShort(Field attribute, String valueAsString) {
+
+ if(!StringUtilities.hasContent(valueAsString))
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ else
+ try {
+ return Short.parseShort(valueAsString);
+ }
+ catch(NumberFormatException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public <V> V decodeValue(Field attribute, String valueAsString) {
+
+ V result;
+ Class<?> valueType = attribute.getType();
+
+ if(!StringUtilities.hasContent(valueAsString))
+ result = null;
+ else {
+ try {
+ /* Boolean */
+ if(Boolean.class.equals(valueType))
+ result = (V) Boolean.valueOf(valueAsString);
+
+ /* Byte */
+ else if(Byte.class.equals(valueType))
+ result = (V) Byte.valueOf(valueAsString);
+
+ /* Character */
+ else if(Character.class.equals(valueType))
+ result = (V) Character.valueOf(valueAsString.charAt(0));
+
+ /* Date */
+ else if(Date.class.equals(valueType))
+ result = (V) DateDefaults.UTC_TIMESTAMP_DATE_FORMAT.parse(valueAsString);
+
+ /* Double */
+ else if(Double.class.equals(valueType))
+ result = (V) Double.valueOf(valueAsString);
+
+ /* Enum */
+ else if(Enum.class.isAssignableFrom(valueType))
+ result = (V) decodeEnum(attribute, valueAsString);
+
+ /* Float */
+ else if(Float.class.equals(valueType))
+ result = (V) Float.valueOf(valueAsString);
+
+ /* Integer */
+ else if(Integer.class.equals(valueType))
+ result = (V) Integer.valueOf(valueAsString);
+
+ /* LocalDateTime */
+ else if(LocalDateTime.class.equals(valueType))
+ result = (V) LocalDateTime.parse(valueAsString, DateDefaults.UTC_TIMESTAMP_DATE_TIME_FORMATTER);
+
+ /* Long */
+ else if(Long.class.equals(valueType))
+ result = (V) Long.valueOf(valueAsString);
+
+ /* Short */
+ else if(Short.class.equals(valueType))
+ result = (V) Short.valueOf(valueAsString);
+
+ /* String */
+ else if(String.class.equals(valueType))
+ result = (V) valueAsString;
+
+ /* Timestamp */
+ else if(Timestamp.class.equals(valueType))
+ result = (V) new Timestamp(DateDefaults.UTC_TIMESTAMP_DATE_FORMAT.parse(valueAsString).getTime());
+
+ /* URI */
+ else if(URI.class.equals(valueType))
+ result = (V) URI.create(valueAsString);
+
+ /* UUID */
+ else if(UUID.class.equals(valueType))
+ result = (V) UUID.fromString(valueAsString);
+
+ /* unsupported type */
+ else
+ throw new InvalidValueException(attribute.getName(), valueAsString);
+ }
+ catch(IllegalArgumentException | ParseException exception) {
+ throw new InvalidValueException(attribute.getName(), valueAsString, exception);
+ }
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueEncoder.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueEncoder.java
new file mode 100644
index 00000000..531f84e6
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/converter/ValueEncoder.java
@@ -0,0 +1,278 @@
+package org.eclipse.openk.common.dataexchange.converter;
+
+import java.lang.reflect.Field;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.Date;
+
+import org.eclipse.openk.common.date.DateDefaults;
+import org.eclipse.openk.common.string.StringDefaults;
+import org.eclipse.openk.common.system.FatalException;
+
+/**
+ * The standard implementation of a {@link IValueEncoder}.
+ *
+ * @author Felix Korb
+ */
+public class ValueEncoder implements IValueEncoder {
+
+ // Constants
+ public static final IValueEncoder DEFAULT_INSTANCE = new ValueEncoder();
+
+ // Methods
+ @Override
+ public String encodeBoolean(boolean value) {
+
+ return Boolean.toString(value);
+ }
+
+ @Override
+ public String encodeBoolean(Field attribute, boolean value) {
+
+ return encodeBoolean(value);
+ }
+
+ @Override
+ public final String encodeBoolean(Object entity, Field attribute) {
+
+ try {
+ return encodeBoolean(attribute, attribute.getBoolean(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeByte(byte value) {
+
+ return Byte.toString(value);
+ }
+
+ @Override
+ public String encodeByte(Field attribute, byte value) {
+
+ return encodeByte(value);
+ }
+
+ @Override
+ public final String encodeByte(Object entity, Field attribute) {
+
+ try {
+ return encodeByte(attribute, attribute.getByte(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeChar(char value) {
+
+ return Character.toString(value);
+ }
+
+ @Override
+ public String encodeChar(Field attribute, char value) {
+
+ return encodeChar(value);
+ }
+
+ @Override
+ public final String encodeChar(Object entity, Field attribute) {
+
+ try {
+ return encodeChar(attribute, attribute.getChar(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeDouble(double value) {
+
+ return Double.toString(value);
+ }
+
+ @Override
+ public String encodeDouble(Field attribute, double value) {
+
+ return encodeDouble(value);
+ }
+
+ @Override
+ public final String encodeDouble(Object entity, Field attribute) {
+
+ try {
+ return encodeDouble(attribute, attribute.getDouble(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeEnum(Enum<?> value) {
+
+ if(value == null)
+ return StringDefaults.EMPTY_STRING;
+ else
+ return value.name();
+ }
+
+ @Override
+ public String encodeEnum(Field attribute, Enum<?> value) {
+
+ return encodeEnum(value);
+ }
+
+ @Override
+ public String encodeEnum(Object entity, Field attribute) {
+
+ try {
+ return encodeEnum(attribute, (Enum<?>) attribute.get(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeFloat(float value) {
+
+ return Float.toString(value);
+ }
+
+ @Override
+ public String encodeFloat(Field attribute, float value) {
+
+ return encodeFloat(value);
+ }
+
+ @Override
+ public final String encodeFloat(Object entity, Field attribute) {
+
+ try {
+ return encodeFloat(attribute, attribute.getFloat(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeInt(int value) {
+
+ return Integer.toString(value);
+ }
+
+ @Override
+ public String encodeInt(Field attribute, int value) {
+
+ return encodeInt(value);
+ }
+
+ @Override
+ public final String encodeInt(Object entity, Field attribute) {
+
+ try {
+ return encodeInt(attribute, attribute.getInt(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeLong(long value) {
+
+ return Long.toString(value);
+ }
+
+ @Override
+ public String encodeLong(Field attribute, long value) {
+
+ return encodeLong(value);
+ }
+
+ @Override
+ public final String encodeLong(Object entity, Field attribute) {
+
+ try {
+ return encodeLong(attribute, attribute.getLong(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public String encodeShort(short value) {
+
+ return Short.toString(value);
+ }
+
+ @Override
+ public String encodeShort(Field attribute, short value) {
+
+ return encodeShort(value);
+ }
+
+ @Override
+ public final String encodeShort(Object entity, Field attribute) {
+
+ try {
+ return encodeShort(attribute, attribute.getShort(entity));
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ @Override
+ public <V> String encodeValue(Field attribute, V value) {
+
+ return this.<V> encodeValue(value);
+ }
+
+ @Override
+ public <V> String encodeValue(V value) {
+
+ String result;
+
+ if(value == null)
+ result = StringDefaults.EMPTY_STRING;
+ else {
+ // REMIND 2017-03-09 Felix: weitere Typen bei der Konvertierung nach String differenziert betrachten
+ /* Date */
+ if(Date.class.equals(value.getClass()))
+ result = DateDefaults.UTC_TIMESTAMP_DATE_FORMAT.format((Date) value);
+ /* LocalDate */
+ else if(LocalDate.class.equals(value.getClass()))
+ result = DateDefaults.UTC_TIMESTAMP_DATE_FORMATTER.format((LocalDate) value);
+ /* LocalDateTime */
+ else if(LocalDateTime.class.equals(value.getClass()))
+ result = DateDefaults.UTC_TIMESTAMP_DATE_TIME_FORMATTER.format((LocalDateTime) value);
+ /* LocalTime */
+ else if(LocalTime.class.equals(value.getClass()))
+ result = DateDefaults.UTC_TIMESTAMP_TIME_FORMATTER.format((LocalTime) value);
+ /* Time */
+ else if(Time.class.equals(value.getClass()))
+ result = DateDefaults.UTC_TIMESTAMP_DATE_FORMAT.format((Time) value);
+ /* Timestamp */
+ else if(Timestamp.class.equals(value.getClass()))
+ result = DateDefaults.UTC_TIMESTAMP_DATE_FORMAT.format((Timestamp) value);
+ /* Enum */
+ else if(value instanceof Enum<?>)
+ result = encodeEnum((Enum<?>) value);
+ else
+ result = value.toString();
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvFileReader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvFileReader.java
new file mode 100644
index 00000000..357268fd
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvFileReader.java
@@ -0,0 +1,109 @@
+package org.eclipse.openk.common.dataexchange.csv;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.List;
+
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+
+/**
+ * Reads <i>CSV</i> data from a file.
+ *
+ * @author Felix Korb
+ * @author Renko Ortgies
+ *
+ * @param <E>
+ * the entity type
+ */
+public class CsvFileReader<E> extends CsvReader<E> {
+
+ // Constants
+ private static final char CSV_DELIMITER = ';';
+ private static final CSVFormat CSV_FORMAT = CSVFormat.EXCEL;
+ private static final String FILE_FORMAT_UTF_8_WITHOUT_BOM = "UTF-8";
+
+ // Constructors
+ /**
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param entityType
+ * the entity type<br/>
+ * <b><i>NOTE:</i></b><br/>
+ * It is assumed that <code>entityType</code> has a public constructor with no parameter.
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>entityType</code> is <code>null</code></li>
+ * </ul>
+ */
+ public CsvFileReader(ITypeInformationProvider typeInformationProvider, Class<E> entityType) {
+
+ super(typeInformationProvider, entityType);
+ }
+
+ // Methods
+ /**
+ * Reads all entities from the specified <i>CSV</i> file.
+ *
+ * @param file
+ * the file to read
+ * @param withHeader
+ * defines if the csv has headers
+ * @param ignoreInvalidRecords
+ * specifies, if invalid records will be ignored
+ * @return the entities; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases
+ * <ul>
+ * <li><code>file</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ * Is thrown in the following cases
+ * <ul>
+ * <li><code>file</code> does not exist or is not reachable</li>
+ * <li><code>file</code> could not be parsed</li>
+ * </ul>
+ */
+ public final List<E> readEntities(File file, boolean withHeader, boolean ignoreInvalidRecords) throws IOException {
+
+ if(file == null)
+ throw new IllegalArgumentException("file", new NullPointerException());
+ else {
+ CSVFormat csvFormat;
+ List<E> result = null;
+
+ /* create CSV-format */
+ {
+ csvFormat = CSV_FORMAT;
+
+ /* set CSV-delimiter */
+ csvFormat = csvFormat.withDelimiter(CSV_DELIMITER);
+
+ /* set header */
+ if(withHeader)
+ csvFormat = csvFormat.withHeader();
+ }
+
+ /* read the import file */
+ try(Reader reader = new InputStreamReader(new FileInputStream(file), FILE_FORMAT_UTF_8_WITHOUT_BOM);) {
+
+ /* parse the file */
+ CSVParser records = csvFormat.parse(reader);
+
+ /* read entities */
+ result = readEntities(records, ignoreInvalidRecords);
+ }
+ catch(IllegalArgumentException exception) {
+ throw new IOException(exception);
+ }
+
+ return result;
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvReader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvReader.java
new file mode 100644
index 00000000..b47708c9
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/CsvReader.java
@@ -0,0 +1,189 @@
+package org.eclipse.openk.common.dataexchange.csv;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVRecord;
+import org.eclipse.openk.common.messaging.ILogger;
+import org.eclipse.openk.common.messaging.LoggerFactory;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.eclipse.openk.common.value.xparameter.ICustomParameterValidator;
+import org.eclipse.openk.common.value.xparameter.ParameterUtilities;
+import org.eclipse.openk.common.value.xparameter.definitions.IParameterDefinition;
+import org.eclipse.openk.common.value.xparameter.exceptions.AbstractParameterException;
+import org.eclipse.openk.common.value.xparameter.exceptions.InvalidParametersException;
+
+/**
+ * The reader for <i>CSV</i> data.
+ *
+ * @author Felix Korb
+ *
+ * @param <E>
+ * the entity type
+ */
+public class CsvReader<E> {
+
+ // Constants
+ private static final ILogger LOGGER = LoggerFactory.createLogger(CsvReader.class);
+
+ // Attributes
+ private Map<String, IParameterDefinition<?>> attributeDefinitions;
+ private Class<E> entityType;
+
+ // Constructors
+ /**
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param entityType
+ * the entity type<br/>
+ * <b><i>NOTE:</i></b><br/>
+ * It is assumed that <code>entityType</code> has a public constructor with no parameter.
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>entityType</code> is <code>null</code></li>
+ * </ul>
+ */
+ public CsvReader(ITypeInformationProvider typeInformationProvider, Class<E> entityType) {
+
+ if((typeInformationProvider == null) || (entityType == null))
+ if(typeInformationProvider == null)
+ throw new IllegalArgumentException("typeInformationProvider", new NullPointerException());
+ else
+ throw new IllegalArgumentException("entityType", new NullPointerException());
+ else {
+ this.attributeDefinitions = ParameterUtilities.createParameterDefinitions(typeInformationProvider, entityType);
+ this.entityType = entityType;
+ }
+ }
+
+ // Methods
+ /**
+ * Reads all entities from the specified {@link CSVParser}.
+ *
+ * @param records
+ * the {@link CSVParser}; can be <code>null</code> if there are no records
+ * @param ignoreInvalidRecords
+ * specifies, if invalid records will be ignored
+ * @return the entities; can be <code>null</code> or empty
+ * @throws IOException
+ */
+ public final List<E> readEntities(CSVParser records, boolean ignoreInvalidRecords) throws IOException {
+
+ List<E> result = null;
+
+ /* read entities */
+ if(records != null) {
+ List<E> entities = new ArrayList<>();
+ E entity;
+
+ for(CSVRecord record : records)
+ try {
+ entity = readEntity(record);
+
+ entities.add(entity);
+ }
+ catch(InvalidParametersException exception) {
+ ErrorReadingCsvException ioException = new ErrorReadingCsvException("Invalid record '" + record.getRecordNumber() + "': " + exception.getMessage(), exception);
+
+ if(ignoreInvalidRecords)
+ LOGGER.warn(ioException);
+ else
+ throw ioException;
+ }
+
+ if(!entities.isEmpty())
+ result = entities;
+ }
+
+ return result;
+ }
+
+ /**
+ * Reads the entity from the specified {@link CSVRecord}.
+ *
+ * @param record
+ * the {@link CSVRecord}; can be <code>null</code>
+ * @return the entity object; can be <code>null</code>
+ * @throws InvalidParametersException
+ */
+ @SuppressWarnings("unchecked")
+ // REMIND 2017-06-29 Felix: mit Parametern zusammenführen
+ public final E readEntity(CSVRecord record) throws InvalidParametersException {
+
+ E result;
+
+ if(record == null)
+ result = null;
+ else {
+ List<AbstractParameterException> errors = null;
+
+ /* create entity object */
+ try {
+ result = entityType.newInstance();
+ }
+ catch(InstantiationException | IllegalAccessException exception) {
+ throw new IllegalArgumentException("entityType", exception);
+ }
+
+ /* set/reset attribute values */
+ {
+ AbstractParameterException error;
+ String attributeValue;
+
+ if(attributeDefinitions != null) {
+ /* check single attributes */
+ for(IParameterDefinition<?> attributeDefinition : attributeDefinitions.values()) {
+ attributeValue = record.get(attributeDefinition.getName());
+
+ error = attributeDefinition.checkValueAsString(attributeValue);
+
+ if(error != null) {
+ if(errors == null)
+ errors = new ArrayList<>();
+
+ errors.add(error);
+ }
+ else {
+ if(!StringUtilities.hasContent(attributeValue))
+ attributeDefinition.reset(result);
+ else
+ attributeDefinition.setValueAsString(result, attributeValue);
+ }
+ }
+
+ // REMIND 2017-06-01 Felix: Refactoren => single vs. inter-parameter validation
+
+ /* check complete entity object */
+ for(IParameterDefinition<?> attributeDefinition : attributeDefinitions.values())
+ if(attributeDefinition.hasCustomValidator()) {
+ error = ((ICustomParameterValidator<E>) attributeDefinition.getCustomValidator()).checkValue(entityType, result, attributeDefinition);
+
+ if(error != null) {
+ if(errors == null)
+ errors = new ArrayList<>();
+
+ errors.add(error);
+ }
+ }
+ }
+ }
+
+ /* check unnecessary attributes */
+ {
+
+ }
+
+ /* */
+ if((errors != null) && !errors.isEmpty())
+ throw new InvalidParametersException(errors);
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorReadingCsvException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorReadingCsvException.java
new file mode 100644
index 00000000..32e60de8
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorReadingCsvException.java
@@ -0,0 +1,62 @@
+package org.eclipse.openk.common.dataexchange.csv;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * An exception for documenting a reading csv.
+ * Since it implements the interface <code>INotification</code> it
+ * is possible to use the exception within the <strong>BTC</strong> message- and logging-system.
+ *
+ * <p>
+ * Check the constructor for detailed information about the exception type.
+ * </p>
+ *
+ * @author Renko Ortgies
+ */
+public final class ErrorReadingCsvException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "An error occured while reading a CSV-file!";
+
+ // Constructors
+ /**
+ * the default constructor
+ */
+ public ErrorReadingCsvException() {
+
+ this(TEXT, null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorReadingCsvException(Throwable cause) {
+
+ this(TEXT, cause);
+ }
+
+
+ /**
+ * @param text
+ * the message text, can be <code>null</code>
+ */
+ public ErrorReadingCsvException(String text) {
+
+ this(text, null);
+ }
+
+ /**
+ * @param text
+ * the message text, can be <code>null</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorReadingCsvException(String text, Throwable cause) {
+
+ super(text, cause);
+ }
+
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorWritingCsvException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorWritingCsvException.java
new file mode 100644
index 00000000..4ed779d5
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/csv/ErrorWritingCsvException.java
@@ -0,0 +1,62 @@
+package org.eclipse.openk.common.dataexchange.csv;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * An exception for documenting writing csv files.
+ * Since it implements the interface <code>INotification</code> it
+ * is possible to use the exception within the <strong>BTC</strong> message- and logging-system.
+ *
+ * <p>
+ * Check the constructor for detailed information about the exception type.
+ * </p>
+ *
+ * @author Michael Kotten
+ */
+public final class ErrorWritingCsvException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "An error occured while writing a CSV-file!";
+
+ // Constructors
+ /**
+ * the default constructor
+ */
+ public ErrorWritingCsvException() {
+
+ this(TEXT, null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorWritingCsvException(Throwable cause) {
+
+ this(TEXT, cause);
+ }
+
+
+ /**
+ * @param text
+ * the message text, can be <code>null</code>
+ */
+ public ErrorWritingCsvException(String text) {
+
+ this(text, null);
+ }
+
+ /**
+ * @param text
+ * the message text, can be <code>null</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorWritingCsvException(String text, Throwable cause) {
+
+ super(text, cause);
+ }
+
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlConverter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlConverter.java
new file mode 100644
index 00000000..c363543a
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlConverter.java
@@ -0,0 +1,58 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+
+/**
+ * The base of all <i>XML</i> readers & writers.
+ *
+ * @author Felix Korb
+ */
+public abstract class AbstractXmlConverter {
+
+ // Attributes
+ private ITypeInformationProvider typeInformationProvider;
+ private IXmlNamespaceSolver xmlNamespaceSolver;
+
+ // Constructors
+ /**
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * </ul>
+ */
+ protected AbstractXmlConverter(ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver) {
+
+ if((typeInformationProvider == null) || (xmlNamespaceSolver == null))
+ if(typeInformationProvider == null)
+ throw new IllegalArgumentException("typeInformationProvider", new NullPointerException());
+ else
+ throw new IllegalArgumentException("xmlNamespaceSolver", new NullPointerException());
+ else {
+ this.typeInformationProvider = typeInformationProvider;
+ this.xmlNamespaceSolver = xmlNamespaceSolver;
+ }
+ }
+
+ // Properties
+ /**
+ * @return the {@link IXmlNamespaceSolver}; not <code>null</code>
+ */
+ protected final IXmlNamespaceSolver getXmlNamespaceSolver() {
+
+ return xmlNamespaceSolver;
+ }
+
+ /**
+ * @return the {@link ITypeInformationProvider}; not <code>null</code>
+ */
+ protected final ITypeInformationProvider getEntityInformationProvider() {
+
+ return typeInformationProvider;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlReader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlReader.java
new file mode 100644
index 00000000..9107bbfe
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlReader.java
@@ -0,0 +1,231 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.openk.common.dataexchange.converter.IValueDecoder;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.eclipse.openk.common.value.InvalidValueException;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/**
+ * The base of all readers, that converts <i>XML</i> into <i>Java</i> data models.
+ *
+ * @author Felix Korb
+ */
+public abstract class AbstractXmlReader extends AbstractXmlConverter implements ContentHandler {
+
+ // Attributes
+ private IValueDecoder valueDecoder;
+
+ // Constructors
+ /**
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueDecoder
+ * the {@link IValueDecoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ protected AbstractXmlReader(ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueDecoder valueDecoder) {
+
+ super(typeInformationProvider, xmlNamespaceSolver);
+
+ if(valueDecoder == null)
+ throw new IllegalArgumentException("valueDecoder", new NullPointerException());
+ else
+ this.valueDecoder = valueDecoder;
+ }
+
+ // Methods
+ @Override
+ public void endDocument() throws SAXException {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void endPrefixMapping(String prefix) throws SAXException {
+
+ /* NOOP */
+ }
+
+ /**
+ * Returns the {@link Package} where the model definition can be found using the specified parameters.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ * @return the {@link Package} where the model definition can be found; not <code>null</code>
+ * @throws UnsupportedOperationException
+ * Is thrown if there is no {@link XmlNamespaceMapping} for the specified parameters.
+ */
+ protected Package findModelDefinitionPackage(String uri, String localName, String qName, Attributes atts) {
+
+ String namespacePrefix;
+ XmlNamespaceMapping namespaceMapping;
+
+ /* determine namespacePrefix */
+ if(localName.length() == qName.length())
+ namespacePrefix = null;
+ else
+ namespacePrefix = qName.substring(0, (qName.length() - localName.length()) - 1);
+
+ if(StringUtilities.hasContent(namespacePrefix)) {
+ namespaceMapping = getXmlNamespaceSolver().getNamespaceMappingByPrefix(namespacePrefix);
+
+ if(namespaceMapping == null)
+ throw new UnsupportedOperationException("There is no mapping defined for the namespace-prefix '" + namespacePrefix + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ else {
+ if(StringUtilities.hasContent(uri)) {
+ namespaceMapping = getXmlNamespaceSolver().getNamespaceMappingByUri(uri);
+
+ if(namespaceMapping == null)
+ throw new UnsupportedOperationException("There is no mapping defined for the namespace-uri '" + uri + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ else {
+ namespaceMapping = getXmlNamespaceSolver().getDefaultNamespaceMapping();
+
+ if(namespaceMapping == null)
+ throw new UnsupportedOperationException("There is no mapping defined for the default namespace!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+
+ return namespaceMapping.getModelDefinitionPackage();
+ }
+
+ /**
+ * Returns the entity type for the <i>XML</i> tag with the specified parameters.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ * @return the type of the entity; not <code>null</code>
+ * @throws UnsupportedOperationException
+ * Is thrown if there is no matching entity type.
+ */
+ protected Class<?> getEntityType(String uri, String localName, String qName, Attributes atts) {
+
+ Class<?> result;
+
+ /* find entity type */
+ {
+ Package modelDefinitionPackage = findModelDefinitionPackage(uri, localName, qName, atts);
+
+ result = getEntityInformationProvider().findType(modelDefinitionPackage, localName);
+
+ if(result == null)
+ throw new UnsupportedOperationException("Missing entity definition for entity '" + localName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+
+ return result;
+ }
+
+ @Override
+ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void processingInstruction(String target, String data) throws SAXException {
+
+ /* NOOP */
+ }
+
+ /**
+ * Sets the value of the specified attribute.
+ *
+ * @param <V>
+ * the value type
+ * @param entity
+ * the entity; not <code>null</code>
+ * @param attribute
+ * the attribute; not <code>null</code>
+ * @param valueAsString
+ * the value as {@link String}; can be <code>null</code> or <code>""</code>
+ */
+ protected final <V> void setAttributeValue(Object entity, Field attribute, String valueAsString) {
+
+ Class<?> valueType = attribute.getType();
+
+ try {
+ /* boolean */
+ if(boolean.class.equals(valueType))
+ attribute.setBoolean(entity, valueDecoder.decodeBoolean(attribute, valueAsString));
+ /* byte */
+ else if(byte.class.equals(valueType))
+ attribute.setByte(entity, valueDecoder.decodeByte(attribute, valueAsString));
+ /* char */
+ else if(char.class.equals(valueType))
+ attribute.setChar(entity, valueDecoder.decodeChar(attribute, valueAsString));
+ /* double */
+ else if(double.class.equals(valueType))
+ attribute.setDouble(entity, valueDecoder.decodeDouble(attribute, valueAsString));
+ /* float */
+ else if(float.class.equals(valueType))
+ attribute.setFloat(entity, valueDecoder.decodeFloat(attribute, valueAsString));
+ /* int */
+ else if(int.class.equals(valueType))
+ attribute.setInt(entity, valueDecoder.decodeInt(attribute, valueAsString));
+ /* long */
+ else if(long.class.equals(valueType))
+ attribute.setLong(entity, valueDecoder.decodeLong(attribute, valueAsString));
+ /* short */
+ else if(short.class.equals(valueType))
+ attribute.setShort(entity, valueDecoder.decodeShort(attribute, valueAsString));
+ /* other types */
+ else
+ attribute.set(entity, valueDecoder.<V> decodeValue(attribute, valueAsString));
+ }
+ catch(IllegalAccessException | IllegalArgumentException | InvalidValueException exception) {
+ throw new UnsupportedOperationException("Unable to set attribute '" + entity.getClass().getName() + "." + attribute.getName() + "' with value '" + valueAsString + "'!", exception); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+
+ @Override
+ public void skippedEntity(String name) throws SAXException {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void startDocument() throws SAXException {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {
+
+ /* NOOP */
+ }
+
+ // Properties
+ @Override
+ public void setDocumentLocator(Locator locator) {
+
+ /* NOOP */
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlWriter.java
new file mode 100644
index 00000000..ba96122d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/AbstractXmlWriter.java
@@ -0,0 +1,113 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.converter.IValueEncoder;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.eclipse.openk.common.value.InvalidValueException;
+
+/**
+ * The base of all writers, that converts <i>Java</i> data models into <i>XML</i>.
+ *
+ * @author Felix Korb
+ */
+public abstract class AbstractXmlWriter extends AbstractXmlConverter {
+
+ // Attributes
+ protected IValueEncoder valueEncoder;
+ protected XmlWriter writer;
+
+ // Constructors
+ /**
+ * @param writer
+ * the {@link XmlWriter}
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueEncoder
+ * the {@link IValueEncoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ protected AbstractXmlWriter(XmlWriter writer, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueEncoder valueEncoder) {
+
+ super(typeInformationProvider, xmlNamespaceSolver);
+
+ if((writer == null) || (valueEncoder == null))
+ if(writer == null)
+ throw new IllegalArgumentException("writer", new NullPointerException());
+ else
+ throw new IllegalArgumentException("valueEncoder", new NullPointerException());
+ else {
+ this.valueEncoder = valueEncoder;
+ this.writer = writer;
+ }
+ }
+
+ /**
+ * Writes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @throws IOException
+ */
+ protected void writeValue(ICimEntity entity, Field attribute) throws IOException {
+
+ Class<?> valueType = attribute.getType();
+
+ try {
+ /* boolean */
+ if(boolean.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeBoolean(entity, attribute));
+ /* byte */
+ else if(byte.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeByte(entity, attribute));
+ /* char */
+ else if(char.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeChar(entity, attribute));
+ /* double */
+ else if(double.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeDouble(entity, attribute));
+ /* float */
+ else if(float.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeFloat(entity, attribute));
+ /* int */
+ else if(int.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeInt(entity, attribute));
+ /* long */
+ else if(long.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeLong(entity, attribute));
+ /* short */
+ else if(short.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeShort(entity, attribute));
+ /* other types */
+ else
+ writer.writeEscapedValue(valueEncoder.encodeValue(attribute, attribute.get(entity)));
+ }
+ catch(IllegalAccessException | IllegalArgumentException | InvalidValueException exception) {
+ throw new UnsupportedOperationException("Unable to write the attribute value '" + entity.getClass().getName() + "." + attribute.getName() + "'!", exception); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/ErrorReadingXmlException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/ErrorReadingXmlException.java
new file mode 100644
index 00000000..b02b22f7
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/ErrorReadingXmlException.java
@@ -0,0 +1,76 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.util.List;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+public class ErrorReadingXmlException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "Error in reading XML-document!";
+
+ // Constructors
+ public ErrorReadingXmlException() {
+
+ this(TEXT, null);
+ }
+
+ /**
+ *
+ * @param text
+ * the text describing this error, can be <code>null</code>
+ */
+ public ErrorReadingXmlException(String text) {
+
+ this(text, null);
+ }
+
+ /**
+ *
+ * @param type
+ * the <i>CIM</> entity type, not <code>null</code>
+ */
+ public ErrorReadingXmlException(Class<? extends ICimEntity> type) {
+
+ this("Error in reading XML-document for entity " + type.getName(), null);
+ }
+
+ /**
+ *
+ * @param type
+ * the <i>CIM</> entity type, not <code>null</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorReadingXmlException(Class<? extends ICimEntity> type, Throwable cause) {
+
+ this("Error in reading XML-document for entity " + type.getName(), cause);
+ }
+
+ /**
+ *
+ * @param list
+ * the list object, not <code>null</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorReadingXmlException(List<?> list, Throwable cause) {
+
+ this("Error in reading XML-document for entity " + list.getClass().getSimpleName(), cause);
+ }
+
+ /**
+ * @param text
+ * the text describing this error, can be <code>null</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorReadingXmlException(String text, Throwable cause) {
+
+ super(text, cause);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/IXmlNamespaceSolver.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/IXmlNamespaceSolver.java
new file mode 100644
index 00000000..e6c6ec1b
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/IXmlNamespaceSolver.java
@@ -0,0 +1,69 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.util.List;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+
+/**
+ * Defines the commonalities of all {@link XmlNamespace} solvers.
+ *
+ * @author Felix Korb
+ */
+public interface IXmlNamespaceSolver {
+
+ // Properties
+ /**
+ * Returns the default {@link XmlNamespaceMapping}.
+ *
+ * @return the {@link XmlNamespaceMapping}; not <code>null</code>
+ * @throws UnsupportedOperationException
+ * Is thrown if there is no default {@link XmlNamespaceMapping}.
+ */
+ XmlNamespaceMapping getDefaultNamespaceMapping();
+
+ /**
+ * Returns the {@link XmlNamespace} for the specified {@link ICimEntity} type.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>type</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param type
+ * the type
+ * @return the {@link XmlNamespace}; can be <code>null</code>
+ */
+ XmlNamespace getNamespace(Class<?> type);
+
+ /**
+ * Returns the {@link XmlNamespaceMapping} for the specified namespace prefix.
+ *
+ * @param prefix
+ * the namespace prefix; may be <code>null</code> or <code>""</code>
+ * @return the {@link XmlNamespaceMapping}; not <code>null</code>
+ * @throws UnsupportedOperationException
+ * Is thrown if there is no matching {@link XmlNamespaceMapping}.
+ */
+ XmlNamespaceMapping getNamespaceMappingByPrefix(String prefix);
+
+ /**
+ * Returns the {@link XmlNamespaceMapping} for the specified <i>URI</i>.
+ *
+ * @param uri
+ * the <i>URI</i>; may be <code>null</code> or <code>""</code>
+ * @return the {@link XmlNamespaceMapping}; can be <code>null</code>
+ * @throws UnsupportedOperationException
+ * Is thrown if there is no matching {@link XmlNamespaceMapping}.
+ */
+ XmlNamespaceMapping getNamespaceMappingByUri(String uri);
+
+ /**
+ * Returns the {@link XmlNamespace}s that must be defined.
+ *
+ * @return the {@link XmlNamespace}s; can be <code>null</code> or empty
+ */
+ List<XmlNamespace> getNamespacesToDefine();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/UnsupportedXmlVersion.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/UnsupportedXmlVersion.java
new file mode 100644
index 00000000..417ba39f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/UnsupportedXmlVersion.java
@@ -0,0 +1,27 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml;
+
+import org.eclipse.openk.common.messaging.AbstractException;
+
+public class UnsupportedXmlVersion extends AbstractException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "Unsupported xml version!";
+
+ // Constructors
+ public UnsupportedXmlVersion() {
+
+ this(null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public UnsupportedXmlVersion(Throwable cause) {
+
+ super(TEXT, cause);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlAttribute.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlAttribute.java
new file mode 100644
index 00000000..67f8112a
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlAttribute.java
@@ -0,0 +1,97 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.io.Serializable;
+
+import org.eclipse.openk.common.key.IKeyOwner;
+import org.eclipse.openk.common.string.StringDefaults;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The <i>XML</i> attribute.
+ *
+ * @author Felix Korb
+ */
+public final class XmlAttribute implements IKeyOwner<String>, Serializable {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ // Attributes
+ private String name;
+ private String value;
+
+ // Constructors
+ /**
+ * @param name
+ * the name
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>name</code> doesn't match {@link XmlDefaults#PATTERN_NAME}</li>
+ * </ul>
+ */
+ public XmlAttribute(String name) {
+
+ this(name, null);
+ }
+
+ /**
+ * @param name
+ * the name
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>name</code> doesn't match {@link XmlDefaults#PATTERN_NAME}</li>
+ * </ul>
+ */
+ public XmlAttribute(String name, String value) {
+
+ if(!StringUtilities.matches(name, XmlDefaults.PATTERN_NAME))
+ throw new IllegalArgumentException("name");
+ else {
+ this.name = name;
+ this.value = value;
+ }
+ }
+
+ // Methods
+ @Override
+ public boolean hasKey() {
+
+ return true;
+ }
+
+ // Properties
+ @Override
+ public String getKey() {
+
+ return name;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+
+ return name;
+ }
+
+ /**
+ * @return the value; can be <code>null</code> or {@link StringDefaults#EMPTY_STRING}
+ */
+ public String getValue() {
+
+ return value;
+ }
+
+ /**
+ * @param value
+ * the value; can be <code>null</code> or {@link StringDefaults#EMPTY_STRING}
+ */
+ public void setValue(String value) {
+
+ this.value = value;
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlDefaults.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlDefaults.java
new file mode 100644
index 00000000..b32b7866
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlDefaults.java
@@ -0,0 +1,76 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.util.regex.Pattern;
+
+/**
+ * Provides some default values.
+ *
+ * @author Felix Korb
+ */
+public final class XmlDefaults {
+
+ // Constants
+ /* regular expressions */
+ public static final String REGEX_ADDITIONAL_NAME_CHAR = "[-]|[.]|[0-9]|[\u00B7]|[\u0300-\u036F]|[\u203F-\u2040]";
+ public static final String REGEX_NAME_START_CHAR_WITHOUT_COLON = "[A-Z]|[_]|[a-z]|[\u00C0-\u00D6]|[\u00D8-\u00F6]|[\u00F8-\u02FF]|[\u0370-\u037D]|[\u037F-\u1FFF]|[\u200C-\u200D]|[\u2070-\u218F]|[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD]"; /* |[\u10000-\uEFFFF] removed */
+ public static final String REGEX_NAME_START_CHAR = "[:]|" + REGEX_NAME_START_CHAR_WITHOUT_COLON;
+ public static final String REGEX_NAME_CHAR = REGEX_NAME_START_CHAR + "|" + REGEX_ADDITIONAL_NAME_CHAR;
+ public static final String REGEX_NAME = "(" + REGEX_NAME_START_CHAR + ")" + "(" + REGEX_NAME_CHAR + ")*";
+ public static final String REGEX_NC_NAME = "(" + REGEX_NAME_START_CHAR_WITHOUT_COLON + ")(" + REGEX_NAME_START_CHAR_WITHOUT_COLON + "|" + REGEX_ADDITIONAL_NAME_CHAR + ")*";
+ public static final String REGEX_Q_NAME = "(" + REGEX_NC_NAME + ")([:](" + REGEX_NC_NAME + "))?";
+
+ /* patterns */
+ /**
+ * The regular-expression for <i>XML</i> name start characters.
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml/#NT-NameStartChar">http://www.w3.org/TR/REC-xml/#NT-NameStartChar</a>
+ */
+ public static final Pattern PATTERN_NAME_START_CHAR = Pattern.compile(REGEX_NAME_START_CHAR);
+
+ /**
+ * The regular-expression for <i>XML</i> name characters.
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml/#NT-NameChar">http://www.w3.org/TR/REC-xml/#NT-NameChar</a>
+ */
+ public static final Pattern PATTERN_NAME_CHAR = Pattern.compile(REGEX_NAME_CHAR);
+
+ /**
+ * The regular-expression for <i>XML</i> names.
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml/#NT-Name">http://www.w3.org/TR/REC-xml/#NT-Name</a>
+ */
+ public static final Pattern PATTERN_NAME = Pattern.compile(REGEX_NAME);
+
+ /**
+ * The regular-expression for <i>XML</i> non-colonized names.
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">http://www.w3.org/TR/REC-xml-names/#NT-NCName</a>
+ */
+ public static final Pattern PATTERN_NC_NAME = Pattern.compile(REGEX_NC_NAME);
+
+ /**
+ * The regular-expression for <i>XML</i> qualified names.
+ *
+ * @see <a href="http://www.w3.org/TR/REC-xml-names/#NT-QName">http://www.w3.org/TR/REC-xml-names/#NT-QName</a>
+ */
+ public static final Pattern PATTERN_Q_NAME = Pattern.compile(REGEX_Q_NAME);
+
+ public static final Pattern PATTERN_XML_DESIGNATOR_TO_JAVA_ELEMENT = Pattern.compile("[a-zA-Z][0-9a-zA-Z_$]*(-[0-9a-zA-Z_$]+)*");
+
+ /* separators */
+ /**
+ * The name-value separator.
+ * Is used to separate names from values within a <i>XML</i>-attribute.
+ */
+ public static final String NAME_VALUE_SEPARATOR = ":";
+ /**
+ * The properties separator.
+ * Is used to separate properties within a <i>XML</i>-attribute.
+ */
+ public static final String PROPERTIES_SEPARATOR = ";";
+
+ // Constructors
+ private XmlDefaults() {
+ /* suppresses the instantiation! */
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespace.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespace.java
new file mode 100644
index 00000000..f335ba0e
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespace.java
@@ -0,0 +1,156 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.net.URI;
+import java.util.regex.Pattern;
+
+import org.eclipse.openk.common.net.NetUtilities;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The <i>XML</i> namespace.
+ * A namespace consists of an {@link URI} and an optional prefix.
+ *
+ * @see <a href="https://www.w3.org/TR/xml-names/">Namespaces in XML</a>
+ *
+ * @author Felix Korb
+ * @author Michael Korta
+ */
+public final class XmlNamespace {
+
+ // Constants
+ public static final char PREFIX_COLON = ':';
+ public static final String XMLNS_ATTRIBUTE = "xmlns";
+
+ /* regular expressions */
+ public static final String REGEX_PREFIX = "(" + XmlDefaults.REGEX_NAME_START_CHAR_WITHOUT_COLON + ")+";
+
+ /* patterns */
+ public static final Pattern PATTERN_PREFIX = Pattern.compile(REGEX_PREFIX);
+
+ // Attributes
+ private String prefix;
+ private URI uri;
+
+ // Constructors
+ /**
+ * @param uri
+ * the <i>URI</i> as {@link String}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>uri</code> is <code>null</code> or <code>""</code></li>
+ * <li><code>uri</code> is invalid</li>
+ * </ul>
+ */
+ public XmlNamespace(String uri) {
+
+ this(NetUtilities.toURI(uri), null);
+ }
+
+ /**
+ * @param uri
+ * the {@link URI}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>uri</code> is <code>null</code></li>
+ * </ul>
+ */
+ public XmlNamespace(URI uri) {
+
+ this(uri, null);
+ }
+
+ /**
+ * @param uri
+ * the <i>URI</i> as {@link String}
+ * @param prefix
+ * the prefix; can be <code>null</code> or <code>""</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>uri</code> is <code>null</code> or <code>""</code></li>
+ * <li><code>uri</code> is invalid</li>
+ * <li><code>prefix</code> is set, but doesn't match {@link #PATTERN_PREFIX}</li>
+ * </ul>
+ */
+ public XmlNamespace(String uri, String prefix) {
+
+ this(NetUtilities.toURI(uri), prefix);
+ }
+
+ /**
+ * @param uri
+ * the {@link URI}
+ * @param prefix
+ * the prefix; can be <code>null</code> or <code>""</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>uri</code> is <code>null</code></li>
+ * <li><code>prefix</code> is set, but doesn't match {@link #PATTERN_PREFIX}</li>
+ * </ul>
+ */
+ public XmlNamespace(URI uri, String prefix) {
+
+ if((uri == null) || !StringUtilities.matches(prefix, PATTERN_PREFIX, true))
+ if(uri == null)
+ throw new IllegalArgumentException("uri", new NullPointerException());
+ else
+ throw new IllegalArgumentException("prefix");
+ else {
+ this.prefix = prefix;
+ this.uri = uri;
+ }
+ }
+
+ // Methods
+ /**
+ * Checks if the prefix is set.
+ *
+ * @return the result
+ */
+ public boolean hasPrefix() {
+
+ return StringUtilities.hasContent(prefix);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuffer result = new StringBuffer();
+
+ /* xmlns */
+ result.append(XMLNS_ATTRIBUTE);
+
+ /* prefix */
+ if(StringUtilities.hasContent(prefix)) {
+ result.append(PREFIX_COLON);
+ result.append(prefix);
+ }
+
+ /* uri */
+ result.append("=\"");
+ result.append(uri.toString());
+ result.append('\"');
+
+ return result.toString();
+ }
+
+ // Properties
+ /**
+ * @return the prefix; can be <code>null</code>or <code>""</code>
+ */
+ public String getPrefix() {
+
+ return prefix;
+ }
+
+ /**
+ * @return the {@link URI}; not <code>null</code>
+ */
+ public URI getUri() {
+
+ return uri;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceMapping.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceMapping.java
new file mode 100644
index 00000000..4154d49e
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceMapping.java
@@ -0,0 +1,79 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml;
+
+// FIXME 2017-04-17 Felix: Kommentar ergänzen!
+/**
+ *
+ *
+ * @author Felix Korb
+ */
+public final class XmlNamespaceMapping {
+
+ // Attributes
+ private Package modelDefinitionPackage;
+ private XmlNamespace namespace;
+
+ // Constructors
+ /**
+ * @param modelDefinitionPackage
+ * the {@link Package} where the model definition can be found
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>modelDefinitionPackage</code> is <code>null</code></li>
+ * </ul>
+ */
+ public XmlNamespaceMapping(Package modelDefinitionPackage) {
+
+ this(null, modelDefinitionPackage);
+ }
+
+ /**
+ * @param namespace
+ * the {@link XmlNamespace}; can be <code>null</code>
+ * @param modelDefinitionPackage
+ * the {@link Package} where the model definition can be found
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>modelDefinitionPackage</code> is <code>null</code></li>
+ * </ul>
+ */
+ public XmlNamespaceMapping(XmlNamespace namespace, Package modelDefinitionPackage) {
+
+ if(modelDefinitionPackage == null)
+ throw new IllegalArgumentException("modelDefinitionPackage", new NullPointerException());
+ else {
+ this.modelDefinitionPackage = modelDefinitionPackage;
+ this.namespace = namespace;
+ }
+ }
+
+ // Methods
+ /**
+ * Checks if the {@link XmlNamespace} is set.
+ *
+ * @return the result
+ */
+ public boolean hasNamespace() {
+
+ return (namespace != null);
+ }
+
+ // Properties
+ /**
+ * @return the {@link Package} where the model definition can be found; not <code>null</code>
+ */
+ public Package getModelDefinitionPackage() {
+
+ return modelDefinitionPackage;
+ }
+
+ /**
+ * @return the {@link XmlNamespace}; can be <code>null</code>
+ */
+ public XmlNamespace getNamespace() {
+
+ return namespace;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceSolver.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceSolver.java
new file mode 100644
index 00000000..b323a1b4
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlNamespaceSolver.java
@@ -0,0 +1,201 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.system.type.TypeUtilities;
+
+/**
+ * The default {@link XmlNamespace} solver.
+ *
+ * @author Felix Korb
+ */
+public class XmlNamespaceSolver implements IXmlNamespaceSolver {
+
+ // Attributes
+ private XmlNamespaceMapping defaultNamespaceMapping;
+ private XmlNamespaceMapping[] namespaceMappings;
+ private Map<String, XmlNamespaceMapping> namespaceMappingsSortedByPrefix;
+ private Map<String, XmlNamespaceMapping> namespaceMappingsSortedByUri;
+
+ // Constructors
+ /**
+ * @param namespaceMappings
+ * the {@link XmlNamespaceMapping}s
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>namespaceMappings</code> is <code>null</code> or empty</li>
+ * </ul>
+ */
+ public XmlNamespaceSolver(XmlNamespaceMapping... namespaceMappings) {
+
+ if((namespaceMappings == null) || (namespaceMappings.length < 1))
+ throw new IllegalArgumentException("namespaceMappings");
+ else {
+ this.defaultNamespaceMapping = determineDefaultNamespaceMapping(namespaceMappings);
+ this.namespaceMappings = namespaceMappings;
+ this.namespaceMappingsSortedByPrefix = createNamespaceMappingsSortedByPrefix(namespaceMappings);
+ this.namespaceMappingsSortedByUri = createNamespaceMappingsSortedByUri(namespaceMappings);
+ }
+ }
+
+ // Methods
+ /**
+ * Converts the specified {@link XmlNamespaceMapping}s into a sorted map.<br/>
+ * The map is sorted by the {@link XmlNamespace#getPrefix()}.
+ *
+ * @param namespaceMappings
+ * the {@link XmlNamespaceMapping}s; can be <code>null</code> or empty
+ * @return the sorted {@link XmlNamespaceMapping}s; can be <code>null</code>
+ */
+ private static Map<String, XmlNamespaceMapping> createNamespaceMappingsSortedByPrefix(XmlNamespaceMapping[] namespaceMappings) {
+
+ Map<String, XmlNamespaceMapping> result = null;
+
+ if(namespaceMappings != null) {
+ String namespacePrefix;
+
+ for(XmlNamespaceMapping namespaceMapping : namespaceMappings)
+ if(namespaceMapping.hasNamespace()) {
+ namespacePrefix = namespaceMapping.getNamespace().getPrefix();
+
+ if(StringUtilities.hasContent(namespacePrefix)) {
+ if(result == null)
+ result = new TreeMap<>();
+
+ result.put(namespacePrefix, namespaceMapping);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Converts the specified {@link XmlNamespaceMapping}s into a sorted map.<br/>
+ * The map is sorted by the {@link XmlNamespace#getUri()}.
+ *
+ * @param namespaceMappings
+ * the {@link XmlNamespaceMapping}s; can be <code>null</code> or empty
+ * @return the sorted {@link XmlNamespaceMapping}s; can be <code>null</code>
+ */
+ private static Map<String, XmlNamespaceMapping> createNamespaceMappingsSortedByUri(XmlNamespaceMapping[] namespaceMappings) {
+
+ Map<String, XmlNamespaceMapping> result = null;
+
+ if(namespaceMappings != null)
+ for(XmlNamespaceMapping namespaceMapping : namespaceMappings)
+ if(namespaceMapping.hasNamespace()) {
+ if(result == null)
+ result = new TreeMap<>();
+
+ result.put(namespaceMapping.getNamespace().getUri().toString(), namespaceMapping);
+ }
+
+ return result;
+ }
+
+ /**
+ * Converts the specified {@link XmlNamespaceMapping}s into a sorted map.<br/>
+ * The map is sorted by the {@link XmlNamespace#getPrefix()}.
+ *
+ * @param namespaceMappings
+ * the {@link XmlNamespaceMapping}s; can be <code>null</code> or empty
+ * @return the sorted {@link XmlNamespaceMapping}s; can be <code>null</code>
+ */
+ private static XmlNamespaceMapping determineDefaultNamespaceMapping(XmlNamespaceMapping[] namespaceMappings) {
+
+ XmlNamespaceMapping result = null;
+
+ if(namespaceMappings != null)
+ if(namespaceMappings.length == 1)
+ result = namespaceMappings[0];
+ else
+ for(XmlNamespaceMapping namespaceMapping : namespaceMappings)
+ if(!namespaceMapping.hasNamespace()) {
+ result = namespaceMapping;
+ break;
+ }
+
+ return result;
+ }
+
+ // Properties
+ @Override
+ public XmlNamespaceMapping getDefaultNamespaceMapping() {
+
+ if(defaultNamespaceMapping == null)
+ throw new UnsupportedOperationException("There is no default namespace-mapping!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ else
+ return defaultNamespaceMapping;
+ }
+
+ @Override
+ public XmlNamespace getNamespace(Class<?> type) {
+
+ for(XmlNamespaceMapping namespaceMapping : namespaceMappings)
+ if(TypeUtilities.containsType(namespaceMapping.getModelDefinitionPackage(), type))
+ return namespaceMapping.getNamespace();
+
+ return null;
+ }
+
+ @Override
+ public XmlNamespaceMapping getNamespaceMappingByPrefix(String prefix) {
+
+ XmlNamespaceMapping result = null;
+
+ /* find namespace mapping */
+ if(namespaceMappingsSortedByPrefix != null)
+ result = namespaceMappingsSortedByPrefix.get(prefix);
+
+ /* check result */
+ if(result == null)
+ throw new UnsupportedOperationException("There is no namespace-mapping for the namespace prefix '" + prefix + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+
+ return result;
+ }
+
+ @Override
+ public XmlNamespaceMapping getNamespaceMappingByUri(String uri) {
+
+ XmlNamespaceMapping result = null;
+
+ /* find namespace mapping */
+ if(namespaceMappingsSortedByUri != null)
+ result = namespaceMappingsSortedByUri.get(uri);
+
+ /* check result */
+ if(result == null)
+ throw new UnsupportedOperationException("There is no namespace-mapping for the URI '" + uri + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+
+ return result;
+ }
+
+ @Override
+ public List<XmlNamespace> getNamespacesToDefine() {
+
+ List<XmlNamespace> result = null;
+
+ if((namespaceMappings != null) && (namespaceMappings.length > 0)) {
+ XmlNamespace namespace;
+
+ for(XmlNamespaceMapping namespaceMapping : namespaceMappings) {
+ namespace = namespaceMapping.getNamespace();
+
+ if((namespace != null) && namespace.hasPrefix()) {
+ if(result == null)
+ result = new ArrayList<>(namespaceMappings.length);
+
+ result.add(namespace);
+ }
+ }
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTag.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTag.java
new file mode 100644
index 00000000..7b09b935
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTag.java
@@ -0,0 +1,290 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.openk.common.key.IKeyOwner;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The <i>XML</i> tag.
+ *
+ * @author Felix Korb
+ */
+@SuppressWarnings("hiding")
+public final class XmlTag implements IKeyOwner<String>, Serializable {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ // Attributes
+ private List<XmlAttribute> attributes;
+ private Map<String, XmlAttribute> attributesIndex;
+ private String localName;
+ private XmlNamespace namespace;
+
+ // Constructors
+ /**
+ * @param localName
+ * the local name (without prefix)
+ * @param namespaceDeclarations
+ * the {@link XmlNamespace} declarations; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>localName</code> doesn't match {@link XmlDefaults#PATTERN_NC_NAME}</li>
+ * <li><code>namespaceDeclarations</code> is set and contains at least one {@link XmlNamespace} without prefix</li>
+ * </ul>
+ */
+ public XmlTag(String localName, XmlNamespace... namespaceDeclarations) {
+
+ this(null, localName, namespaceDeclarations);
+ }
+
+ /**
+ * @param namespace
+ * the {@link XmlNamespace}; can be <code>null</code>
+ * @param localName
+ * the local name (without prefix)
+ * @param namespaceDeclarations
+ * the {@link XmlNamespace} declarations; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>localName</code> doesn't match {@link XmlDefaults#PATTERN_NC_NAME}</li>
+ * <li><code>namespaceDeclarations</code> is set and contains at least one {@link XmlNamespace} without prefix</li>
+ * </ul>
+ */
+ public XmlTag(XmlNamespace namespace, String localName, XmlNamespace... namespaceDeclarations) {
+
+ if(!StringUtilities.matches(localName, XmlDefaults.PATTERN_NC_NAME))
+ throw new IllegalArgumentException("localName");
+ else {
+ this.localName = localName;
+ this.namespace = namespace;
+
+ addAttributes(convertNamespaceDeclarationsToXmlAttributes(namespaceDeclarations));
+ }
+ }
+
+ // Methods
+ /**
+ * Adds a new {@link XmlAttribute} to the end of this {@link XmlTag}.
+ *
+ * @param name
+ * the name
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>name</code> doesn't match {@link XmlDefaults#PATTERN_NAME}</li>
+ * </ul>
+ */
+ public void addAttribute(String name, String value) {
+
+ addAttributes(new XmlAttribute(name, value));
+ }
+
+ /**
+ * Adds the specified {@link XmlAttribute}s to the end of this {@link XmlTag}.
+ *
+ * @param attributes
+ * the {@link XmlAttribute}s; can be <code>null</code> or empty
+ */
+ public void addAttributes(XmlAttribute... attributes) {
+
+ if((attributes != null) && (attributes.length > 0)) {
+ if(this.attributes == null) {
+ this.attributes = new ArrayList<>(attributes.length);
+ this.attributesIndex = new HashMap<>(attributes.length);
+ }
+
+ for(XmlAttribute attribute : attributes) {
+ this.attributes.add(attribute);
+ this.attributesIndex.put(attribute.getKey(), attribute);
+ }
+ }
+ }
+
+ /**
+ * Converts the specified {@link XmlNamespace} declarations into an array of {@link XmlAttribute}s.
+ *
+ * @param namespaceDeclarations
+ * the {@link XmlNamespace} declarations; can be <code>null</code> or empty
+ * @return the {@link XmlAttribute}; can be <code>null</code> or empty
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>namespaceDeclarations</code> is set and contains at least one {@link XmlNamespace} without prefix</li>
+ * </ul>
+ */
+ private static XmlAttribute[] convertNamespaceDeclarationsToXmlAttributes(XmlNamespace[] namespaceDeclarations) {
+
+ XmlAttribute[] result;
+
+ if((namespaceDeclarations == null) || (namespaceDeclarations.length == 0))
+ result = null;
+ else {
+ result = new XmlAttribute[namespaceDeclarations.length];
+
+ for(int i = 0; i < namespaceDeclarations.length; i++)
+ if(namespaceDeclarations[i].hasPrefix())
+ result[i] = new XmlAttribute(XmlNamespace.XMLNS_ATTRIBUTE + XmlNamespace.PREFIX_COLON + namespaceDeclarations[i].getPrefix(), namespaceDeclarations[i].getUri().toString());
+ else
+ throw new IllegalArgumentException("namespaceDeclarations");
+ }
+
+ return result;
+ }
+
+ /**
+ * Checks, if the current {@link XmlTag} has at least one {@link XmlAttribute}.
+ *
+ * @return the result
+ */
+ public boolean hasAttributes() {
+
+ return ((attributes != null) && !attributes.isEmpty());
+ }
+
+ @Override
+ public boolean hasKey() {
+
+ return true;
+ }
+
+ /**
+ * Removes the {@link XmlAttribute} with the specified name from this {@link XmlTag}.
+ *
+ * @param name
+ * the name
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>name</code> is an invalid <code>String</code> (<code>null</code> or <code>""</code>)</li>
+ * </ul>
+ */
+ public void removeAttribute(String name) {
+
+ if(!StringUtilities.hasContent(name))
+ throw new IllegalArgumentException("name");
+ else {
+ if(attributes != null)
+ for(XmlAttribute attribute : attributes)
+ if(attribute.getName().equals(name)) {
+ removeAttribute(attribute);
+
+ return;
+ }
+ }
+ }
+
+ /**
+ * Removes the specified {@link XmlAttribute} from this {@link XmlTag}.
+ *
+ * @param attribute
+ * the {@link XmlAttribute}; can be <code>null</code>
+ */
+ public void removeAttribute(XmlAttribute attribute) {
+
+ if((attribute != null) && (attributes != null))
+ attributes.remove(attribute);
+ }
+
+ // Properties
+ /**
+ * Returns the {@link XmlAttribute} with the specified name.
+ *
+ * @param name
+ * the name
+ * @return the {@link XmlAttribute}<br/>
+ * <code>null</code> if no {@link XmlAttribute} with the specified name can be found.
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>name</code> is an invalid <code>String</code> (<code>null</code> or <code>""</code>)</li>
+ * </ul>
+ */
+ public XmlAttribute getAttribute(String name) {
+
+ if(!StringUtilities.hasContent(name))
+ throw new IllegalArgumentException("name");
+ else {
+ if(attributes == null)
+ return null;
+ else
+ return attributesIndex.get(name);
+ }
+ }
+
+ /**
+ * @return the {@link XmlAttribute}s<br/>
+ * can be <code>null</code> or empty
+ */
+ public List<XmlAttribute> getAttributes() {
+
+ if(attributes == null)
+ return null;
+ else
+ return Collections.<XmlAttribute> unmodifiableList(attributes);
+ }
+
+ @Override
+ public String getKey() {
+
+ return getQualifiedName();
+ }
+
+ /**
+ * @return the local name (without prefix); not <code>null</code> and not <code>""</code>
+ */
+ public String getLocalName() {
+
+ return localName;
+ }
+
+ /**
+ * @return the {@link XmlNamespace}; can be <code>null</code>
+ */
+ public XmlNamespace getNamespace() {
+
+ return namespace;
+ }
+
+ /**
+ * @return the qualified name (with prefix); not <code>null</code> and not <code>""</code>
+ */
+ public String getQualifiedName() {
+
+ String result;
+
+ if(namespace == null)
+ result = localName;
+ else {
+ StringBuffer qualifiedName = new StringBuffer();
+
+ if(namespace.hasPrefix()) {
+ qualifiedName.append(namespace.getPrefix());
+ qualifiedName.append(XmlNamespace.PREFIX_COLON);
+ qualifiedName.append(localName);
+ }
+ else {
+ qualifiedName.append(localName);
+ qualifiedName.append(' ');
+ qualifiedName.append(XmlNamespace.XMLNS_ATTRIBUTE);
+ qualifiedName.append("=\"");
+ qualifiedName.append(namespace.getUri().toString());
+ qualifiedName.append("\"");
+ }
+
+ result = qualifiedName.toString();
+ }
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTagTermination.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTagTermination.java
new file mode 100644
index 00000000..2d8645f0
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlTagTermination.java
@@ -0,0 +1,14 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+/**
+ * Defines all possible types of tag termination.
+ *
+ * @author Felix Korb
+ */
+public enum XmlTagTermination {
+
+ // Constants
+ ForceEndTag,
+ ForceImmetiateTermination,
+ NoRestriction;
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlUtilities.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlUtilities.java
new file mode 100644
index 00000000..bab56739
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlUtilities.java
@@ -0,0 +1,95 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.Validator;
+
+import org.eclipse.openk.common.dataexchange.xml.validation.InvalidXmlException;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.xml.sax.SAXException;
+
+/**
+ * Provides utilitiy-methods for xml validation.
+ *
+ * @author Carsten Meyer
+ */
+public final class XmlUtilities {
+
+ // Constructors
+ private XmlUtilities() {
+ /* suppresses the instantiation! */
+ }
+
+ // Methods
+ /**
+ * Validates the specified xml against the specified xsd-schema.
+ *
+ * @param xmlAsString
+ * the xml
+ * @param schema
+ * the xsd-schema
+ * @throws InvalidXmlException
+ * {@link InvalidXmlException}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>xmlAsString</code> is <code>null</code> or <code>""</code></li>
+ * <li><code>schema</code> is <code>null</code></li>
+ * </ul>
+ */
+ public static void validateXml(String xmlAsString, Schema schema) throws InvalidXmlException {
+
+ if(!StringUtilities.hasContent(xmlAsString) || (schema == null))
+ if(!StringUtilities.hasContent(xmlAsString))
+ throw new IllegalArgumentException("xmlAsString");
+ else
+ throw new IllegalArgumentException("schema", new NullPointerException());
+ else
+ try {
+ Source xml = new StreamSource(new StringReader(xmlAsString));
+
+ Validator validator = schema.newValidator();
+ validator.validate(xml);
+ }
+ catch(SAXException | IOException exception) {
+ throw new InvalidXmlException(exception);
+ }
+ }
+
+ /**
+ * Validates the specified xml dom against the specified xsd-schema.
+ *
+ * @param xmlAsDom
+ * the xml dom source
+ * @param schema
+ * the xsd-schema
+ * @throws InvalidXmlException
+ * {@link InvalidXmlException}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>xmlAsDom</code> is <code>null</code></li>
+ * <li><code>schema</code> is <code>null</code></li>
+ * </ul>
+ */
+ public static void validateXml(Source xmlAsDom, Schema schema) throws InvalidXmlException {
+
+ if(xmlAsDom == null || (schema == null))
+ if(xmlAsDom == null)
+ throw new IllegalArgumentException("xmlAsDom");
+ else
+ throw new IllegalArgumentException("schema", new NullPointerException());
+ else
+ try {
+ Validator validator = schema.newValidator();
+ validator.validate(xmlAsDom);
+ }
+ catch(SAXException | IOException exception) {
+ throw new InvalidXmlException(exception);
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlVersion.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlVersion.java
new file mode 100644
index 00000000..75b4a156
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlVersion.java
@@ -0,0 +1,15 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+/**
+ * Defines all possible <i>XML</i>-versions.
+ *
+ * @author Felix Korb
+ */
+public enum XmlVersion {
+
+ // Constants
+ /** Version 1.0 */
+ V1_0,
+ /** Version 1.1 */
+ V1_1
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlWriter.java
new file mode 100644
index 00000000..6fa467da
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/XmlWriter.java
@@ -0,0 +1,367 @@
+package org.eclipse.openk.common.dataexchange.xml;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.eclipse.openk.common.io.Charset;
+import org.eclipse.openk.common.io.IODefaults;
+import org.eclipse.openk.common.io.IndentedWriter;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The <i>XML</i> writer.
+ *
+ * @author Felix Korb
+ */
+public final class XmlWriter extends IndentedWriter {
+
+ // Attributes
+ private Charset charset;
+ private XmlVersion xmlVersion;
+
+ // Constructors
+ /**
+ * @param writer
+ * the writer
+ * @param xmlVersion
+ * the {@link XmlVersion}
+ * @param charset
+ * the {@link Charset}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * <li><code>xmlVersion</code> is <code>null</code></li>
+ * <li><code>charset</code> is <code>null</code></li>
+ * </ul>
+ */
+ public XmlWriter(Writer writer, XmlVersion xmlVersion, Charset charset) {
+
+ super(writer);
+
+ if((xmlVersion == null) || (charset == null))
+ if(xmlVersion == null)
+ throw new IllegalArgumentException("xmlVersion", new NullPointerException());
+ else
+ throw new IllegalArgumentException("charset", new NullPointerException());
+ else {
+ this.charset = charset;
+ this.xmlVersion = xmlVersion;
+ }
+ }
+
+ // Methods
+ /**
+ * Converts the specified {@link Charset} into a <i>XML</i> compatible charset-name.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link Charset}
+ * @return the <i>XML</i> compatible charset-name
+ */
+ public static String toXmlCharsetName(Charset value) {
+
+ switch(value) {
+ case ISO_8859_1:
+ return IODefaults.CHARSET_NAME_ISO_8859_1;
+ case US_ASCII:
+ return IODefaults.CHARSET_NAME_US_ASCII;
+ case UTF_16:
+ return IODefaults.CHARSET_NAME_UTF_16;
+ case UTF_16BE:
+ return IODefaults.CHARSET_NAME_UTF_16BE;
+ case UTF_16LE:
+ return IODefaults.CHARSET_NAME_UTF_16LE;
+ case UTF_8:
+ return IODefaults.CHARSET_NAME_UTF_8;
+ default:
+ throw new IllegalArgumentException("value");
+ }
+ }
+
+ /**
+ * Converts the specified {@link XmlVersion} into a <i>XML</i> compatible version-designation.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link XmlVersion}
+ * @return the <i>XML</i> compatible version-designation
+ */
+ public static String toXmlVersionDesignation(XmlVersion value) {
+
+ switch(value) {
+ case V1_0:
+ return "1.0";
+ case V1_1:
+ return "1.1";
+ default:
+ throw new IllegalArgumentException("value");
+ }
+ }
+
+ /**
+ * Writes the specified {@link XmlAttribute}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link XmlAttribute}
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeAttribute(XmlAttribute value) throws IOException {
+
+ /* name */
+ write(value.getName());
+
+ write("=\"");
+
+ /* value */
+ if(StringUtilities.hasContent(value.getValue()))
+ switch(xmlVersion) {
+ case V1_0:
+ write(StringEscapeUtils.escapeXml10(value.getValue()));
+ break;
+ case V1_1:
+ write(StringEscapeUtils.escapeXml11(value.getValue()));
+ break;
+ default:
+ throw new IllegalArgumentException("xmlVersion");
+ }
+
+ write('"');
+ }
+
+ /**
+ * Writes the <i>XML</i> declaration.
+ *
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeDeclaration() throws IOException {
+
+ writeIndentedLine("<?xml version=\"" + toXmlVersionDesignation(xmlVersion) + "\" encoding=\"" + toXmlCharsetName(charset) + "\"?>");
+ }
+
+ /**
+ * Writes the end-tag for the specified {@link XmlTag}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link XmlTag}
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeEndTag(XmlTag value) throws IOException {
+
+ write("</");
+
+ /* name */
+ if((value.getNamespace() != null) && value.getNamespace().hasPrefix())
+ write(value.getQualifiedName());
+ else
+ write(value.getLocalName());
+
+ write('>');
+ }
+
+ /**
+ * Writes the end-tag for the specified {@link XmlTag}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link XmlTag}
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeEndTagLine(XmlTag value) throws IOException {
+
+ writeIndented("</");
+
+ /* name */
+ if((value.getNamespace() != null) && value.getNamespace().hasPrefix())
+ write(value.getQualifiedName());
+ else
+ write(value.getLocalName());
+
+ writeLine('>');
+ }
+
+ /**
+ * Escapes and writes the specified value.
+ *
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeEscapedValue(String value) throws IOException {
+
+ /* write value */
+ if(StringUtilities.hasContent(value))
+ switch(xmlVersion) {
+ case V1_0:
+ write(StringEscapeUtils.escapeXml10(value));
+ break;
+ case V1_1:
+ write(StringEscapeUtils.escapeXml11(value));
+ break;
+ default:
+ throw new IllegalArgumentException("xmlVersion");
+ }
+ }
+
+ /**
+ * Writes the specified {@link XmlTag}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * <li><code>tagTermination</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link XmlTag}
+ * @param tagTermination
+ * the {@link XmlTagTermination}
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeTag(XmlTag value, XmlTagTermination tagTermination) throws IOException {
+
+ /* name */
+ writeIndented('<');
+ write(value.getQualifiedName());
+
+ /* attributes */
+ if(value.hasAttributes())
+ for(XmlAttribute tempAttribute : value.getAttributes()) {
+ write(' ');
+ writeAttribute(tempAttribute);
+ }
+
+ switch(tagTermination) {
+ case ForceEndTag:
+ write('>');
+ break;
+ case ForceImmetiateTermination:
+ write(" />");
+ break;
+ default:
+ throw new IllegalArgumentException("tagTermination");
+ }
+ }
+
+ /**
+ * Writes the specified {@link XmlTag}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>value</code> is not <code>null</code></li>
+ * <li><code>tagTermination</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param value
+ * the {@link XmlTag}
+ * @param tagTermination
+ * the {@link XmlTagTermination}
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeTagLine(XmlTag value, XmlTagTermination tagTermination) throws IOException {
+
+ writeTag(value, tagTermination);
+ writeLine();
+ }
+
+ /**
+ * Writes the specified value tagged with the specified {@link XmlTag}.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>tag</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param tag
+ * the {@link XmlTag}
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ public void writeTaggedValue(XmlTag tag, String value) throws IOException {
+
+ /* write start tag */
+ {
+ /* name */
+ writeIndented('<');
+ write(tag.getQualifiedName());
+
+ /* attributes */
+ if(tag.hasAttributes())
+ for(XmlAttribute attribute : tag.getAttributes()) {
+ write(' ');
+ writeAttribute(attribute);
+ }
+
+ write('>');
+ }
+
+ /* write value */
+ writeEscapedValue(value);
+
+ /* write end tag */
+ {
+ write("</");
+ if((tag.getNamespace() != null) && tag.getNamespace().hasPrefix())
+ write(tag.getQualifiedName());
+ else
+ write(tag.getLocalName());
+ writeLine('>');
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Reader.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Reader.java
new file mode 100644
index 00000000..71d43b74
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Reader.java
@@ -0,0 +1,681 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+import java.lang.reflect.Field;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.openk.common.dataexchange.converter.IValueDecoder;
+import org.eclipse.openk.common.dataexchange.xml.AbstractXmlReader;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.net.UrlDefaults;
+import org.eclipse.openk.common.string.StringUtilities;
+import org.eclipse.openk.common.system.FatalException;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * The base of all <i>RDF 1.1</i> readers.
+ *
+ * @author Felix Korb
+ *
+ * @param <E>
+ * the <i>RDF</i> entity-type for subjects and objects
+ * @param <R>
+ * the result type
+ */
+public abstract class AbstractRdf1_1Reader<E, R> extends AbstractXmlReader {
+
+ // Attributes
+ private Field currentPredicateAttribute;
+ private E currentSubject;
+ private RdfTagType currentTagType;
+ private Class<E> entityType;
+ private IRdfExternalObjectReferenceSolver<E> externalObjectReferenceSolver;
+ private List<RdfObjectReference<E>> objectReferences;
+ private R result;
+ private Map<String, RdfSubject<E>> subjects;
+ private Map<String, RdfSubject<E>> unreferencedSubjects;
+
+ // Constructors
+ /**
+ * @param entityType
+ * the <i>RDF</i> entity-type for subjects and objects
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueDecoder
+ * the {@link IValueDecoder}
+ * @param externalObjectReferenceSolver
+ * the {@link IRdfExternalObjectReferenceSolver}; can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>objectType</code> is <code>null</code></li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ protected AbstractRdf1_1Reader(Class<E> entityType, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueDecoder valueDecoder, IRdfExternalObjectReferenceSolver<E> externalObjectReferenceSolver) {
+
+ super(typeInformationProvider, xmlNamespaceSolver, valueDecoder);
+
+ if(entityType == null)
+ throw new IllegalArgumentException("entityType", new NullPointerException());
+ else {
+ this.currentPredicateAttribute = null;
+ this.currentSubject = null;
+ this.currentTagType = RdfTagType.Unknown;
+ this.entityType = entityType;
+ this.externalObjectReferenceSolver = externalObjectReferenceSolver;
+ this.objectReferences = new ArrayList<>();
+ this.result = null;
+ this.subjects = new TreeMap<>();
+ this.unreferencedSubjects = null;
+ }
+ }
+
+ // Methods
+ @Override
+ public final void characters(char[] ch, int start, int length) throws SAXException {
+
+ if(currentPredicateAttribute != null) {
+ String predicateAsString;
+
+ /* determine predicate as string */
+ {
+ char[] value = new char[length];
+
+ System.arraycopy(ch, start, value, 0, length);
+
+ predicateAsString = new String(value);
+ }
+
+ /* set predicate */
+ setPredicate(currentSubject, currentPredicateAttribute, predicateAsString);
+ }
+ }
+
+ /**
+ * Creates the result.
+ *
+ * @return the result; can be <code>null</code>
+ */
+ private final R createResult() {
+
+ /* prepare creation */
+ {
+ unreferencedSubjects = new TreeMap<>(subjects);
+ solveObjectReferences();
+ }
+
+ /* create & return result model */
+ return createResult(subjects, unreferencedSubjects);
+ }
+
+ /**
+ * Creates the result.
+ *
+ * @param subjects
+ * all subjects within the <i>RDF</i> document (the object references are solved); not <code>null</code>
+ * @param unreferencedSubjects
+ * all unreferenced subjects; not <code>null</code>
+ * @return the result; can be <code>null</code>
+ */
+ @SuppressWarnings("hiding")
+ protected abstract R createResult(Map<String, RdfSubject<E>> subjects, Map<String, RdfSubject<E>> unreferencedSubjects);
+
+ @Override
+ public final void endElement(String uri, String localName, String qName) throws SAXException {
+
+ if(isPayloadEndElement(uri, localName, qName))
+ switch(currentTagType) {
+ case Predicate:
+ endPredicate(uri, localName, qName);
+ case Object:
+ currentTagType = RdfTagType.Subject;
+ break;
+ case Subject:
+ endSubject(uri, localName, qName);
+ currentTagType = RdfTagType.Rdf;
+ break;
+ case Rdf:
+ endRdf(uri, localName, qName);
+ currentTagType = RdfTagType.Unknown;
+ break;
+ default:
+ throw new UnsupportedOperationException("In a wellformed RDF document, it is not possible that there is a level above RDF."); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+
+ /**
+ * Ends the predicate.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ */
+ private void endPredicate(String uri, String localName, String qName) {
+
+ currentPredicateAttribute = null;
+ }
+
+ /**
+ * Ends the <i>RDF</i>.
+ */
+ protected void endRdf() {
+
+ /* NOOP */
+ }
+
+ /**
+ * Ends the <i>RDF</i>.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ */
+ private final void endRdf(String uri, String localName, String qName) {
+
+ endRdf();
+ }
+
+ /**
+ * Ends the subject.
+ *
+ * @param subject
+ * the subject; not <code>null</code>
+ */
+ protected void endSubject(E subject) {
+
+ /* NOOP */
+ }
+
+ /**
+ * Ends the subject.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ */
+ private final void endSubject(String uri, String localName, String qName) {
+
+ endSubject(currentSubject);
+
+ currentSubject = null;
+ }
+
+ /**
+ * Checks, if the element with the specified parameters is part of the <i>RDF 1.1</i> payload.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @return the result
+ */
+ protected boolean isPayloadEndElement(String uri, String localName, String qName) {
+
+ return true;
+ }
+
+ /**
+ * Checks, if the element with the specified parameters is part of the <i>RDF 1.1</i> payload.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ * @return the result
+ */
+ protected boolean isPayloadStartElement(String uri, String localName, String qName, Attributes atts) {
+
+ return true;
+ }
+
+ /**
+ * Reads the object.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ */
+ private final void readObject(String uri, String localName, String qName, Attributes atts) {
+
+ Field objectAttribute;
+ String objectAttributeName;
+ String objectName;
+ URI objectUri;
+
+ /* determine object name */
+ {
+ int objectNameSeparatorPosition = localName.lastIndexOf('.');
+
+ objectName = localName.substring(objectNameSeparatorPosition + 1);
+ }
+
+ /* determine object attribute */
+ {
+ objectAttribute = getEntityInformationProvider().findAttribute(currentSubject.getClass(), objectName);
+
+ if(objectAttribute == null) {
+ (new UnsupportedOperationException("Missing object attribute '" + objectName + "' in subject '" + currentSubject.toString() + "'!")).printStackTrace(); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ return;
+ }
+ }
+
+ /* create object uri */
+ {
+ String objectUriName = atts.getQName(0);
+
+ if(!StringUtilities.hasContent(objectUriName) || !objectUriName.equals(RdfDefaults.RDF_RESOURCE))
+ throw new UnsupportedOperationException("Missing URI for object '" + localName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ else {
+ objectAttributeName = atts.getLocalName(0);
+
+ try {
+ objectUri = new URI(atts.getValue(0));
+ }
+ catch(URISyntaxException exception) {
+ throw new UnsupportedOperationException("The resource-URI for object '" + localName + "' is invalid: '" + atts.getValue(0) + "'!", exception); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+ }
+
+ /* call suitable call-back function */
+ {
+ /* list */
+ if(List.class.isAssignableFrom(objectAttribute.getType()))
+ setObject(currentSubject, objectAttribute, objectUri);
+ /* object */
+ else if(entityType.isAssignableFrom(objectAttribute.getType()))
+ setObject(currentSubject, objectAttribute, objectUri);
+ /* unsupported type */
+ else
+ throw new UnsupportedOperationException("The object type '" + objectAttribute.getType().getName() + "' of object attribute '" + objectAttributeName + "' is not supported!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+
+ /**
+ * Sets the object of the specified subject using the specified <i>RDF</i> object {@link URI}.
+ *
+ * @param subject
+ * the subject; not <code>null</code>
+ * @param objectAttribute
+ * the object Attribute; not <code>null</code>
+ * @param objectUri
+ * the <i>RDF</i> object {@link URI}; not <code>null</code>
+ */
+ protected void setObject(E subject, Field objectAttribute, URI objectUri) {
+
+ objectReferences.add(new RdfObjectReference<>(subject, objectAttribute, objectUri));
+ }
+
+ /**
+ * Sets the subject identifier.
+ *
+ * @param subject
+ * the subject; not <code>null</code>
+ * @param subjectUri
+ * the <i>RDF</i> subject {@link URI}; not <code>null</code>
+ */
+ protected void setSubjectKey(E subject, URI subjectUri) {
+
+ /* NOOP */
+ }
+
+ /**
+ * @param subject
+ * the subject; not <code>null</code>
+ * @param predicateAttribute
+ * the predicate attribute; not <code>null</code>
+ * @param predicateAsString
+ * the predicate as {@link String}; not <code>null</code> can be <code>""</code>
+ */
+ protected final void setPredicate(E subject, Field predicateAttribute, String predicateAsString) {
+
+ setAttributeValue(subject, predicateAttribute, predicateAsString);
+ }
+
+ /**
+ * Returns the external referenced object.
+ *
+ * @param objectReference
+ * the {@link RdfObjectReference}; not <code>null</code>
+ * @return the external referenced object; can be <code>null</code>
+ */
+ protected E solveExternalReferencedObject(RdfObjectReference<E> objectReference) {
+
+ if(externalObjectReferenceSolver == null)
+ return null;
+ else
+ return externalObjectReferenceSolver.solveReferencedObject(objectReference);
+ }
+
+ /**
+ * Solves the <i>RDF</i> object references.
+ */
+ @SuppressWarnings("unchecked")
+ private final void solveObjectReferences() {
+
+ try {
+ for(RdfObjectReference<E> objectReference : objectReferences) {
+ E referencedObject = solveReferencedObject(objectReference);
+
+ /* check object reference */
+ if(referencedObject == null)
+ throw new UnsupportedOperationException("Can't solve object reference '" + objectReference.objectUri.toString() + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ else {
+ /* add referenced object to the object list of the subject */
+ if(List.class.isAssignableFrom(objectReference.attribute.getType())) {
+ List<E> list = (List<E>) objectReference.attribute.get(objectReference.subject);
+
+ if(list == null) {
+ list = new ArrayList<>();
+ objectReference.attribute.set(objectReference.subject, list);
+ }
+
+ list.add(referencedObject);
+ }
+ /* set referenced object for the subject */
+ else
+ objectReference.attribute.set(objectReference.subject, referencedObject);
+ }
+ }
+ }
+ catch(IllegalArgumentException | IllegalAccessException exception) {
+ throw new FatalException(exception); /* should be unreachable code */
+ }
+ }
+
+ /**
+ * Returns the referenced object.
+ *
+ * @param objectReference
+ * the {@link RdfObjectReference}; not <code>null</code>
+ * @return the referenced object; can be <code>null</code>
+ */
+ @SuppressWarnings("hiding")
+ protected final E solveReferencedObject(RdfObjectReference<E> objectReference) {
+
+ E result;
+ String uri = objectReference.objectUri.toString();
+
+ /* check resource uri => no local URI for the current document */
+ if(!StringUtilities.hasContent(uri) || (uri.length() <= 1) || (uri.charAt(0) != UrlDefaults.FRAGMENT_SEPARATOR))
+ result = solveExternalReferencedObject(objectReference);
+ else {
+ {
+ RdfSubject<E> subject = subjects.get(objectReference.objectUri.getFragment());
+
+ result = ((subject == null) ? null : subject.subject);
+ }
+
+ /* mark as referenced subject */
+ if(result != null)
+ unreferencedSubjects.remove(objectReference.objectUri.getFragment());
+ }
+
+ return result;
+ }
+
+ @Override
+ public final void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException {
+
+ if(isPayloadStartElement(uri, localName, qName, atts))
+ switch(currentTagType) {
+ case Object:
+ throw new UnsupportedOperationException("In a wellformed RDF document, it is not possible that there is an object at this point."); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ case Predicate:
+ throw new UnsupportedOperationException("In a wellformed RDF document, it is not possible that there is a predicate at this point."); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ case Rdf:
+ currentTagType = RdfTagType.Subject; /* switch to subject */
+ startSubject(uri, localName, qName, atts);
+
+ break;
+ case Subject:
+ if(atts.getLength() == 0) /* no attributes signals a predicate (an object otherwise) */
+ {
+ currentTagType = RdfTagType.Predicate; /* switch to predicate */
+ startPredicate(uri, localName, qName, atts);
+ }
+ else {
+ currentTagType = RdfTagType.Object; /* switch to object */
+ readObject(uri, localName, qName, atts);
+ }
+ break;
+ case Unknown:
+ currentTagType = RdfTagType.Rdf; /* switch to rdf */
+ startRdf(uri, localName, qName, atts);
+
+ break;
+ }
+ }
+
+ /**
+ * Starts the predicate.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ */
+ private final void startPredicate(String uri, String localName, String qName, Attributes atts) {
+
+ String predicateName;
+
+ /* determine predicate name */
+ {
+ int predicateNameSeparatorPosition = localName.lastIndexOf('.');
+
+ predicateName = localName.substring(predicateNameSeparatorPosition + 1);
+ }
+
+ /* determine predicate attribute */
+ {
+ Field predicateAttribute = getEntityInformationProvider().findAttribute(currentSubject.getClass(), predicateName);
+
+ if(predicateAttribute == null)
+ throw new UnsupportedOperationException("Missing predicate attribute '" + predicateName + "' in subject '" + currentSubject.toString() + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ else
+ currentPredicateAttribute = predicateAttribute;
+ }
+ }
+
+ /**
+ * Starts the <i>RDF</i>.
+ */
+ protected void startRdf() {
+
+ /* NOOP */
+ }
+
+ /**
+ * Starts the <i>RDF</i>.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ */
+ private final void startRdf(String uri, String localName, String qName, Attributes atts) {
+
+ startRdf();
+ }
+
+ /**
+ * Starts the subject.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>subject</code> is not <code>null</code></li>
+ * <li><code>subjectUri</code> is not <code>null</code></li>
+ * <li><code>subjectUriType</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param subject
+ * the subject
+ * @param subjectUri
+ * the <i>RDF</i> subject {@link URI}
+ * @param subjectUriType
+ * the <i>RDF</i>-subject <i>URI</i> type
+ */
+ protected void startSubject(E subject, URI subjectUri, RdfSubjectUriType subjectUriType) {
+
+ setSubjectKey(subject, subjectUri);
+
+ subjects.put(subjectUri.toString(), new RdfSubject<>(subject, subjectUri, subjectUriType));
+ }
+
+ /**
+ * Starts the subject.
+ *
+ * @param uri
+ * the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed
+ * @param localName
+ * the local name (without prefix), or the empty string if Namespace processing is not being performed
+ * @param qName
+ * the qualified name (with prefix), or the empty string if qualified names are not available
+ * @param atts
+ * the attributes attached to the element. If there are no attributes, it shall be an empty {@link Attributes} object.
+ */
+ @SuppressWarnings("unchecked")
+ private final void startSubject(String uri, String localName, String qName, Attributes atts) {
+
+ E subject;
+ URI subjectUri;
+ RdfSubjectUriType subjectUriType;
+ Class<?> type;
+
+ /* find subject type */
+ {
+ Package modelDefinitionPackage = findModelDefinitionPackage(uri, localName, qName, atts);
+
+ type = getEntityInformationProvider().findType(modelDefinitionPackage, localName);
+
+ if(type == null)
+ throw new UnsupportedOperationException("Missing subject definition for subject '" + localName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+
+ /* instantiate subject */
+ try {
+ subject = (E) type.newInstance();
+ }
+ catch(InstantiationException | IllegalAccessException exception) {
+ throw new UnsupportedOperationException("Unable to instantiate the subject '" + localName + "'!", exception); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+
+ /* create subject uri */
+ {
+ String subjectAttributeName = atts.getQName(0);
+
+ if(!StringUtilities.hasContent(subjectAttributeName))
+ throw new UnsupportedOperationException("Missing subject-URI for subject '" + localName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ else {
+ String subjectAttributeValue = atts.getValue(0);
+
+ if(!StringUtilities.hasContent(subjectAttributeValue))
+ throw new UnsupportedOperationException("Missing subject-URI for subject '" + localName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ else
+ try {
+ if(subjectAttributeName.equals(RdfDefaults.RDF_ABOUT))
+ subjectUriType = RdfSubjectUriType.About;
+ else if(subjectAttributeName.equals(RdfDefaults.RDF_ID))
+ subjectUriType = RdfSubjectUriType.Id;
+ else
+ throw new UnsupportedOperationException("Missing subject-URI for subject '" + localName + "'!"); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+
+ /* remove '#' to normalize the subjectUris */
+ // REFACTOR 2017-07-17 Felix => Felix: generelle Auflösung der IRI/URI-Verknüpfung der subjects notwendig - hier werden momentan nur dokument-lokale URL unterstützt!
+ if(subjectAttributeValue.charAt(0) == UrlDefaults.FRAGMENT_SEPARATOR)
+ subjectUri = new URI(subjectAttributeValue.substring(1));
+ else
+ subjectUri = new URI(subjectAttributeValue);
+ }
+ catch(URISyntaxException exception) {
+ throw new UnsupportedOperationException("The subject-URI for subject '" + localName + "' is invalid: '" + atts.getValue(0) + "'!", exception); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+ }
+
+ /* set instance variable currentSubject */
+ currentSubject = subject;
+
+ /* start subject */
+ startSubject(currentSubject, subjectUri, subjectUriType);
+ }
+
+ // Properties
+ /**
+ * @return the result; can be <code>null</code>
+ */
+ public final R getResult() {
+
+ if(result == null)
+ result = createResult();
+
+ return result;
+ }
+
+ /**
+ * Returns the {@link RdfSubject} with the specified key.
+ *
+ * @param key
+ * the key
+ * @return the {@link RdfSubject}<br/>
+ * <code>null</code> if there is no matching {@link RdfSubject}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>key</code> is <code>null</code> or <code>""</code></li>
+ * </ul>
+ */
+ public final RdfSubject<E> getSubject(String key) {
+
+ if(!StringUtilities.hasContent(key))
+ throw new IllegalArgumentException("key");
+ else {
+ if(subjects == null)
+ return null;
+ else
+ return subjects.get(key);
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Writer.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Writer.java
new file mode 100644
index 00000000..28e94e08
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/AbstractRdf1_1Writer.java
@@ -0,0 +1,286 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URI;
+
+import org.eclipse.openk.common.dataexchange.cim.ICimEntity;
+import org.eclipse.openk.common.dataexchange.converter.IValueEncoder;
+import org.eclipse.openk.common.dataexchange.xml.AbstractXmlConverter;
+import org.eclipse.openk.common.dataexchange.xml.IXmlNamespaceSolver;
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespace;
+import org.eclipse.openk.common.dataexchange.xml.XmlTag;
+import org.eclipse.openk.common.dataexchange.xml.XmlTagTermination;
+import org.eclipse.openk.common.dataexchange.xml.XmlWriter;
+import org.eclipse.openk.common.net.UrlDefaults;
+import org.eclipse.openk.common.system.type.ITypeInformationProvider;
+import org.eclipse.openk.common.value.InvalidValueException;
+
+// REFACTOR 2017-04-25 Felix => Frank: prüf' mal bitte, ob wir eine gemeinsame Basisklasse für die Writer (XML & RDF) schaffen sollten (die Benennung "AbstractXmlWriter" ist momentan noch falsch...)
+// REFACTOR 2017-04-27 Felix => Frank: XmlTag mit Namespace hier generieren (keine Veränderung der Methodenparameter)
+// REFACTOR 2017-07-17 Felix => Frank: Bitte fehlende Kommentare + Vor-/Nachbedingungen in den Methoden ergänzen.
+/**
+ * Base class for writing <i>RDF</i>.
+ *
+ * @author Felix Korb
+ * @author Frank Jäger
+ */
+public abstract class AbstractRdf1_1Writer extends AbstractXmlConverter {
+
+ // Attributes
+ private XmlTag rdfTag;
+ private IValueEncoder valueEncoder;
+ protected XmlWriter writer;
+
+ // Constructors
+ /**
+ * @param writer
+ * the {@link XmlWriter}
+ * @param typeInformationProvider
+ * the {@link ITypeInformationProvider}
+ * @param xmlNamespaceSolver
+ * the {@link IXmlNamespaceSolver}
+ * @param valueEncoder
+ * the {@link IValueEncoder}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * <li><code>typeInformationProvider</code> is <code>null</code></li>
+ * <li><code>xmlNamespaceSolver</code> is <code>null</code></li>
+ * <li><code>valueDecoder</code> is <code>null</code></li>
+ * </ul>
+ */
+ protected AbstractRdf1_1Writer(XmlWriter writer, ITypeInformationProvider typeInformationProvider, IXmlNamespaceSolver xmlNamespaceSolver, IValueEncoder valueEncoder) {
+
+ super(typeInformationProvider, xmlNamespaceSolver);
+
+ if((writer == null) || (valueEncoder == null))
+ if(writer == null)
+ throw new IllegalArgumentException("writer", new NullPointerException());
+ else
+ throw new IllegalArgumentException("valueEncoder", new NullPointerException());
+ else {
+ this.rdfTag = null;
+ this.valueEncoder = valueEncoder;
+ this.writer = writer;
+ }
+ }
+
+ // Methods
+ /**
+ * get or creates an RDF tag from namespaceDeclarations
+ *
+ * @param additionalNamespaceDeclarations
+ * array of namespace declarations, may be <cod>null</code>
+ * @return the RDF tag
+ */
+ private XmlTag createRdfTag(XmlNamespace... additionalNamespaceDeclarations) {
+
+ XmlNamespace[] namespaceDeclarations;
+
+ /* create namespace declarations */
+ {
+ /* create namespace declarations array and add additional namespace declarations */
+ if((additionalNamespaceDeclarations != null) && (additionalNamespaceDeclarations.length != 0)) {
+
+ namespaceDeclarations = new XmlNamespace[additionalNamespaceDeclarations.length + 1];
+ System.arraycopy(additionalNamespaceDeclarations, 0, namespaceDeclarations, 1, additionalNamespaceDeclarations.length);
+ }
+ else
+ namespaceDeclarations = new XmlNamespace[1];
+
+ /* add RDF namespace */
+ namespaceDeclarations[0] = RdfDefaults.RDF_1_1_NAMESPACE;
+ }
+
+ return new XmlTag(RdfDefaults.RDF_1_1_NAMESPACE, RdfDefaults.RDF, namespaceDeclarations);
+ }
+
+ /**
+ * Writes the tag for the <i>RDF-Object</i>
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>tag</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param tag
+ * @param objectUri
+ * @throws IOException
+ */
+ protected final void writeObject(XmlTag tag, URI objectUri) throws IOException {
+
+ XmlTag objectTag = tag;
+
+ objectTag.addAttribute(RdfDefaults.RDF_RESOURCE, objectUri.toString());
+ writer.writeTagLine(objectTag, XmlTagTermination.ForceImmetiateTermination);
+ }
+
+ /**
+ * Writes the tag for the <i>RDF-Predicate</i>
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>tag</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param tag
+ * @param predicateAsString
+ * @throws IOException
+ */
+ protected final void writePredicate(XmlTag tag, String predicateAsString) throws IOException {
+
+ writer.writeTaggedValue(tag, predicateAsString);
+ }
+
+ /**
+ * Writes the end tag for the <i>RDF</i>
+ *
+ * @throws IOException
+ * @throws ErrorWritingRdfException
+ * if RDF document does not have a start tag
+ */
+ protected final void writeRdfEnd() throws IOException {
+
+ if(rdfTag == null)
+ throw new IllegalStateException("RDF document not started!"); // FIXME 2017-04-27 Frank: geeignete Ausnahme schmeißen
+ else
+ writer.writeEndTagLine(rdfTag);
+ }
+
+ /**
+ * Writes the start tag of the <i>RDF</i>
+ *
+ * @param additionalNamespaceDeclarations
+ * array of namespace declarations, may be <cod>null</code>
+ * @throws IOException
+ * @throws ErrorWritingRdfException
+ * if RDF document was already started by RDF start tag
+ */
+ protected final void writeRdfStart(XmlNamespace... additionalNamespaceDeclarations) throws IOException {
+
+ if(rdfTag != null)
+ throw new IllegalStateException("RDF document already started!"); // FIXME 2017-04-27 Frank: geeignete Ausnahme schmeißen
+ else {
+ rdfTag = createRdfTag(additionalNamespaceDeclarations);
+
+ writer.writeTagLine(rdfTag, XmlTagTermination.ForceEndTag);
+ }
+ }
+
+ /**
+ * Writes the end tag for the <i>RDF-Subject</i>
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>tag</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param tag
+ * @throws IOException
+ */
+ protected final void writeSubjectEnd(XmlTag tag) throws IOException {
+
+ writer.writeEndTagLine(tag);
+ }
+
+ /**
+ * Writes the start tag for the <i>RDF-Subject</i>
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>tag</code> is not <code>null</code></li>
+ * <li><code>subjectUri</code> is not <code>null</code></li>
+ * <li><code>subjectUriType</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param tag
+ * the {@link XmlTag} of the subject
+ * @param subjectUri
+ * the <i>RDF</i> subject {@link URI}
+ * @param subjectUriType
+ * the <i>RDF</i>-subject <i>URI</i> type
+ * @throws IOException
+ */
+ protected final void writeSubjectStart(XmlTag tag, URI subjectUri, RdfSubjectUriType subjectUriType) throws IOException {
+
+ XmlTag startTag = tag;
+
+ if(subjectUriType == RdfSubjectUriType.About)
+ startTag.addAttribute(RdfDefaults.RDF_ABOUT, UrlDefaults.FRAGMENT_SEPARATOR + subjectUri.toString());
+ else
+ startTag.addAttribute(RdfDefaults.RDF_ID, subjectUri.toString());
+
+ writer.writeTagLine(startTag, XmlTagTermination.ForceEndTag);
+ }
+
+ /**
+ * Writes the value of the specified attribute.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>entity</code> is not <code>null</code></li>
+ * <li><code>attribute</code> is not <code>null</code></li>
+ * <li>the type of <code>entity</code> contains <code>attribute</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param entity
+ * the {@link ICimEntity}
+ * @param attribute
+ * the attribute
+ * @throws IOException
+ */
+ protected void writeValue(Object entity, Field attribute) throws IOException { // REFACTOR 2017-04-25 Felix => Frank: das mit "ICimEnity" ist bei mir falsch und daher auch falsch kopiert. Wir sollten hier eher einen generischen Parameter übergen - oder stumpf "Object"
+
+ Class<?> valueType = attribute.getType();
+
+ try {
+ /* boolean */
+ if(boolean.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeBoolean(entity, attribute));
+ /* byte */
+ else if(byte.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeByte(entity, attribute));
+ /* char */
+ else if(char.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeChar(entity, attribute));
+ /* double */
+ else if(double.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeDouble(entity, attribute));
+ /* float */
+ else if(float.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeFloat(entity, attribute));
+ /* int */
+ else if(int.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeInt(entity, attribute));
+ /* long */
+ else if(long.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeLong(entity, attribute));
+ /* short */
+ else if(short.class.equals(valueType))
+ writer.writeEscapedValue(valueEncoder.encodeShort(entity, attribute));
+ /* other types */
+ else
+ writer.writeEscapedValue(valueEncoder.encodeValue(attribute, attribute.get(entity)));
+ }
+ catch(IllegalAccessException | IllegalArgumentException | InvalidValueException exception) {
+ throw new UnsupportedOperationException("Unable to write the attribute value '" + entity.getClass().getName() + "." + attribute.getName() + "'!", exception); // FIXME 2017-04-16 Felix: geeignete Ausnahme schmeißen
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/ErrorWritingRdfException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/ErrorWritingRdfException.java
new file mode 100644
index 00000000..3224bc53
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/ErrorWritingRdfException.java
@@ -0,0 +1,40 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+import org.eclipse.openk.common.messaging.AbstractException;
+
+public class ErrorWritingRdfException extends AbstractException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "An error occured, writing the RDF!";
+
+ // Constructors
+ public ErrorWritingRdfException() {
+
+ this(TEXT, null);
+ }
+
+ public ErrorWritingRdfException(Throwable cause) {
+
+ this(TEXT, cause);
+ }
+
+
+ public ErrorWritingRdfException(String text) {
+
+ this(text, null);
+ }
+
+ /**
+ * @param text
+ * the message text, can be <code>null</code>
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public ErrorWritingRdfException(String text, Throwable cause) {
+
+ super(text, cause);
+ }
+
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/IRdfExternalObjectReferenceSolver.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/IRdfExternalObjectReferenceSolver.java
new file mode 100644
index 00000000..5c624a08
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/IRdfExternalObjectReferenceSolver.java
@@ -0,0 +1,30 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+/**
+ * Defines the commonalities of all solvers for <i>RDF</i> object references, that are not defined in the current <i>RDF</i> document.
+ *
+ * @author Felix Korb
+ *
+ * @param <E>
+ * the <i>RDF</i> entity-type for subjects and objects
+ */
+public interface IRdfExternalObjectReferenceSolver<E> {
+
+ // Methods
+ /**
+ * Solves the specified external referenced <i>RDF</i> object.
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>externalReference</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param externalReference
+ * the external {@link RdfObjectReference}
+ * @return the referenced object; can be <code>null</code>
+ */
+ E solveReferencedObject(RdfObjectReference<E> externalReference);
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfDefaults.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfDefaults.java
new file mode 100644
index 00000000..19e7d39f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfDefaults.java
@@ -0,0 +1,27 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+import org.eclipse.openk.common.dataexchange.xml.XmlNamespace;
+import org.eclipse.openk.common.net.UrlDefaults;
+
+/**
+ * Provides some default values.
+ *
+ * @author Felix Korb
+ */
+public final class RdfDefaults {
+
+ // Constants
+ /* object & subject-references */
+ public static final String RDF = "RDF";
+ public static final String RDF_NAMESPACE_PREFIX = "rdf";
+ public static final String RDF_ABOUT = RDF_NAMESPACE_PREFIX + ":about";
+ public static final String RDF_ID = RDF_NAMESPACE_PREFIX + ":ID";
+ public static final String RDF_NAMESPACE_ADDRESS = "http://www.w3.org/1999/02/22-rdf-syntax-ns" + UrlDefaults.FRAGMENT_SEPARATOR;
+ public static final String RDF_RESOURCE = RDF_NAMESPACE_PREFIX + ":resource";
+ public static final XmlNamespace RDF_1_1_NAMESPACE = new XmlNamespace(RdfDefaults.RDF_NAMESPACE_ADDRESS, RdfDefaults.RDF_NAMESPACE_PREFIX);
+
+ // Constructors
+ private RdfDefaults() {
+ /* suppresses the instantiation! */
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfObjectReference.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfObjectReference.java
new file mode 100644
index 00000000..05262a1a
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfObjectReference.java
@@ -0,0 +1,48 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+import java.lang.reflect.Field;
+import java.net.URI;
+
+/**
+ * The <i>RDF</i> object reference.
+ *
+ * @author Felix Korb
+ *
+ * @param <E>
+ * the <i>RDF</i> entity-type for subjects and objects
+ */
+public final class RdfObjectReference<E> {
+
+ // Attributes
+ public Field attribute;
+ public E subject;
+ public URI objectUri;
+
+ // Constructors
+ /**
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>subject</code> is not <code>null</code></li>
+ * <li><code>objectAttribute</code> is not <code>null</code></li>
+ * <li><code>objectUri</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param subject
+ * the subject
+ * @param objectAttribute
+ * the attribute
+ * @param objectUri
+ * the <i>RDF</i> object {@link URI}
+ */
+ public RdfObjectReference(E subject, Field objectAttribute, URI objectUri) {
+
+ this.attribute = objectAttribute;
+ this.subject = subject;
+ this.objectUri = objectUri;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubject.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubject.java
new file mode 100644
index 00000000..6eccd15d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubject.java
@@ -0,0 +1,46 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+import java.net.URI;
+
+/**
+ * The <i>RDF</i> subject.
+ *
+ * @author Felix Korb
+ *
+ * @param <E>
+ * the <i>RDF</i> entity-type for subjects and objects
+ */
+public final class RdfSubject<E> {
+
+ // Attributes
+ public E subject;
+ public URI subjectUri;
+ public RdfSubjectUriType subjectUriType;
+
+ // Constructors
+ /**
+ * <p>
+ * <b><i>NOTE:</i></b><br/>
+ * Since this is a performance critical operation, the parameter-check is skipped!<br/>
+ * It is assumed that
+ * <ul>
+ * <li><code>subject</code> is not <code>null</code></li>
+ * <li><code>subjectUri</code> is not <code>null</code></li>
+ * <li><code>subjectUriType</code> is not <code>null</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param subject
+ * the subject
+ * @param subjectUri
+ * the <i>RDF</i> subject {@link URI}
+ * @param subjectUriType
+ * the <i>RDF</i>-subject <i>URI</i> type
+ */
+ public RdfSubject(E subject, URI subjectUri, RdfSubjectUriType subjectUriType) {
+
+ this.subject = subject;
+ this.subjectUri = subjectUri;
+ this.subjectUriType = subjectUriType;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubjectUriType.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubjectUriType.java
new file mode 100644
index 00000000..9261f23c
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfSubjectUriType.java
@@ -0,0 +1,13 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+/**
+ * Defines all possible <i>RDF</i>-subject <i>URI</i> types.
+ *
+ * @author Felix Korb
+ */
+public enum RdfSubjectUriType {
+
+ // Constants
+ About,
+ Id
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfTagType.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfTagType.java
new file mode 100644
index 00000000..d61ef67c
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfTagType.java
@@ -0,0 +1,16 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+/**
+ * Defines the possible <i>RDF</i> tag types.
+ *
+ * @author Felix Korb
+ */
+public enum RdfTagType {
+
+ Object,
+ Predicate,
+ Rdf,
+ Subject,
+ Unknown
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfVersion.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfVersion.java
new file mode 100644
index 00000000..ec39a6f5
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/rdf/RdfVersion.java
@@ -0,0 +1,13 @@
+package org.eclipse.openk.common.dataexchange.xml.rdf;
+
+/**
+ * Defines all possible <i>RDF</i>-versions.
+ *
+ * @author Felix Korb
+ */
+public enum RdfVersion {
+
+ // Constants
+ /** Version 1.1 */
+ V1_1
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimHeaderException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimHeaderException.java
new file mode 100644
index 00000000..c40424ed
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimHeaderException.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.dataexchange.xml.validation;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * To be thrown on invalid XML CIM HEADER
+ *
+ * @author Carsten Meyer
+ */
+public class InvalidXmlCimHeaderException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "The header of the xml cim message is invalid!";
+
+ // Constructors
+ public InvalidXmlCimHeaderException() {
+
+ this(null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public InvalidXmlCimHeaderException(Throwable cause) {
+
+ super(TEXT, cause);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimPayloadException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimPayloadException.java
new file mode 100644
index 00000000..9a0d61b5
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlCimPayloadException.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.dataexchange.xml.validation;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * To be thrown on invalid XML CIM PAYLOAD
+ *
+ * @author Carsten Meyer
+ */
+public class InvalidXmlCimPayloadException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "The payload of the xml cim message is invalid!";
+
+ // Constructors
+ public InvalidXmlCimPayloadException() {
+
+ this(null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public InvalidXmlCimPayloadException(Throwable cause) {
+
+ super(TEXT, cause);
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlException.java
new file mode 100644
index 00000000..d662ac5f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/InvalidXmlException.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.dataexchange.xml.validation;
+
+import org.eclipse.openk.common.messaging.AbstractException;
+
+/**
+ * to be thrown on invalid xsd schema validation
+ *
+ * @author Carsten Meyer
+ */
+public final class InvalidXmlException extends AbstractException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "The XML-document is invalid!";
+
+ // Constructors
+ public InvalidXmlException() {
+
+ this(null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public InvalidXmlException(Throwable cause) {
+
+ super(TEXT, cause);
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/MissingSchemaException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/MissingSchemaException.java
new file mode 100644
index 00000000..5ab6d81d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/MissingSchemaException.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.dataexchange.xml.validation;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * to be thrown on invalid xsd schema validation due to a missing xsd schema
+ *
+ * @author Carsten Meyer
+ */
+public final class MissingSchemaException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ private static final String TEXT = "There is no schema!";
+
+ // Constructors
+ public MissingSchemaException() {
+
+ this(null);
+ }
+
+ /**
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ */
+ public MissingSchemaException(Throwable cause) {
+
+ super(TEXT, cause);
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaBuilder.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaBuilder.java
new file mode 100644
index 00000000..49193658
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaBuilder.java
@@ -0,0 +1,118 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml.validation;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.XMLConstants;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.xml.sax.SAXException;
+
+/**
+ * creates xsd schema on a given url string or
+ * file path string to be set in an instance of SchemaResource
+ *
+ * @author Carsten Meyer
+ *
+ */
+public class SchemaBuilder {
+
+ private URL schemaResource;
+
+ public SchemaBuilder(URL schemaResource) {
+
+ this.schemaResource = schemaResource;
+ }
+
+ /**
+ * creates xsd schema from file path
+ *
+ * @return
+ * the schema
+ * @throws MalformedURLException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>an given or computed url is malformed</li>
+ * <li>the file path is <code>null</code></li>
+ * </ul>
+ * @throws MissingSchemaException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>the schema resource is <code>null</code></li>
+ * </ul>
+ */
+ private Schema createSchemaFromFilePath() throws MalformedURLException, MissingSchemaException {
+
+ // File file = new File(this.schemaResource.getFile());
+ // URL schemaResource = file.toURI().toURL();
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ try {
+ Schema schema = schemaFactory.newSchema(schemaResource);
+ return schema;
+ }
+ catch(SAXException e) {
+ throw new MissingSchemaException(null);
+ }
+ }
+
+ /**
+ * creates xsd schema from url
+ *
+ * @return
+ * the schema
+ * @throws MalformedURLException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>given url is malformed</li>
+ * <li>the url path is <code>null</code></li>
+ * </ul>
+ * @throws MissingSchemaException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>the schema resource is <code>null</code></li>
+ * </ul>
+ */
+ private Schema createSchemaFromUrl() throws MalformedURLException, MissingSchemaException {
+
+ // URL schemaResource = new URL(this.schemaResource.getUrl());
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ try {
+ Schema schema = schemaFactory.newSchema(schemaResource);
+ return schema;
+ }
+ catch(SAXException e) {
+ throw new MissingSchemaException(null);
+ }
+ }
+
+ /**
+ * creates xsd schema on a given url or file path
+ *
+ * @return
+ * xsd schema
+ *
+ * @throws MalformedURLException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>given url is malformed</li>
+ * <li>the url path is <code>null</code></li>
+ * <li>the file path is <code>null</code> and can't be converted to wellformed url</li>
+ * </ul>
+ * @throws MissingSchemaException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li>the schema resource is <code>null</code></li>
+ * </ul>
+ */
+ public Schema getSchema() throws MalformedURLException, MissingSchemaException {
+
+ if(schemaResource != null) {
+ return this.createSchemaFromUrl();
+ }
+ else {
+ return this.createSchemaFromFilePath();
+ }
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaResource.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaResource.java
new file mode 100644
index 00000000..31ec5f7f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/dataexchange/xml/validation/SchemaResource.java
@@ -0,0 +1,52 @@
+// FIXME 2017-04-15 Felix: illegal commit
+package org.eclipse.openk.common.dataexchange.xml.validation;
+
+/**
+ * provides file path or or url for xsd schema creation
+ *
+ * @author Carsten Meyer
+ *
+ */
+public class SchemaResource {
+
+ private String url = null;
+ private String file = null;
+
+ /**
+ *
+ * @return url string
+ */
+ public String getUrl() {
+
+ return url;
+ }
+
+ /**
+ *
+ * @return file path string
+ */
+ public String getFile() {
+
+ return file;
+ }
+
+ /**
+ *
+ * @param url
+ * the url of the xsd schema
+ */
+ public void setUrl(String url) {
+
+ this.url = url;
+ }
+
+ /**
+ *
+ * @param file
+ * the file path of the xsd schema
+ */
+ public void setFile(String file) {
+
+ this.file = file;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateDefaults.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateDefaults.java
new file mode 100644
index 00000000..8d34958f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateDefaults.java
@@ -0,0 +1,39 @@
+package org.eclipse.openk.common.date;
+
+import java.text.DateFormat;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Provides some default values.
+ *
+ * @author Renko Ortgies
+ */
+public class DateDefaults {
+
+ // Constants
+ /* patterns */
+ public static final String DATE_FORMAT_PATTERN_UTC_TIMESTAMP = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+ public static final String DATE_FORMATTER_PATTERN_UTC_TIMESTAMP = "yyyy-MM-dd'Z'";
+ public static final String DATE_TIME_FORMATTER_PATTERN_UTC_TIMESTAMP = "yyyy-MM-dd['T'[HH][:mm][:ss][.SSS]]'Z'";
+ public static final String TIME_FORMATTER_PATTERN_UTC_TIMESTAMP = "[HH][:mm][:ss][.SSS]'Z'";
+
+ /* date formats */
+ public static final DateFormat UTC_TIMESTAMP_DATE_FORMAT = DateUtilities.createUtcDateFormat(DATE_FORMAT_PATTERN_UTC_TIMESTAMP);
+
+ /* date time formatters */
+ public static final DateTimeFormatter UTC_TIMESTAMP_DATE_FORMATTER = DateTimeFormatter.ofPattern(DATE_FORMATTER_PATTERN_UTC_TIMESTAMP);
+ public static final DateTimeFormatter UTC_TIMESTAMP_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern(DATE_TIME_FORMATTER_PATTERN_UTC_TIMESTAMP);
+ public static final DateTimeFormatter UTC_TIMESTAMP_TIME_FORMATTER = DateTimeFormatter.ofPattern(TIME_FORMATTER_PATTERN_UTC_TIMESTAMP);
+
+ /* scopes */
+ public static final long MIN_DATE = -62135773200000L;
+ public static final long MAX_DATE = 253402210800000L;
+
+ public static final String MIN_DATE_AS_STRING = "0001-01-01T00:00:00.000Z";
+ public static final String MAX_DATE_AS_STRING = "9999-12-31T23:59:59.999Z";
+
+ // Constructors
+ private DateDefaults() {
+ /* suppresses the instantiation! */
+ }
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateUtilities.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateUtilities.java
new file mode 100644
index 00000000..464ebf95
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/DateUtilities.java
@@ -0,0 +1,37 @@
+package org.eclipse.openk.common.date;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.TimeZone;
+
+/**
+ * This class consists exclusively of static methods that support the work with dates.
+ *
+ * @author Felix Korb
+ */
+public final class DateUtilities {
+
+ // Constructors
+ private DateUtilities() {
+ /* suppresses the instantiation! */
+ }
+
+ // Methods
+ /**
+ * Creates a {@link DateFormat} in <b>UTC time</b> in the specified format.
+ *
+ * @param pattern
+ * the pattern describing the date and time format; not <code>null</code> and a valid pattern
+ * @return the date format; not <code>null</code>
+ */
+ public static DateFormat createUtcDateFormat(String pattern) {
+
+ /* create the date format */
+ SimpleDateFormat result = new SimpleDateFormat(pattern);
+
+ /* set the time zone to UTC */
+ result.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ return result;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/ITimer.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/ITimer.java
new file mode 100644
index 00000000..7d3c4d3f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/ITimer.java
@@ -0,0 +1,27 @@
+package org.eclipse.openk.common.date;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * Defines the commonalities of time handling.
+ *
+ * @author Renko Ortgies
+ */
+public interface ITimer {
+
+ // Methods
+ /**
+ * Returns the current Date and Time
+ *
+ * @return the date and time; not <code>null</code>
+ */
+ LocalDateTime getCurrentDateTime();
+
+ /**
+ * Returns the current Date
+ *
+ * @return the date; not <code>null</code>
+ */
+ LocalDate getCurrentDate();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/Timer.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/Timer.java
new file mode 100644
index 00000000..2578e4b4
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/date/Timer.java
@@ -0,0 +1,25 @@
+package org.eclipse.openk.common.date;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * The default implementation of a timer.
+ *
+ * @author Renko Ortgies
+ */
+public final class Timer implements ITimer {
+
+ // Methods
+ @Override
+ public LocalDateTime getCurrentDateTime() {
+
+ return LocalDateTime.now();
+ }
+
+ @Override
+ public LocalDate getCurrentDate() {
+
+ return LocalDate.now();
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/Charset.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/Charset.java
new file mode 100644
index 00000000..ac8195c8
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/Charset.java
@@ -0,0 +1,22 @@
+package org.eclipse.openk.common.io;
+
+/**
+ * Defines all possible character-sets.
+ *
+ * @author Felix Korb
+ */
+public enum Charset {
+ // Constants
+ /** ISO Latin Alphabet No. 1, a.k.a. <i>ISO-LATIN-1</i> */
+ ISO_8859_1,
+ /** seven-bit ASCII, a.k.a. <i>ISO646-US</i>, a.k.a. the Basic Latin block of the Unicode character set */
+ US_ASCII,
+ /** Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark */
+ UTF_16,
+ /** Sixteen-bit UCS Transformation Format, big-endian byte order */
+ UTF_16BE,
+ /** Sixteen-bit UCS Transformation Format, little-endian byte order */
+ UTF_16LE,
+ /** Eight-bit UCS Transformation Format */
+ UTF_8
+}
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileEvent.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileEvent.java
new file mode 100644
index 00000000..6c4da255
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileEvent.java
@@ -0,0 +1,75 @@
+package org.eclipse.openk.common.io;
+
+import java.io.File;
+import java.util.EventObject;
+
+/**
+ * The file event.
+ *
+ * @author Felix Korb
+ * @author Renko Ortgies
+ */
+public final class FileEvent extends EventObject {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ // Attributes
+ private File file;
+ private Kind kind;
+
+ // Constructors
+ /**
+ * @param source
+ * the object on which the event initially occurred
+ * @param kind
+ * the event kind
+ * @param file
+ * the changed file
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>source</code> is <code>null</code></li>
+ * <li><code>kind</code> is <code>null</code></li>
+ * <li><code>file</code> is <code>null</code></li>
+ * </ul>
+ */
+ public FileEvent(Object source, Kind kind, File file) {
+
+ super(source);
+
+ if((kind == null) || (file == null))
+ if(kind == null)
+ throw new IllegalArgumentException("kind", new NullPointerException());
+ else
+ throw new IllegalArgumentException("file", new NullPointerException());
+ else {
+ this.kind = kind;
+ this.file = file;
+ }
+ }
+
+ // Properties
+ /**
+ * @return the changed file; not <code>null</code>
+ */
+ public File getFile() {
+
+ return file;
+ }
+
+ /**
+ * @return the event kind; not <code>null</code>
+ */
+ public Kind getKind() {
+
+ return kind;
+ }
+
+ // Classes
+ public static enum Kind {
+ Created,
+ Deleted,
+ Modified
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileNotFoundException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileNotFoundException.java
new file mode 100644
index 00000000..957ec723
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileNotFoundException.java
@@ -0,0 +1,24 @@
+package org.eclipse.openk.common.io;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * Exception handling for: the requested file could not be found
+ *
+ * @author Frank Jäger
+ */
+public class FileNotFoundException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ // Constructors
+ /**
+ * @param cause
+ * the causing inner exception; can be <code>null</code>
+ */
+ public FileNotFoundException(Throwable cause) {
+
+ super("The file you requested does not exist!", cause);
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcher.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcher.java
new file mode 100644
index 00000000..2c5b5dbb
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcher.java
@@ -0,0 +1,230 @@
+package org.eclipse.openk.common.io;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.monitor.FileAlterationListener;
+import org.apache.commons.io.monitor.FileAlterationMonitor;
+import org.apache.commons.io.monitor.FileAlterationObserver;
+
+/**
+ * The file system watcher.
+ *
+ * @author Felix Korb
+ * @author Michael Kotten
+ * @author Renko Ortgies
+ */
+public final class FileSystemWatcher implements FileAlterationListener {
+
+ // Attributes
+ private Path directoryToObserve;
+ private List<WeakReference<IFileSystemListener>> listeners;
+ private FileAlterationMonitor monitor;
+ private FileAlterationObserver observer;
+ private long pollingInterval;
+
+ // Constructors
+ /**
+ * @param directoryToObserve
+ * the directory to be observed
+ * @param pollingInterval
+ * the interval to poll for file changes in milliseconds
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>directoryToObserve</code> is <code>null</code></li>>
+ * <li><code>pollingInterval</code> is less than <code>1</code></li>
+ * </ul>
+ */
+ public FileSystemWatcher(Path directoryToObserve, long pollingInterval) {
+
+ if((directoryToObserve == null) || (pollingInterval < 1))
+ if(directoryToObserve == null)
+ throw new IllegalArgumentException("directoryToObserve", new NullPointerException());
+ else
+ throw new IllegalArgumentException("pollingInterval");
+ else {
+ this.directoryToObserve = directoryToObserve;
+ this.listeners = new ArrayList<>();
+ this.pollingInterval = pollingInterval;
+ }
+ }
+
+ // EventHandling
+ /**
+ * Adds the specified {@link IFileSystemListener}.
+ *
+ * @param value
+ * the {@link IFileSystemListener}; not <code>null</code>
+ */
+ public void addListener(IFileSystemListener value) {
+
+ synchronized(listeners) {
+ listeners.add(new WeakReference<>(value));
+ }
+ }
+
+ /**
+ * Fires the event.
+ *
+ * @param kind
+ * the event kind; not <code>null</code>
+ * @param file
+ * the created file; not <code>null</code>
+ */
+ private void fireFileCreated(FileEvent.Kind kind, File file) {
+
+ synchronized(listeners) {
+ FileEvent event = new FileEvent(this, kind, file);
+
+ for(WeakReference<IFileSystemListener> listener : listeners)
+ listener.get().fileCreated(event);
+ }
+ }
+
+ /**
+ * Fires the event.
+ *
+ * @param kind
+ * the event kind; not <code>null</code>
+ * @param file
+ * the deleted file; not <code>null</code>
+ */
+ private void fireFileDeleted(FileEvent.Kind kind, File file) {
+
+ synchronized(listeners) {
+ FileEvent event = new FileEvent(this, kind, file);
+
+ for(WeakReference<IFileSystemListener> listener : listeners)
+ listener.get().fileDeleted(event);
+ }
+ }
+
+ /**
+ * Fires the event.
+ *
+ * @param kind
+ * the event kind; not <code>null</code>
+ * @param file
+ * the modified file; not <code>null</code>
+ */
+ private void fireFileModified(FileEvent.Kind kind, File file) {
+
+ synchronized(listeners) {
+ FileEvent event = new FileEvent(this, kind, file);
+
+ for(WeakReference<IFileSystemListener> listener : listeners)
+ listener.get().fileModified(event);
+ }
+ }
+
+ /**
+ * Removes the specified {@link IFileSystemListener}.
+ *
+ * @param value
+ * the {@link IFileSystemListener}; not <code>null</code>
+ */
+ public void removeListener(IFileSystemListener value) {
+
+ synchronized(listeners) {
+ listeners.remove(value);
+ }
+ }
+
+ // EventReactions
+ @Override
+ public void onDirectoryChange(File file) {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void onDirectoryCreate(File file) {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void onDirectoryDelete(File file) {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void onFileChange(File file) {
+
+ fireFileModified(FileEvent.Kind.Modified, file);
+ }
+
+ @Override
+ public void onFileCreate(File file) {
+
+ fireFileCreated(FileEvent.Kind.Created, file);
+ }
+
+ @Override
+ public void onFileDelete(File file) {
+
+ fireFileDeleted(FileEvent.Kind.Deleted, file);
+ }
+
+ @Override
+ public void onStart(FileAlterationObserver fileAlterationObserver) {
+
+ /* NOOP */
+ }
+
+ @Override
+ public void onStop(FileAlterationObserver fileAlterationObserver) {
+
+ /* NOOP */
+ }
+
+ // Methods
+ /**
+ * Starts the file system watcher.
+ *
+ * @throws IOException
+ */
+ public void start() throws IOException {
+
+ try {
+ /* observer */
+ observer = new FileAlterationObserver(directoryToObserve.toFile());
+ observer.addListener(this);
+
+ /* monitor */
+ monitor = new FileAlterationMonitor(pollingInterval);
+ monitor.addObserver(observer);
+ monitor.start();
+ }
+ catch(Exception exception) {
+ throw new FileSystemWatcherIOException("Cannot s tart monitor!", exception);
+ }
+ }
+
+ /**
+ * Stops the file system watcher.
+ *
+ * @throws IOException
+ */
+ public void stop() throws IOException {
+
+ try {
+ monitor.removeObserver(observer);
+ observer.removeListener(this);
+
+ monitor.stop();
+
+ observer = null;
+ monitor = null;
+ }
+ catch(Exception exception) {
+ throw new FileSystemWatcherIOException("Cannot start monitor!", exception);
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcherIOException.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcherIOException.java
new file mode 100644
index 00000000..26c5131d
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/FileSystemWatcherIOException.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.io;
+
+import org.eclipse.openk.common.messaging.AbstractIOException;
+
+/**
+ * Gets thrown if problems in {@link FileSystemWatcher} occur.
+ *
+ * @author Michael Kotten
+ */
+public final class FileSystemWatcherIOException extends AbstractIOException {
+
+ // Constants
+ private static final long serialVersionUID = 1L;
+
+ // Constructors
+ /**
+ * @param text
+ * the text
+ * @param cause
+ * the causing inner exception, can be <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>text</code> is <code>null</code> or <code>""</code></li>
+ * </ul>
+ */
+ public FileSystemWatcherIOException(String text, Throwable cause) {
+
+ super(text, cause);
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IFileSystemListener.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IFileSystemListener.java
new file mode 100644
index 00000000..b5cab287
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IFileSystemListener.java
@@ -0,0 +1,35 @@
+package org.eclipse.openk.common.io;
+
+/**
+ * Defines the commonalities of all files system listeners.
+ *
+ * @author Felix Korb
+ * @author Renko Ortgies
+ */
+public interface IFileSystemListener {
+
+ // EventReactions
+ /**
+ * Is called when a new file is created.
+ *
+ * @param event
+ * the event; not <code>null</code>
+ */
+ void fileCreated(FileEvent event);
+
+ /**
+ * Is called when a file is deleted.
+ *
+ * @param event
+ * the event; not <code>null</code>
+ */
+ void fileDeleted(FileEvent event);
+
+ /**
+ * Is called when a file is modified.
+ *
+ * @param event
+ * the event; not <code>null</code>
+ */
+ void fileModified(FileEvent event);
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IIndentedWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IIndentedWriter.java
new file mode 100644
index 00000000..84efba09
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IIndentedWriter.java
@@ -0,0 +1,221 @@
+package org.eclipse.openk.common.io;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * Defines the commonalities of all indended writers.
+ * Indended writers enable the formated output.
+ *
+ * @author Felix Korb
+ */
+public interface IIndentedWriter extends Closeable {
+
+ // Methods
+ /**
+ * Increases the output another step higher.
+ *
+ * @see #setIndentation(String)
+ */
+ void indent();
+
+ /**
+ * Checks if the object is initialized.
+ *
+ * @return the result
+ */
+ boolean isInit();
+
+ /**
+ * Decreases the output another step back.
+ *
+ * @see #indent()
+ */
+ void outdent();
+
+ /**
+ * Writes the specified value into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void write(char value) throws IOException;
+
+ /**
+ * Writes the specified value into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void write(int value) throws IOException;
+
+ /**
+ * Writes the specified value into the output.
+ *
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ void write(String value) throws IOException;
+
+ /**
+ * Writes the specified value as 'block' into the output.
+ *
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeBlock(String value) throws IOException;
+
+ /**
+ * Writes the current indentation into the output.
+ *
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeIndentation() throws IOException;
+
+ /**
+ * Writes the specified value with indentation into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeIndented(char value) throws IOException;
+
+ /**
+ * Writes the specified value with indentation into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeIndented(int value) throws IOException;
+
+ /**
+ * Writes the specified value with indentation into the output.
+ *
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeIndented(String value) throws IOException;
+
+ /**
+ * Writes the specified value as indented line into the output.
+ *
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeIndentedLine(String value) throws IOException;
+
+ /**
+ * Writes an empty line into the output.
+ *
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeLine() throws IOException;
+
+ /**
+ * Writes the specified value as line into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeLine(char value) throws IOException;
+
+ /**
+ * Writes the specified value as line into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeLine(int value) throws IOException;
+
+ /**
+ * Writes the specified value as line into the output.
+ *
+ * @param value
+ * the value; can be <code>null</code> or <code>""</code>
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeLine(String value) throws IOException;
+
+ /**
+ * Writes the lines of the specified value as lines into the output.
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ void writeLines(String value) throws IOException;
+
+ // Properties
+ /**
+ * @return the indentation; can be <code>null</code> or <code>""</code>
+ */
+ String getIndentation();
+
+ /**
+ * @return the maximum number of columns
+ */
+ int getMaxColumns();
+
+ /**
+ * @return the line prefix; can be <code>null</code> or <code>""</code>
+ */
+ String getPrefix();
+
+ /**
+ * @return the writer; not <code>null</code>
+ */
+ Writer getWriter();
+
+ /**
+ * Sets the indentation.
+ *
+ * This is only possible until a <code>write</code>-method was called.
+ *
+ * @param value
+ * the indentation
+ */
+ void setIndentation(String value);
+
+ /**
+ * Sets the maximum number of columns.
+ *
+ * This is only possible until a <code>write</code>-method was called.
+ *
+ * @param value
+ * the maximum number of columns
+ */
+ void setMaxColumns(int value);
+
+ /**
+ * Sets the line prefix.
+ *
+ * @param value
+ * the line prefix; can be <code>null</code> or <code>""</code>
+ */
+ void setPrefix(String value);
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IODefaults.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IODefaults.java
new file mode 100644
index 00000000..57785fb9
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IODefaults.java
@@ -0,0 +1,31 @@
+package org.eclipse.openk.common.io;
+
+/**
+ * Provides some default values.
+ *
+ * @author Felix Korb
+ */
+public final class IODefaults {
+
+ // Constants
+ public static final int BIG_BUFFER_SIZE = 8096;
+ public static final int BUFFER_SIZE = 1024;
+ public static final String NEW_LINE = System.getProperty("line.separator");
+
+ /* charset names */
+ public static final String CHARSET_NAME_ISO_8859_1 = "ISO-8859-1";
+ public static final String CHARSET_NAME_US_ASCII = "US-ASCII";
+ public static final String CHARSET_NAME_UTF_8 = "UTF-8";
+ public static final String CHARSET_NAME_UTF_16 = "UTF-16";
+ public static final String CHARSET_NAME_UTF_16BE = "UTF-16BE";
+ public static final String CHARSET_NAME_UTF_16LE = "UTF-16LE";
+
+ /* default values */
+ public static final int DEFAULT_MAX_COLUMNS = 80;
+ public static final String DEFAULT_INDENTATION = " ";
+
+ // Constructors
+ private IODefaults() {
+ /* suppresses the instantiation! */
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IOUtilities.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IOUtilities.java
new file mode 100644
index 00000000..11ca6413
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IOUtilities.java
@@ -0,0 +1,161 @@
+package org.eclipse.openk.common.io;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.openk.common.messaging.messages.FailedToDeleteException;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * Provides static utility methods.
+ *
+ * @author Carsten Meyer
+ */
+public final class IOUtilities {
+
+ // Constructors
+ private IOUtilities() {
+ /* suppresses the instantiation! */
+ }
+
+ // Methods
+ /**
+ * Tries to delete the specified file.
+ *
+ * @param file
+ * the file; can be <code>null</code>
+ * @param maxTries
+ * the maximum number of tries
+ * @param delay
+ * the time in milliseconds between two tries
+ * @throws IOException
+ */
+ public static void deleteFile(File file, int maxTries, long delay) throws IOException {
+
+ if(file != null) {
+ int tries = 1;
+
+ do
+ try {
+ Files.delete(file.toPath());
+ break;
+ }
+ catch(IOException exception) {
+ tries++;
+
+ if(tries > maxTries)
+ throw new FailedToDeleteException(file.toString());
+
+ try {
+ Thread.sleep(delay);
+ }
+ catch(InterruptedException exception2) {
+ break;
+ }
+ }
+ while(tries < maxTries);
+ }
+ }
+
+ /**
+ * Tries to delete the specified files.
+ *
+ * @param files
+ * the files; can be <code>null</code>
+ * @param maxTries
+ * the maximum number of tries
+ * @param delay
+ * the time in milliseconds between two tries
+ * @throws IOException
+ */
+ public static void deleteFiles(List<File> files, int maxTries, long delay) throws IOException {
+
+ if((files != null) && !files.isEmpty())
+ for(File file : files)
+ deleteFile(file, maxTries, delay);
+ }
+
+ /**
+ * Returns the files within the specified path.<br/>
+ * The subdirectories are not included.
+ *
+ * @param path
+ * the path; can be <code>null</code>
+ * @param fileFilter
+ * pattern to filter files
+ * @return the files within the specified path; can be <code>null</code> or empty
+ */
+ public static List<File> getFiles(File path, Pattern fileFilter) {
+
+ List<File> result = null;
+
+ if((path != null) && path.isDirectory())
+ for(File file : path.listFiles()) {
+ if(file.isFile()) {
+ Matcher fileFilterMatcher = fileFilter.matcher(file.getName());
+
+ if(fileFilterMatcher.matches()) {
+ if(result == null)
+ result = new ArrayList<>();
+
+ result.add(file);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Parses the specified <i>XML</i> file.
+ *
+ * @param contentHandler
+ * the content handler for the <i>SAX</i>-parser
+ * @param file
+ * the <i>XML</i> file
+ * @param charsetName
+ * The name of a supported {@link java.nio.charset.Charset <code>charset</code>}
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>contentHandler</code> is <code>null</code></li>
+ * <li><code>file</code> is <code>null</code></li>
+ * <li><code>charsetName</code> is an invalid <code>String</code> (<code>null</code> or <code>""</code>)</li>
+ * </ul>
+ * @throws IOException
+ * {@link IOException}
+ */
+ public static void parse(ContentHandler contentHandler, File file, String charsetName) throws IOException {
+
+ if((contentHandler == null) || (file == null))
+ if(contentHandler == null)
+ throw new IllegalArgumentException("contentHandler", new NullPointerException());
+ else
+ throw new IllegalArgumentException("file", new NullPointerException());
+ else {
+ try(FileInputStream fileInputStream = new FileInputStream(file); InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, charsetName); Reader tempReader = new BufferedReader(inputStreamReader)) {
+ InputSource inputSource = new InputSource(inputStreamReader);
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+
+ xmlReader.setContentHandler(contentHandler);
+ xmlReader.parse(inputSource);
+ }
+ catch(SAXException exception) {
+ throw new IOException(exception);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IndentedWriter.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IndentedWriter.java
new file mode 100644
index 00000000..3a0d765f
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/io/IndentedWriter.java
@@ -0,0 +1,340 @@
+package org.eclipse.openk.common.io;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.Writer;
+
+import org.eclipse.openk.common.string.StringDefaults;
+import org.eclipse.openk.common.string.StringUtilities;
+
+/**
+ * The standard implementation of an indented writer.
+ *
+ * @author Felix Korb
+ */
+public class IndentedWriter implements IIndentedWriter {
+
+ // Attributes
+ private int columns;
+ private String indentation;
+ private int indentLevel;
+ private boolean isInit;
+ private int maxColumns;
+ private String prefix;
+ private Writer writer;
+
+ // Constructors
+ /**
+ * @param writer
+ * the writer
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>writer</code> is <code>null</code></li>
+ * </ul>
+ */
+ public IndentedWriter(Writer writer) {
+ if(writer == null)
+ throw new IllegalArgumentException("writer");
+ else {
+ this.columns = 0;
+ this.indentation = IODefaults.DEFAULT_INDENTATION;
+ this.indentLevel = 0;
+ this.isInit = false;
+ this.maxColumns = Integer.MAX_VALUE;
+ this.prefix = null;
+ this.writer = writer;
+ }
+ }
+
+ // Methods
+ @Override
+ public void close() throws IOException {
+
+ ensureInit();
+ writer.close();
+ }
+
+ /**
+ * Ensures the initialization.
+ */
+ private void ensureInit() {
+
+ if(!isInit)
+ isInit = true;
+ }
+
+ @Override
+ public final void indent() {
+
+ ensureInit();
+ indentLevel++;
+ }
+
+ @Override
+ public boolean isInit() {
+
+ return isInit;
+ }
+
+ @Override
+ public final void outdent() {
+
+ ensureInit();
+ indentLevel = Math.max(0, indentLevel - 1);
+ }
+
+ @Override
+ public final void write(char value) throws IOException {
+
+ write(Character.toString(value));
+ }
+
+ @Override
+ public final void write(int value) throws IOException {
+
+ write(Integer.toString(value));
+ }
+
+ @Override
+ public final void write(String value) throws IOException {
+
+ ensureInit();
+ writeExpress(value);
+ }
+
+ @Override
+ public final void writeBlock(String value) throws IOException {
+
+ ensureInit();
+ writeBlockExpress(value);
+ }
+
+ /**
+ * Writes the specified value as 'block' into the output.<br/>
+ * (express methods skip the parameter-check!)
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ private void writeBlockExpress(String value) throws IOException {
+
+ writer.write(value);
+ columns += value.length();
+ }
+
+ /**
+ * Writes the specified value into the output.<br/>
+ * (express methods skip the parameter-check!)
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ private void writeExpress(String value) throws IOException {
+
+ if(columns > maxColumns) {
+ writeLineExpress();
+ writeIndentedExpress(indentation);
+ }
+
+ writeBlockExpress(value);
+ }
+
+ @Override
+ public final void writeIndentation() throws IOException {
+
+ ensureInit();
+ writeIndentationExpress();
+ }
+
+ /**
+ * Writes the current indentation into the output.<br/>
+ * (express methods skip the parameter-check!)
+ *
+ * @throws IOException
+ * {@link IOException}
+ */
+ private void writeIndentationExpress() throws IOException {
+
+ for(int i = 0; i < indentLevel; ++i)
+ writer.write(indentation);
+
+ if(StringUtilities.hasContent(prefix))
+ writer.write(prefix);
+ }
+
+ @Override
+ public final void writeIndented(char value) throws IOException {
+
+ writeIndented(Character.toString(value));
+ }
+
+ @Override
+ public final void writeIndented(int value) throws IOException {
+
+ writeIndented(Integer.toString(value));
+ }
+
+ @Override
+ public final void writeIndented(String value) throws IOException {
+
+ ensureInit();
+ writeIndentedExpress(value);
+ }
+
+ /**
+ * Writes the specified value with indentation into the output.<br/>
+ * (express methods skip the parameter-check!)
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ private void writeIndentedExpress(String value) throws IOException {
+
+ writeIndentationExpress();
+ writeExpress(value);
+ }
+
+ @Override
+ public final void writeIndentedLine(String value) throws IOException {
+
+ ensureInit();
+
+ writeIndentationExpress();
+ writeLineExpress(value);
+ }
+
+ @Override
+ public final void writeLine() throws IOException {
+
+ ensureInit();
+ writeLineExpress(StringDefaults.EMPTY_STRING);
+ }
+
+ @Override
+ public final void writeLine(char value) throws IOException {
+
+ writeLine(Character.toString(value));
+ }
+
+ @Override
+ public final void writeLine(int value) throws IOException {
+
+ writeLine(Integer.toString(value));
+ }
+
+ @Override
+ public final void writeLine(String value) throws IOException {
+
+ ensureInit();
+ writeLineExpress(value);
+ }
+
+ /**
+ * Writes an empty line into the output.<br/>
+ * (express methods skip the parameter-check!)
+ *
+ * @throws IOException
+ * {@link IOException}
+ */
+ private void writeLineExpress() throws IOException {
+
+ writeLineExpress(StringDefaults.EMPTY_STRING);
+ }
+
+ /**
+ * Writes the specified value as line into the output.<br/>
+ * (express methods skip the parameter-check!)
+ *
+ * @param value
+ * the value
+ * @throws IOException
+ * {@link IOException}
+ */
+ private void writeLineExpress(String value) throws IOException {
+
+ writer.write(value);
+ writer.write(IODefaults.NEW_LINE);
+ columns = 0;
+ }
+
+ @Override
+ public final void writeLines(String value) throws IOException {
+
+ BufferedReader tempBufferedReader = new BufferedReader(new StringReader(value));
+ String tempLine;
+
+ ensureInit();
+
+ while((tempLine = tempBufferedReader.readLine()) != null) {
+ if(tempLine.trim().length() > 0)
+ writeIndentedLine(tempLine);
+ else
+ writeLine();
+ }
+ }
+
+ // Properties
+ @Override
+ public final String getIndentation() {
+
+ return indentation;
+ }
+
+ @Override
+ public final int getMaxColumns() {
+
+ return maxColumns;
+ }
+
+ @Override
+ public final String getPrefix() {
+
+ return prefix;
+ }
+
+ @Override
+ public final Writer getWriter() {
+
+ return writer;
+ }
+
+ @Override
+ public final void setIndentation(String value) {
+
+ if(isInit())
+ throw new UnsupportedOperationException("This instance is already initialized!");
+ else {
+ if(!StringUtilities.hasContent(value))
+ throw new IllegalArgumentException("value");
+ else
+ indentation = value;
+ }
+ }
+
+ @Override
+ public final void setMaxColumns(int value) {
+
+ if(isInit())
+ throw new UnsupportedOperationException("This instance is already initialized!");
+ else {
+ if(value < 1)
+ throw new IllegalArgumentException("value");
+ else
+ maxColumns = value;
+ }
+ }
+
+ @Override
+ public final void setPrefix(String value) {
+
+ prefix = value;
+ }
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/IKeyOwner.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/IKeyOwner.java
new file mode 100644
index 00000000..dfed8d08
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/IKeyOwner.java
@@ -0,0 +1,26 @@
+package org.eclipse.openk.common.key;
+
+/**
+ * Defines the commonalities of all key owners.
+ *
+ * @author Felix Korb
+ *
+ * @param <K>
+ * the key type
+ */
+public interface IKeyOwner<K extends Comparable<?>> {
+
+ // Methods
+ /**
+ * Checks, if the key is set.
+ *
+ * @return the result
+ */
+ boolean hasKey();
+
+ // Properties
+ /**
+ * @return the key; can be <code>null</code>
+ */
+ K getKey();
+} \ No newline at end of file
diff --git a/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/IUniqueIdProvider.java b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/IUniqueIdProvider.java
new file mode 100644
index 00000000..5e0c4de4
--- /dev/null
+++ b/cim-cache/org.eclipse.openk.common/src/main/java/org/eclipse/openk/common/key/sourcesystem/IUniqueIdProvider.java
@@ -0,0 +1,123 @@
+package org.eclipse.openk.common.key.sourcesystem;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * Defines the commonalities of all services, that provide or create unique identifiers.
+ *
+ * @author Felix Korb
+ * @author Inge Seidel
+ * @author Michael Korta
+ */
+public interface IUniqueIdProvider {
+
+ // Methods
+ /**
+ * Creates the unique identifier using the specified {@link Key}.
+ *
+ * @param key
+ * the {@link Key}
+ * @return the unique identifier; not <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ * <ul>
+ * <li><code>key</code> is <code>null</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ UUID getUniqueId(Key key) throws IOException;
+
+ /**
+ * Creates the unique identifier using the specified parameters.
+ *
+ * @param keyType
+ * the key type
+ * @param keyValue
+ * the key value
+ * @return the unique identifier; not <code>null</code>
+ * @throws IllegalArgumentException
+ * Is thrown in the following cases:
+ *