Initial commit
authorjani <jani@asema.com>
Thu, 4 Oct 2018 12:00:40 +0000 (15:00 +0300)
committerjani <jani@asema.com>
Thu, 4 Oct 2018 12:00:40 +0000 (15:00 +0300)
851 files changed:
.gitignore [new file with mode: 0644]
Common/C#/SmartAPI/.gitignore [new file with mode: 0644]
Common/C#/SmartAPI/INSTALL.txt [new file with mode: 0644]
Common/C#/SmartAPI/Properties/AssemblyInfo.cs [new file with mode: 0644]
Common/C#/SmartAPI/SmartAPI.csproj [new file with mode: 0644]
Common/C#/SmartAPI/SmartAPI.nuspec [new file with mode: 0644]
Common/C#/SmartAPI/SmartAPI.sln [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/App.config [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/Program.cs [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/Properties/AssemblyInfo.cs [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/UnitTester.csproj [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/packages.config [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/testkey_private.pem [new file with mode: 0644]
Common/C#/SmartAPI/UnitTester/testkey_public.pem [new file with mode: 0644]
Common/C#/SmartAPI/agents/Agent.cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/EventAgent.cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/RegistrationAgent.cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/ResponseCallback.cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/SearchAgent .cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/SharingAgent.cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/TradingAgent.cs [new file with mode: 0644]
Common/C#/SmartAPI/agents/TransactionAgent.cs [new file with mode: 0644]
Common/C#/SmartAPI/app.config [new file with mode: 0644]
Common/C#/SmartAPI/common/ACTIVITIES.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/Bictionary.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/ClassMapper.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/ConceptDetails.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/DATATYPE.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/HttpClient.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/HttpMessage.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/MqttClientWrapper.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/NS.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/PROPERTY.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/RESOURCE.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/SERIALIZATION.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/SmartAPICrypto.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/Tools.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/URLs.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/UnitConverter.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/UnitDetails.cs [new file with mode: 0644]
Common/C#/SmartAPI/common/VARIANT.cs [new file with mode: 0644]
Common/C#/SmartAPI/exceptions/InsufficientDataException.cs [new file with mode: 0644]
Common/C#/SmartAPI/factory/CommandFactory.cs [new file with mode: 0644]
Common/C#/SmartAPI/factory/Factory.cs [new file with mode: 0644]
Common/C#/SmartAPI/factory/ModelFactory.cs [new file with mode: 0644]
Common/C#/SmartAPI/factory/NotificationFactory.cs [new file with mode: 0644]
Common/C#/SmartAPI/factory/RequestFactory.cs [new file with mode: 0644]
Common/C#/SmartAPI/factory/ResponseFactory.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Ability.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/AbstractEntity.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Account.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/AccountAction.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/AccountTransaction.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Activity.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Address.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Availability.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Capacity.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Condition.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Contract.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Controllability.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Coordinates.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Device.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Direction.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Entity.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Enumeration.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Error.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Evaluation.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/GrObj.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Grading.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Input.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/InterfaceAddress.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Map.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Message.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Notification.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Obj.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/ObjectInterface.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Offering.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Organization.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Orientation.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Output.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Parameter.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Person.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/PhysicalEntity.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/PriceSpecification.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Provenance.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Request.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Response.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Restriction.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Ring.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Route.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Service.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/ServiceProvider.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Size.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/SomeItems.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Status.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/SubscriptionPriceSpecification.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/SystemOfInterest.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/TemporalContext.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/TimeSeries.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Transaction.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/TypeAndQuantityNode.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/UnitPriceSpecification.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/ValueObject.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Velocity.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Waypoint.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Waypoints.cs [new file with mode: 0644]
Common/C#/SmartAPI/model/Zone.cs [new file with mode: 0644]
Common/C#/SmartAPI/packages.config [new file with mode: 0644]
Common/C#/SmartAPI/rdf/GraphItem.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/ItemizedList.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/LinkedList.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/Literal.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/Model.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/NudeList.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/OrderedList.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/Property.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/RDFList.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/RDFNode.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/Resource.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/SmartAPIList.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/Statement.cs [new file with mode: 0644]
Common/C#/SmartAPI/rdf/Variant.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/AccountTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ActivityTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/CapacityChangeCommandTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/CapacityChangeNotificationTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ChargePlanTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/CryptoKeyTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/DataFetchTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/EncryptionTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/GoodRelationsSerializeParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ListOfMapsTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ListSerializeParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/MultipartTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/OptimizerRegistrationTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ParseFileTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/PropertyMapTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/RegistrationTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/RegistrySearchTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/RequestSerializeParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/ResponseRequestTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/RouteSerializeParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/SerializeParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/SerializeTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/SharingTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/SigningTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/SimpleSerializeTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/SizeSerializeParseTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/TimeSeriesTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/TradingAgentTest.cs [new file with mode: 0644]
Common/C#/SmartAPI/tests/TransactionAgentTest .cs [new file with mode: 0644]
Common/C++/SmartAPI/.gitignore [new file with mode: 0644]
Common/C++/SmartAPI/build.sh [new file with mode: 0755]
Common/C++/SmartAPI/debug.sh [new file with mode: 0755]
Common/C++/SmartAPI/graphmemorytests.sh [new file with mode: 0755]
Common/C++/SmartAPI/install.sh [new file with mode: 0755]
Common/C++/SmartAPI/install_mingw.sh [new file with mode: 0644]
Common/C++/SmartAPI/memorytesttests.sh [new file with mode: 0755]
Common/C++/SmartAPI/runagenttests.sh [new file with mode: 0755]
Common/C++/SmartAPI/rungraphtests.sh [new file with mode: 0755]
Common/C++/SmartAPI/runplugintests.sh [new file with mode: 0755]
Common/C++/SmartAPI/runtests.sh [new file with mode: 0755]
Common/C++/SmartAPI/smartapi.pro [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/Agent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/Agent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/EventAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/EventAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/OAuthAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/OAuthAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/RegistrationAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/RegistrationAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/SearchAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/SearchAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/SharingAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/SharingAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/TradingAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/TradingAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/TransactionAgent.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/agents/TransactionAgent.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/ACTIVITIES.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/CONTENTTYPES.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/ClassMapper.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/CurrencyConverter.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/CurrencyConverter.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/CurrencyConverterFixerIO.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/CurrencyConverterFixerIO.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/DATATYPE.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/Duration.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/Duration.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/HttpMessage.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/HttpMessage.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/NS.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/NS.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/ObjectPrinter.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/ObjectPrinter.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/OntologyCache.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/OntologyCache.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/PROPERTY.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/RESOURCE.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/SERIALIZATION.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/STATUSCODE.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/STATUSCODE.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/SmartAPICrypto.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/SmartAPICrypto.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/Tools.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/Tools.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/URLs.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/UnitConverter.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/UnitConverter.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/common/VARIANT.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/exceptions/ArgumentNullException.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/exceptions/IllegalCountryCodeException.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/exceptions/InsufficientDataException.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/exceptions/InvalidDataException.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/exceptions/NotFoundException.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/exceptions/VerifyException.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/ActivityFactory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/ActivityFactory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/Factory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/Factory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/ModelFactory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/ModelFactory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/NotificationFactory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/NotificationFactory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/RequestFactory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/RequestFactory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/ResponseFactory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/ResponseFactory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/TransactionFactory.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/factory/TransactionFactory.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Ability.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Ability.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/AbstractEntity.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/AbstractEntity.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Account.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Account.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/AccountAction.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/AccountAction.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/AccountTransaction.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/AccountTransaction.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Activity.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Activity.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Address.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Address.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Authorization.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Authorization.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Availability.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Availability.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Calculable.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/CalculationMethod.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/CalculationMethod.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Capacity.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Capacity.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Condition.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Condition.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Contract.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Contract.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Controllability.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Controllability.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Coordinates.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Coordinates.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Device.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Device.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Direction.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Direction.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DistanceDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DistanceDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DurationAtDistanceDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DurationAtDistanceDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DurationAtZoneDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DurationAtZoneDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DurationDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/DurationDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Entity.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Entity.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Enumeration.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Enumeration.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Error.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Error.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Evaluation.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Evaluation.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/GrObj.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/GrObj.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Grading.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Grading.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/HeartBeat.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/HeartBeat.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Input.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Input.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/InterfaceAddress.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/InterfaceAddress.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/License.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/License.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/LinearCalculation.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/LinearCalculation.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Map.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Map.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Message.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Message.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Notification.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Notification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Obj.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Obj.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Obj.tcc [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ObjectOperationDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ObjectOperationDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Offering.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Offering.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Organization.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Organization.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Orientation.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Orientation.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Output.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Output.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Parameter.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Parameter.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Person.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Person.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/PhysicalEntity.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/PhysicalEntity.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/PriceListSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/PriceListSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/PriceSpecification.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/PriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/PropertyDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/PropertyDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Provenance.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Provenance.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Request.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Request.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Response.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Response.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Restriction.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Restriction.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Ring.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Ring.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Route.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Route.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Service.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Service.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ServiceProvider.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/ServiceProvider.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Size.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Size.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/SomeItems.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/SomeItems.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Status.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Status.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/SubscriptionPriceSpecification.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/SubscriptionPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/SystemOfInterest.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/SystemOfInterest.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TemporalContext.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/TemporalContext.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TimeDependentPriceListSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TimeDependentPriceListSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TimeDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TimeDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TimeSeries.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/TimeSeries.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Transaction.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Transaction.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TravelDistanceDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TravelDistanceDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TravelDistanceDurationDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TravelDistanceDurationDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TypeAndQuantityNode.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/TypeAndQuantityNode.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/UnitPriceSpecification.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/UnitPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ValueObject.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/ValueObject.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Velocity.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Velocity.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Waypoint.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Waypoint.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Waypoints.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Waypoints.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/Zone.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/model/Zone.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZoneDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZoneDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZoneTravelDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZoneTravelDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZoneTravelDurationDependentPriceSpecification.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/model/ZoneTravelDurationDependentPriceSpecification.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/GraphItem.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/rdf/GraphItem.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/ItemizedList.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/ItemizedList.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/LinkedList.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/LinkedList.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/List.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/List.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Literal.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Literal.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Model.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Model.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/NudeList.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/NudeList.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/OrderedList.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/OrderedList.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Property.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Property.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/PropertyList.cpp [new file with mode: 0755]
Common/C++/SmartAPI/smartapi/rdf/PropertyList.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/PropertyList.tcc [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/PropertyListItem.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/RDFNode.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/RDFNode.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Resource.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Resource.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Resource.tcc [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Statement.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Statement.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Variant.cpp [new file with mode: 0644]
Common/C++/SmartAPI/smartapi/rdf/Variant.h [new file with mode: 0644]
Common/C++/SmartAPI/smartapiagenttests.pro [new file with mode: 0644]
Common/C++/SmartAPI/smartapigraphtests.pro [new file with mode: 0644]
Common/C++/SmartAPI/smartapipahomqtt.pro [new file with mode: 0644]
Common/C++/SmartAPI/smartapiplugin.pro [new file with mode: 0644]
Common/C++/SmartAPI/smartapiplugintests.pro [new file with mode: 0644]
Common/C++/SmartAPI/smartapitests.pro [new file with mode: 0644]
Common/C++/SmartAPI/tests/AgentTests.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/AgentTests.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/GraphTests.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/ParseTest.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/PluginInstance.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/PluginInstance.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/PluginTests.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/RegisterDeregistertest.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/RegisterSearchTest.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/SerializeTest.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestActivity.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestError.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestEvaluation.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestInput.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestInterfaceAddress.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestMap.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestMessage.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestObj.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestOutput.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestProvenance.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestRequest.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestSequences.cpp [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestStatus.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestSystemOfInterest.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestTemporalContext.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestTimeSeries.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/TestValueObject.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/plugin.h [new file with mode: 0644]
Common/C++/SmartAPI/tests/testvalues.h [new file with mode: 0644]
Common/Java/SmartAPI/.gitignore [new file with mode: 0644]
Common/Java/SmartAPI/README [new file with mode: 0644]
Common/Java/SmartAPI/build.sh [new file with mode: 0755]
Common/Java/SmartAPI/build.xml [new file with mode: 0644]
Common/Java/SmartAPI/docs/for-maven-user.txt [new file with mode: 0644]
Common/Java/SmartAPI/pom.xml [new file with mode: 0644]
Common/Java/SmartAPI/privKey.pem [new file with mode: 0644]
Common/Java/SmartAPI/runtests.sh [new file with mode: 0755]
Common/Java/SmartAPI/src/smartapi/agents/EventAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/EventCallback.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/OAuthAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/OntologyAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/RegistrationAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/ResponseCallback.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/SearchAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/SharingAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/TradingAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/agents/TransactionAgent.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/ACTIVITIES.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/Auth.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/COUNTRY.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/ClassMapper.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/ConceptDetails.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/ConceptValidator.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/Crypto.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/CryptoKeyWallet.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/CurrencyConverter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/DATATYPE.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/DateUtils.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/ExecutionMode.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/GeoUtils.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/HttpClient.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/HttpMessage.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/MessagePart.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/NS.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/ObjectPrinter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/OntologyUpdateMode.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/PROPERTY.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/RESOURCE.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/SERIALIZATION.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/STATUSCODE.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/SmartAPI.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/TimeUtils.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/Tools.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/URLs.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/UnitDetails.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/common/VARIANT.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/AccessDeniedException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/AccessRestrictedException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/DecryptionException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/IllegalCountryCodeException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/InsufficientDataException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/InvalidDataException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/KeyAlreadyExistsOnServerException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/NotAuthenticatedException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/NotPaidException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/ParseException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/UploadException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/exceptions/VerifyException.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/factory/Factory.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Ability.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/AbstractEntity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Account.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/AccountAction.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/AccountTransaction.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Activity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Address.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Availability.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Calculable.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/CalculationMethod.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Capacity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Condition.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Contract.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Controllability.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Coordinates.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/DependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Device.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Direction.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/DistanceDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/DurationAtDistanceDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/DurationAtZoneDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/DurationDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Entity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Enumeration.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Error.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Evaluation.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/GrObj.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Grading.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Heartbeat.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Input.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/InterfaceAddress.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/License.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/LinearCalculation.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Map.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Message.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Notification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Nudeable.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Obj.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ObjectInterface.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ObjectOperationDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Offering.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Organization.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Orientation.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Output.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Parameter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Person.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/PhysicalEntity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/PriceListSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/PriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/PropertyDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Provenance.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Reference.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Request.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Response.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Restriction.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Ring.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Route.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Service.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ServiceProvider.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Size.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/SomeItems.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Status.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/SubscriptionPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/SystemOfInterest.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TemporalContext.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TimeDependentPriceListSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TimeDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TimeSeries.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Transaction.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TravelDistanceDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TravelDistanceDurationDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/TypeAndQuantityNode.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/UnitPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ValueObject.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Velocity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Waypoint.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Waypoints.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/Zone.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ZoneDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ZoneTravelDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/model/ZoneTravelDurationDependentPriceSpecification.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/rdf/ItemizedList.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/rdf/LinkedList.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/rdf/List.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/rdf/NudeList.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/rdf/OrderedList.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/rdf/Variant.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/reasoner/CurrencyConverterInterface.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/reasoner/FixerIOCurrencyConverter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/reasoner/UnitConverter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/EntityHierarchyPrinter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/GraphTests.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/QuickSample.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestActivity.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestConverter.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestCrypto.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestError.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestEvaluation.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestInput.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestInterfaceAddress.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestMap.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestMessage.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestObj.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestOutput.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestProvenance.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestRegistrationServer.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestRequest.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestSequence.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestSharing.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestSigning.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestSimpleRW.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestSomeItems.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestStatus.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestSystemOfInterest.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestTemporalContext.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestTimeSeries.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TestValueObject.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/TransactionAgentSample.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/VALUE.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/checksumTest.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/testOrientdb.java [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/testkey_private.pem [new file with mode: 0644]
Common/Java/SmartAPI/src/smartapi/tests/testkey_public.pem [new file with mode: 0644]
Common/Java/modeldocumentor/.gitignore [new file with mode: 0644]
Common/Java/modeldocumentor/build.sh [new file with mode: 0755]
Common/Java/modeldocumentor/build.xml [new file with mode: 0644]
Common/Java/modeldocumentor/run.sh [new file with mode: 0755]
Common/Java/modeldocumentor/src/modeldocumentor/SeasModelWriter.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/UpdateAllDocuments.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/errors/InvalidParams.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/errors/InvalidRequest.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/errors/ParseError.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/errors/ServerError.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/objects/LocationDocument.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/objects/MapDocument.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/objects/TemporalContextDateDocument.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/objects/TemporalContextTimeDocument.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/objects/TimeSeriesDocument.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/DeviceActuatorClosed.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/DeviceActuatorOpen.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/DeviceAvailability.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/DeviceSensorClosed.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/DeviceSensorOpen.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/ServiceAvailability.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/ServiceClosed.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/ServiceOpen.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/ServiceProviderAndService.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/registration/ServiceProviderDocument.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/servicerequest/ServiceRequestDataInput.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/servicerequest/ServiceRequestReferenceInput.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/servicerequest/ServiceRequestTimeserie.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/servicerequest/ServiceRequestTimeserieMultiParameters.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/servicerequest/ServiceRequestTimeserieOneParameter.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/serviceresponse/ServiceResponseTimeserieMultiParameters.java [new file with mode: 0644]
Common/Java/modeldocumentor/src/modeldocumentor/serviceresponse/ServiceResponseTimeserieOneParameter.java [new file with mode: 0644]
Common/Python/INSTALL.txt [new file with mode: 0644]
Common/Python/SmartAPI/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/agents/Agent.py [new file with mode: 0755]
Common/Python/SmartAPI/agents/EventAgent.py [new file with mode: 0755]
Common/Python/SmartAPI/agents/OntologyAgent.py [new file with mode: 0644]
Common/Python/SmartAPI/agents/RegistrationAgent.py [new file with mode: 0755]
Common/Python/SmartAPI/agents/ResponseCallback.py [new file with mode: 0644]
Common/Python/SmartAPI/agents/SearchAgent.py [new file with mode: 0755]
Common/Python/SmartAPI/agents/SharingAgent.py [new file with mode: 0755]
Common/Python/SmartAPI/agents/TradingAgent.py [new file with mode: 0644]
Common/Python/SmartAPI/agents/TransactionAgent.py [new file with mode: 0644]
Common/Python/SmartAPI/agents/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/common/ACTIVITIES.py [new file with mode: 0644]
Common/Python/SmartAPI/common/Auth.py [new file with mode: 0644]
Common/Python/SmartAPI/common/CONTENTTYPES.py [new file with mode: 0644]
Common/Python/SmartAPI/common/COUNTRY.py [new file with mode: 0644]
Common/Python/SmartAPI/common/ClassMapper.py [new file with mode: 0644]
Common/Python/SmartAPI/common/ConceptValidator.py [new file with mode: 0644]
Common/Python/SmartAPI/common/CryptoKeyWallet.py [new file with mode: 0644]
Common/Python/SmartAPI/common/DATATYPE.py [new file with mode: 0644]
Common/Python/SmartAPI/common/FixerIOCurrencyConverter.py [new file with mode: 0644]
Common/Python/SmartAPI/common/HttpClient.py [new file with mode: 0644]
Common/Python/SmartAPI/common/HttpMessage.py [new file with mode: 0644]
Common/Python/SmartAPI/common/NS.py [new file with mode: 0644]
Common/Python/SmartAPI/common/PROPERTY.py [new file with mode: 0644]
Common/Python/SmartAPI/common/RESOURCE.py [new file with mode: 0644]
Common/Python/SmartAPI/common/SERIALIZATION.py [new file with mode: 0644]
Common/Python/SmartAPI/common/STATUSCODE.py [new file with mode: 0644]
Common/Python/SmartAPI/common/SmartAPICrypto.py [new file with mode: 0644]
Common/Python/SmartAPI/common/Tools.py [new file with mode: 0644]
Common/Python/SmartAPI/common/URLs.py [new file with mode: 0644]
Common/Python/SmartAPI/common/UnitConverter.py [new file with mode: 0644]
Common/Python/SmartAPI/common/VARIANT.py [new file with mode: 0644]
Common/Python/SmartAPI/common/ValidationMode.py [new file with mode: 0644]
Common/Python/SmartAPI/common/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/factory/CommandFactory.py [new file with mode: 0644]
Common/Python/SmartAPI/factory/Factory.py [new file with mode: 0644]
Common/Python/SmartAPI/factory/NotificationFactory.py [new file with mode: 0644]
Common/Python/SmartAPI/factory/RequestFactory.py [new file with mode: 0644]
Common/Python/SmartAPI/factory/ResponseFactory.py [new file with mode: 0644]
Common/Python/SmartAPI/factory/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Ability.py [new file with mode: 0644]
Common/Python/SmartAPI/model/AbstractEntity.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Account.py [new file with mode: 0644]
Common/Python/SmartAPI/model/AccountAction.py [new file with mode: 0644]
Common/Python/SmartAPI/model/AccountTransaction.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Activity.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Address.py [new file with mode: 0644]
Common/Python/SmartAPI/model/AliveRequest.py [new file with mode: 0644]
Common/Python/SmartAPI/model/AliveResponse.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Availability.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Capacity.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Condition.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Contract.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Controllability.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Coordinates.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Device.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Direction.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Entity.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Enumeration.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Error.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Evaluation.py [new file with mode: 0644]
Common/Python/SmartAPI/model/GrObj.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Grading.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Input.py [new file with mode: 0644]
Common/Python/SmartAPI/model/InterfaceAddress.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Map.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Message.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Notification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Obj.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Offering.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Organization.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Orientation.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Output.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Parameter.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Person.py [new file with mode: 0644]
Common/Python/SmartAPI/model/PhysicalEntity.py [new file with mode: 0644]
Common/Python/SmartAPI/model/PriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Provenance.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Reference.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Request.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Response.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Ring.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Route.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Service.py [new file with mode: 0644]
Common/Python/SmartAPI/model/ServiceProvider.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Size.py [new file with mode: 0644]
Common/Python/SmartAPI/model/SomeItems.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Status.py [new file with mode: 0644]
Common/Python/SmartAPI/model/SystemOfInterest.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TemporalContext.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TimeSeries.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Transaction.py [new file with mode: 0644]
Common/Python/SmartAPI/model/TypeAndQuantityNode.py [new file with mode: 0644]
Common/Python/SmartAPI/model/UnitPriceSpecification.py [new file with mode: 0644]
Common/Python/SmartAPI/model/ValueObject.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Velocity.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Waypoint.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Waypoints.py [new file with mode: 0644]
Common/Python/SmartAPI/model/Zone.py [new file with mode: 0644]
Common/Python/SmartAPI/model/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/ItemizedList.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/LinkedList.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/List.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/Model.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/NudeList.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/OrderedList.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/Property.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/RdfLiteral.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/Resource.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/Statement.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/Variant.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/rdf/types.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/IllegalCountryCodeException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/InsufficientDataException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/InvalidDataException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/KeyAlreadyExistsOnServerException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/NonePointerException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/NotAuthorizedException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/NotFoundException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/NotPaidException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/ParseSucceededException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/RevokeException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/UploadException.py [new file with mode: 0644]
Common/Python/SmartAPI/smartapiexceptions/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/AgentTests.py [new file with mode: 0755]
Common/Python/SmartAPI/tests/GraphTests.py [new file with mode: 0755]
Common/Python/SmartAPI/tests/Samples.py [new file with mode: 0755]
Common/Python/SmartAPI/tests/SolarPanelClient.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestActivity.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestError.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestEvaluation.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestInput.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestInterfaceAddress.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestMap.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestMessage.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestObj.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestOutput.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestProvenance.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestRegistrationAgent.py [new file with mode: 0755]
Common/Python/SmartAPI/tests/TestRegistrationSearch.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestRequest.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestSequences.py [new file with mode: 0755]
Common/Python/SmartAPI/tests/TestStatus.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestSystemOfInterest.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestTemporalContext.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestTimeSeries.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestTradingAgent.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/TestValueObject.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/UnitConversionTest.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/__init__.py [new file with mode: 0644]
Common/Python/SmartAPI/tests/testkey_private.pem [new file with mode: 0644]
Common/Python/SmartAPI/tests/testkey_public.pem [new file with mode: 0644]
Common/Python/SmartAPI/tests/testvalues.py [new file with mode: 0644]
Common/Python/setup.py [new file with mode: 0644]
Examples/C++/EventAgentSample/EventAgentSample.h [new file with mode: 0644]
Examples/C++/EventAgentSample/EventAgentSample.pro [new file with mode: 0644]
Examples/C++/HelloSmart/HelloSmart.cpp [new file with mode: 0644]
Examples/C++/HelloSmart/HelloSmart.pro [new file with mode: 0644]
Examples/C++/QuickStartSample/QuickStartSample.h [new file with mode: 0644]
Examples/C++/QuickStartSample/QuickStartSample.pro [new file with mode: 0644]
Examples/C++/TransactionAgentSample/TransactionAgentSample.h [new file with mode: 0644]
Examples/Java/ExtendingModel/src/acme/Tester.java [new file with mode: 0644]
Examples/Java/HelloSmart/src/HelloSmart.java [new file with mode: 0644]
Examples/Java/TransactionSigning/build.xml [new file with mode: 0644]
Examples/Java/TransactionSigning/run.sh [new file with mode: 0755]
Examples/Python/HelloSmart/HelloSmart.py [new file with mode: 0644]
Examples/Python/QuickStartSample/QuickStartSample.py [new file with mode: 0644]
LICENSE [new file with mode: 0644]
Ontology/src/1.0/CommonStructureOntology-1.0.ttl [new file with mode: 0644]
Ontology/src/EnergyOntology-0.9.ttl [new file with mode: 0644]
README [new file with mode: 0644]
TestServers/C#/ControlCommandResponder/ControlCommandResponder/Controllers/AccessController.cs [new file with mode: 0644]
Utilities/ClassGenerator.py [new file with mode: 0755]
Utilities/RDFTranslator/.gitignore [new file with mode: 0644]
Utilities/RDFTranslator/build.xml [new file with mode: 0644]
Utilities/RDFTranslator/run_cmdline.sh [new file with mode: 0755]
Utilities/RDFTranslator/run_piped.sh [new file with mode: 0755]
Utilities/RDFTranslator/src/rdftranslator/PipeTranslator.java [new file with mode: 0644]
Utilities/RDFTranslator/src/rdftranslator/SocketTranslator.java [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ed6f4b2
--- /dev/null
@@ -0,0 +1,134 @@
+.project
+.pydevproject
+*.war
+*.jar
+!javalib/*.jar
+*.dll
+*.log
+*.old
+*.tmp
+*.swp
+*.pyc
+*.exe
+*.pdb
+*.suo
+*.class
+*.stash
+.classpath
+.gitattributes
+.settings
+smartapi.jar
+Common/Java/SeasObjects/.settings/*
+_profiled_content.xml
+Docs/rendered/*
+!Docs/rendered/retain_this_directory_needed_by_rendering_scripts
+Docs/samplesnippets/*
+!Docs/samplesnippets/retain_this_directory_needed_by_rendering_scripts./javalib/javalib
+
+Agents/Java/EventAgent/lib
+Agents/Java/RegistrationAgent/lib
+TestClients/Java/TimeSeriesRequester/lib
+TestClients/Java/RegistrationClient/lib
+TestClients/Java/ControlCommandRequester/lib
+TestClients/Java/RegistrationServiceSearch/lib
+
+Examples/C++/HelloSmart/Makefile
+Examples/C++/HelloSmart/MOCs
+Examples/C++/HelloSmart/bin
+Examples/C++/HelloSmart/objects
+
+Examples/C++/OAuthSample/Makefile
+Examples/C++/OAuthSample/MOCs
+Examples/C++/OAuthSample/bin
+Examples/C++/OAuthSample/objects
+
+Examples/C++/NotificationSample/Makefile
+Examples/C++/NotificationSample/MOCs
+Examples/C++/NotificationSample/bin
+Examples/C++/NotificationSample/objects
+
+Examples/C++/QuickStartSample/Makefile
+Examples/C++/QuickStartSample/MOCs
+Examples/C++/QuickStartSample/bin
+Examples/C++/QuickStartSample/objects
+
+Examples/C++/SmartAPIClient/Makefile
+Examples/C++/SmartAPIClient/MOCs
+Examples/C++/SmartAPIClient/bin
+Examples/C++/SmartAPIClient/objects
+
+Examples/C++/EventAgentSample/Makefile
+Examples/C++/EventAgentSample/MOCs
+Examples/C++/EventAgentSample/bin
+Examples/C++/EventAgentSample/objects
+
+Examples/C++/TransactionAgentSample/Makefile
+Examples/C++/TransactionAgentSample/MOCs
+Examples/C++/TransactionAgentSample/bin
+Examples/C++/TransactionAgentSample/objects
+
+Common/Java/SmartAPI/lib
+Common/Java/SmartAPI/smartapi
+Common/Java/modeldocumentor/lib
+Common/Python/build
+Common/Python/dist
+Common/Python/MANIFEST
+Common/Python/SeasObjects.egg-info
+Common/Python/SeasObjects_for_Python.egg-info
+Common/Python/SmartAPI_for_Python.egg-info
+Common/Python/SmartAPI/build
+Common/C++/SeasObjects/lib
+
+Common/Java/SmartAPI/ontologies
+Common/Python/SmartAPI/tests/ontologies
+Common/Python/SmartAPI/common/ontologies
+
+Common/C++/build-smartapi-Qt_5_10_1-Debug/objects
+Common/C++/build-smartapi-Qt_5_10_1-Debug/lib
+Common/C++/build-smartapi-Qt_5_10_1-Debug/MOCs
+Common/C++/build-smartapitests-Qt_5_10_1-Debug/MOCs
+Common/C++/build-smartapitests-Qt_5_10_1-Debug/objects
+Common/C++/build-smartapitests-Qt_5_10_1-Debug/bin
+
+Common/C#/SeasObjects
+
+Utilities/RDFTranslator/lib
+
+
+## gitignore from the SmartAPI ontologies publication website, 
+## needed to ensure generated files are not pushed.
+
+# git
+OntologyWebsite/.gitignore
+
+# NetBeans
+nbactions.xml
+nb-configuration.xml
+OntologyWebsite/nbproject/
+
+# Eclipse
+.classpath
+.project
+.settings
+.recommenders
+.metadata
+
+# PIP
+Common/Python/SmartAPI.egg-info/
+
+# Maven
+Common/Java/SmartAPI/maven.smart-api.io/
+OntologyWebsite/target/
+*/target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+
+# deploy to website
+make.sh
diff --git a/Common/C#/SmartAPI/.gitignore b/Common/C#/SmartAPI/.gitignore
new file mode 100644 (file)
index 0000000..97459de
--- /dev/null
@@ -0,0 +1,7 @@
+/packages/
+/bin/
+/obj/
+/UnitTester/obj/
+/UnitTester/bin/
+*.csproj.user
+*.nupkg
diff --git a/Common/C#/SmartAPI/INSTALL.txt b/Common/C#/SmartAPI/INSTALL.txt
new file mode 100644 (file)
index 0000000..d443266
--- /dev/null
@@ -0,0 +1,37 @@
+Smart API for C#
+==========================
+These instructions have been tested with Visual Studio 2015.
+
+The easiest way to install this package is from the NuGet repository.
+To do so, in the project you want to link Smart API to, either
+- right click on the project root in Solution Explorer, then choose
+  "Manage NuGet Packages...". Under Browse type "SmartAPI", then
+  search for the package and click on "install" once found
+    or
+- open Tools > NuGet Package Manager > Package Manager Console and
+  type "Install-Package SmartAPI"
+
+
+Alternatively you can open the SmartAPI project in Visual Studio and build
+it. Then add the built package as a reference to the project you are coding.
+
+
+To create a new NuGet package for distribution, do
+  nuget pack SmartAPI.csproj -Build -Prop Configuration=Release
+
+You should do the above every time you want to release a new version.
+Before packing, bump the version number by editing the Assembly info.
+(Properties > Application > Assembly info...)
+
+In case you need to create a new spec file, do
+  nuget spec
+
+To upload the package, do
+nuget push  SmartAPI-<version>.nupkg -Source https://www.nuget.org/api/v2/package -ApiKey <apikey>
+
+nuget.exe from www.nuget.org needs to be installed and in the path for the
+commands above to work.
+
+Note that repository uploads require a valid username and password to NuGet if
+done through the nuget.org website or an API key if done from command line.
+These are not supplied as a part of this distribution.
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/Properties/AssemblyInfo.cs b/Common/C#/SmartAPI/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..44c2f15
--- /dev/null
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SmartAPI for C#")]
+[assembly: AssemblyDescription("An RDF handling library according to the SMARTAPI standard.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Asema Electronics Ltd")]
+[assembly: AssemblyProduct("SmartAPI.Properties")]
+[assembly: AssemblyCopyright("Copyright 2016-2018 Asema Electronics Ltd")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8a270451-4dce-4143-9baf-32a8c87e99dc")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.4")]
+[assembly: AssemblyFileVersion("1.0.0.4")]
diff --git a/Common/C#/SmartAPI/SmartAPI.csproj b/Common/C#/SmartAPI/SmartAPI.csproj
new file mode 100644 (file)
index 0000000..a737611
--- /dev/null
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{994758E1-5D05-4ADE-8D46-780BAA47CFA4}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <NoStandardLibraries>false</NoStandardLibraries>
+    <AssemblyName>SmartAPI</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RootNamespace>SmartAPI</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="dotNetRDF, Version=1.0.12.0, Culture=neutral, PublicKeyToken=6055ffe4c97cc780, processorArchitecture=MSIL">
+      <HintPath>packages\dotNetRDF.1.0.12\lib\net40\dotNetRDF.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
+      <HintPath>packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="json-ld.net, Version=1.0.5.0, Culture=neutral, PublicKeyToken=f17fb428089df9bc, processorArchitecture=MSIL">
+      <HintPath>packages\json-ld.net.1.0.5\lib\net40-client\json-ld.net.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="M2Mqtt.Net, Version=4.3.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>packages\M2Mqtt.4.3.0.0\lib\net45\M2Mqtt.Net.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System.Net.Http.WebRequest" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="VDS.Common, Version=1.6.4.0, Culture=neutral, PublicKeyToken=ab5f4eb908061bf0, processorArchitecture=MSIL">
+      <HintPath>packages\VDS.Common.1.6.4\lib\net40-client\VDS.Common.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="agents\Agent.cs" />
+    <Compile Include="agents\EventAgent.cs" />
+    <Compile Include="agents\TradingAgent.cs" />
+    <Compile Include="agents\TransactionAgent.cs" />
+    <Compile Include="agents\SearchAgent .cs" />
+    <Compile Include="agents\ResponseCallback.cs" />
+    <Compile Include="agents\RegistrationAgent.cs" />
+    <Compile Include="agents\SharingAgent.cs" />
+    <Compile Include="common\ACTIVITIES.cs" />
+    <Compile Include="common\Bictionary.cs" />
+    <Compile Include="common\CurrencyConverter.cs" />
+    <Compile Include="common\URLs.cs" />
+    <Compile Include="common\ConceptDetails.cs" />
+    <Compile Include="common\HttpClient.cs" />
+    <Compile Include="common\HttpMessage.cs" />
+    <Compile Include="common\NS.cs" />
+    <Compile Include="common\DATATYPE.cs" />
+    <Compile Include="common\PROPERTY.cs" />
+    <Compile Include="common\RESOURCE.cs" />
+    <Compile Include="common\SERIALIZATION.cs" />
+    <Compile Include="common\ClassMapper.cs" />
+    <Compile Include="common\MqttClientWrapper.cs" />
+    <Compile Include="common\SmartAPICrypto.cs" />
+    <Compile Include="common\Tools.cs" />
+    <Compile Include="common\UnitDetails.cs" />
+    <Compile Include="common\UnitConverter.cs" />
+    <Compile Include="common\VARIANT.cs" />
+    <Compile Include="exceptions\InsufficientDataException.cs" />
+    <Compile Include="factory\ModelFactory.cs" />
+    <Compile Include="factory\CommandFactory.cs" />
+    <Compile Include="factory\Factory.cs" />
+    <Compile Include="factory\NotificationFactory.cs" />
+    <Compile Include="factory\RequestFactory.cs" />
+    <Compile Include="factory\ResponseFactory.cs" />
+    <Compile Include="model\Capacity.cs" />
+    <Compile Include="model\Account.cs" />
+    <Compile Include="model\AccountAction.cs" />
+    <Compile Include="model\AccountTransaction.cs" />
+    <Compile Include="model\Restriction.cs" />
+    <Compile Include="model\SubscriptionPriceSpecification.cs" />
+    <Compile Include="model\TypeAndQuantityNode.cs" />
+    <Compile Include="model\Grading.cs" />
+    <Compile Include="model\Contract.cs" />
+    <Compile Include="model\Offering.cs" />
+    <Compile Include="model\SomeItems.cs" />
+    <Compile Include="model\Transaction.cs" />
+    <Compile Include="model\UnitPriceSpecification.cs" />
+    <Compile Include="model\PriceSpecification.cs" />
+    <Compile Include="model\GrObj.cs" />
+    <Compile Include="model\Direction.cs" />
+    <Compile Include="model\Organization.cs" />
+    <Compile Include="model\Person.cs" />
+    <Compile Include="model\Enumeration.cs" />
+    <Compile Include="model\Velocity.cs" />
+    <Compile Include="model\Zone.cs" />
+    <Compile Include="model\Address.cs" />
+    <Compile Include="model\Route.cs" />
+    <Compile Include="model\Waypoint.cs" />
+    <Compile Include="model\Waypoints.cs" />
+    <Compile Include="model\Size.cs" />
+    <Compile Include="model\Ring.cs" />
+    <Compile Include="model\Provenance.cs" />
+    <Compile Include="model\Orientation.cs" />
+    <Compile Include="model\Coordinates.cs" />
+    <Compile Include="model\Ability.cs" />
+    <Compile Include="model\AbstractEntity.cs" />
+    <Compile Include="model\Activity.cs" />
+    <Compile Include="model\Availability.cs" />
+    <Compile Include="model\Condition.cs" />
+    <Compile Include="model\Controllability.cs" />
+    <Compile Include="model\Device.cs" />
+    <Compile Include="model\Entity.cs" />
+    <Compile Include="model\Error.cs" />
+    <Compile Include="model\Evaluation.cs" />
+    <Compile Include="model\Input.cs" />
+    <Compile Include="model\InterfaceAddress.cs" />
+    <Compile Include="model\Parameter.cs" />
+    <Compile Include="model\Map.cs" />
+    <Compile Include="model\Message.cs" />
+    <Compile Include="model\Notification.cs" />
+    <Compile Include="model\Obj.cs" />
+    <Compile Include="model\ObjectInterface.cs" />
+    <Compile Include="model\Output.cs" />
+    <Compile Include="model\PhysicalEntity.cs" />
+    <Compile Include="model\Request.cs" />
+    <Compile Include="model\Response.cs" />
+    <Compile Include="model\Service.cs" />
+    <Compile Include="model\ServiceProvider.cs" />
+    <Compile Include="model\Status.cs" />
+    <Compile Include="model\SystemOfInterest.cs" />
+    <Compile Include="model\TemporalContext.cs" />
+    <Compile Include="model\TimeSeries.cs" />
+    <Compile Include="model\ValueObject.cs" />
+    <Compile Include="rdf\ItemizedList.cs" />
+    <Compile Include="rdf\NudeList.cs" />
+    <Compile Include="rdf\LinkedList.cs" />
+    <Compile Include="rdf\SmartAPIList.cs" />
+    <Compile Include="rdf\GraphItem.cs" />
+    <Compile Include="rdf\OrderedList.cs" />
+    <Compile Include="rdf\Variant.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="rdf\RDFNode.cs" />
+    <Compile Include="rdf\RDFList.cs" />
+    <Compile Include="rdf\Literal.cs" />
+    <Compile Include="rdf\Model.cs" />
+    <Compile Include="rdf\Property.cs" />
+    <Compile Include="rdf\Resource.cs" />
+    <Compile Include="rdf\Statement.cs" />
+    <Compile Include="tests\PropertyMapTest.cs" />
+    <Compile Include="tests\CryptoKeyTest.cs" />
+    <Compile Include="tests\ActivityTest.cs" />
+    <Compile Include="tests\CapacityChangeNotificationTest.cs" />
+    <Compile Include="tests\CapacityChangeCommandTest.cs" />
+    <Compile Include="tests\SimpleSerializeTest.cs" />
+    <Compile Include="tests\TransactionAgentTest .cs" />
+    <Compile Include="tests\TradingAgentTest.cs" />
+    <Compile Include="tests\SharingTest.cs" />
+    <Compile Include="tests\RegistrationTest.cs" />
+    <Compile Include="tests\RegistrySearchTest.cs" />
+    <Compile Include="tests\SigningTest.cs" />
+    <Compile Include="tests\MultipartTest.cs" />
+    <Compile Include="tests\EncryptionTest.cs" />
+    <Compile Include="tests\RequestSerializeParseTest.cs" />
+    <Compile Include="tests\ResponseRequestTest.cs" />
+    <Compile Include="tests\OptimizerRegistrationTest.cs" />
+    <Compile Include="tests\ChargePlanRegistrationTest.cs" />
+    <Compile Include="tests\ChargePlanTest.cs" />
+    <Compile Include="tests\ListOfMapsTest.cs" />
+    <Compile Include="tests\ParseFileTest.cs" />
+    <Compile Include="tests\ParseTest.cs" />
+    <Compile Include="tests\ListSerializeParseTest.cs" />
+    <Compile Include="tests\GoodRelationsSerializeParseTest.cs" />
+    <Compile Include="tests\RouteSerializeParseTest.cs" />
+    <Compile Include="tests\AccountTest.cs" />
+    <Compile Include="tests\TimeSeriesTest.cs" />
+    <Compile Include="tests\SizeSerializeParseTest.cs" />
+    <Compile Include="tests\SerializeParseTest.cs" />
+    <Compile Include="tests\DataFetchTest.cs" />
+    <Compile Include="tests\SerializeTest.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include=".vs\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
+  <ProjectExtensions>
+    <VisualStudio AllowExistingFolder="true" />
+  </ProjectExtensions>
+  <Import Project="packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
+  </Target>
+</Project>
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/SmartAPI.nuspec b/Common/C#/SmartAPI/SmartAPI.nuspec
new file mode 100644 (file)
index 0000000..488850e
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<package >
+  <metadata>
+    <id>$id$</id>
+    <version>$version$</version>
+    <title>$title$</title>
+    <authors>$author$</authors>
+    <owners>$author$</owners>
+    <projectUrl>http://seas.asema.com</projectUrl>
+    <requireLicenseAcceptance>false</requireLicenseAcceptance>
+    <description>$description$</description>
+    <releaseNotes></releaseNotes>
+    <copyright>Copyright 2016 Asema Electronics</copyright>
+  </metadata>
+</package>
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/SmartAPI.sln b/Common/C#/SmartAPI/SmartAPI.sln
new file mode 100644 (file)
index 0000000..1744ae2
--- /dev/null
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25123.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartAPI", "SmartAPI.csproj", "{994758E1-5D05-4ADE-8D46-780BAA47CFA4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTester", "UnitTester\UnitTester.csproj", "{411124DC-631D-458E-82DC-06A4494588FA}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {994758E1-5D05-4ADE-8D46-780BAA47CFA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {994758E1-5D05-4ADE-8D46-780BAA47CFA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {994758E1-5D05-4ADE-8D46-780BAA47CFA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {994758E1-5D05-4ADE-8D46-780BAA47CFA4}.Release|Any CPU.Build.0 = Release|Any CPU
+               {411124DC-631D-458E-82DC-06A4494588FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {411124DC-631D-458E-82DC-06A4494588FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {411124DC-631D-458E-82DC-06A4494588FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {411124DC-631D-458E-82DC-06A4494588FA}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/Common/C#/SmartAPI/UnitTester/App.config b/Common/C#/SmartAPI/UnitTester/App.config
new file mode 100644 (file)
index 0000000..de36078
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
+    </startup>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.4.9.5" newVersion="1.4.9.5"/>
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="VDS.Common" publicKeyToken="ab5f4eb908061bf0" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.6.4.0" newVersion="1.6.4.0"/>
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
diff --git a/Common/C#/SmartAPI/UnitTester/Program.cs b/Common/C#/SmartAPI/UnitTester/Program.cs
new file mode 100644 (file)
index 0000000..08dd6c5
--- /dev/null
@@ -0,0 +1,121 @@
+
+using System;
+using System.IO;
+using SmartAPI.Common;
+using SmartAPI.Model;
+using SmartAPI.tests;
+
+namespace UnitTests
+{
+    class Program
+    {
+        static bool outputToFile = false;
+
+        static void Main(string[] args)
+        {
+            StreamWriter sw = null;
+            if (outputToFile)
+            {
+                FileStream fs = new FileStream("C:\\Users\\Senni Lu\\Desktop\\seas-c-sharp-out.txt", FileMode.Create);
+                sw = new StreamWriter(fs);
+                sw.AutoFlush = true;
+                Console.SetOut(sw);
+            }
+            else
+                Console.BufferHeight = 1000;
+
+            Console.WriteLine("Run test sequences.");
+
+            //new SimpleSerializeTest().Run();
+            //new SerializeTest().Run();
+
+            //ParseTest ptest = new ParseTest();
+            //ptest.Run();
+            
+            //new SerializeParseTest().Run();
+
+            //new ListSerializeParseTest().Run();
+
+            //ListOfMapsTest lmtest = new ListOfMapsTest();
+            //lmtest.Run();
+
+
+            //ChargePlanTest cptest = new ChargePlanTest();
+            //cptest.Run();
+
+            //ChargePlanRegistrationTest cprtest = new ChargePlanRegistrationTest();
+            //cprtest.Run();
+
+            //ParseFileTest pstest = new ParseFileTest();
+            //pstest.Run(@"C:\development\response.txt");
+
+            //OptimizerRegistrationTest ort = new OptimizerRegistrationTest();
+            //ort.Run();
+
+            //ResponseRequestTest rrt = new ResponseRequestTest();
+            //rrt.Run();
+
+            //DataFetchTest dft = new DataFetchTest();
+            //dft.Run();
+
+            //CapacityChangeCommandTest ccct = new CapacityChangeCommandTest();
+            //ccct.Run();
+
+            //CapacityChangeNotificationTest ccnt = new CapacityChangeNotificationTest();
+            //ccnt.Run();     
+
+            //GoodRelationsSerializeParseTest grTest = new GoodRelationsSerializeParseTest();
+            //grTest.RunUnitPriceSpecificationTest();
+
+            //grTest.RunOfferingTest();
+            //grTest.RunTransactionSerialzeTest();
+
+            //MultipartTest mp = new MultipartTest();
+            //mp.Run();
+
+            //SizeSerializeParseTest sspt = new SizeSerializeParseTest();
+            //sspt.Run();
+
+            //RouteSerializeParseTest rspt = new RouteSerializeParseTest();
+            //rspt.Run();
+            //new AccountTest().Run(); 
+            //new ActivityTest().Run();
+            //new TimeSeriesTest().Run();
+
+            //new RequestSerializeParseTest().Run();
+            //new EncryptionTest().Run();
+            //new SigningTest().Run();
+
+            //new RegistrySearchTest().Run();
+            //new RegistrationTest().Run();
+            //new TransactionAgentTest().Run();
+            //new TradingAgentTest().Run();
+
+            //new CryptoKeyTest().Run();
+
+            //new PropertyMapTest().Run();
+            //Console.ReadKey();
+
+
+            //ValueObject vo = new ValueObject();
+            //vo.setQuantity(RESOURCE.VOLUME);
+            //vo.setUnit(RESOURCE.CUBICMETER);
+            //vo.setValue(15);
+
+            //vo.turtlePrint();
+
+            //UnitConverter.convert(vo, RESOURCE.LITER).turtlePrint();
+
+
+            ValueObject vo = new ValueObject();
+            vo.setQuantity(RESOURCE.THERMODYNAMICTEMPERATURE);
+            vo.setUnit(RESOURCE.DEGREECELSIUS);
+            vo.setValue(15);
+            vo.turtlePrint();
+            UnitConverter.convert(vo, RESOURCE.KELVIN).turtlePrint();
+
+            if (outputToFile)
+                sw.Close();
+        }
+    }
+}
diff --git a/Common/C#/SmartAPI/UnitTester/Properties/AssemblyInfo.cs b/Common/C#/SmartAPI/UnitTester/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..868dc11
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConsoleApplication1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ConsoleApplication1")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("411124dc-631d-458e-82dc-06a4494588fa")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/C#/SmartAPI/UnitTester/UnitTester.csproj b/Common/C#/SmartAPI/UnitTester/UnitTester.csproj
new file mode 100644 (file)
index 0000000..e9f852c
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{411124DC-631D-458E-82DC-06A4494588FA}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UnitTester</RootNamespace>
+    <AssemblyName>UnitTester</AssemblyName>
+    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="dotNetRDF, Version=1.0.12.0, Culture=neutral, PublicKeyToken=6055ffe4c97cc780, processorArchitecture=MSIL">
+      <HintPath>..\packages\dotNetRDF.1.0.12\lib\net40\dotNetRDF.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
+      <HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System.Net.Http.WebRequest" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+    <Reference Include="VDS.Common, Version=1.6.4.0, Culture=neutral, PublicKeyToken=ab5f4eb908061bf0, processorArchitecture=MSIL">
+      <HintPath>..\packages\VDS.Common.1.6.4\lib\net40-client\VDS.Common.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\SmartAPI.csproj">
+      <Project>{994758e1-5d05-4ade-8d46-780baa47cfa4}</Project>
+      <Name>SeasObjects</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
+  </Target>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/UnitTester/packages.config b/Common/C#/SmartAPI/UnitTester/packages.config
new file mode 100644 (file)
index 0000000..44386da
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="dotNetRDF" version="1.0.12" targetFramework="net452" />
+  <package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net452" />
+  <package id="Microsoft.Bcl" version="1.1.10" targetFramework="net452" />
+  <package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net452" />
+  <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net452" />
+  <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
+  <package id="VDS.Common" version="1.6.4" targetFramework="net452" />
+</packages>
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/UnitTester/testkey_private.pem b/Common/C#/SmartAPI/UnitTester/testkey_private.pem
new file mode 100644 (file)
index 0000000..22805f6
--- /dev/null
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXCEsFkRipfqLj
+f/SGlgFx3BlrwBdS0sGU09Rdq7CJcXFkCM7iufSEsK+82wPqECJ0+ao0y+cpxjcZ
+kZklR2jIxNLJI2QgqbSgNI57NknSS63P3oqEi4UgjCELKL2bxnfYlyd6pLGTX0t2
+meNB8auQiyVSuZ3/7nfD4K5HytCdfIGV5GwbXzM0EhROISJcEjOsVhqHrXsO8Uay
+cgIG/VBoXNsdzSaa5VkcF03XuFBABlevPoP47c9VN1lp67Sct3SNgSFlFyb18/Tw
+IvZEUj0saQj9HR/jNcQo3lr9/rfM3bUPKW6Yb2QDVnsTfYLyxVviPPAL1vq2f+MV
+JgufX9mrAgMBAAECggEAKKtF3SCrJGtyDUsHCWlXjpxNJobnImAAAtDpimnNcsFE
+6+GKl3EKIQp1wmc930f77FnH6kJiTxFRHIHgEB/oXohzQV1zM4ZFRkOKax1Cawar
+MfRqCFWG8Tfvi/fBnLO1uP4lllmNyEyurhi+1ZsKksTuYy3+BwioGCDndWaTfCVW
+LVCyF3fcvr9HxPFOv4Nh2LlUbjhOihf8o8+RvUdbsNer0MXyARvMJbY0A7NS+8nP
+zfGIyYzUuZ1AoE0kRqUlsjejHozU4/+i1e30Hps23v8UsDvaOaf0+rLjpq07ukm1
+J88zQCB7oFVMxdUVDA/HRYBYXv2k76FghbaXfCGacQKBgQD9b3P288O1X9gQyh/V
+4NJg/uGRW+jNhGaAUbAnd0nnj3SkojgBt8jyHsB6Nnd7mJXzwgE+gFdQolvjvJSf
+95p20vjnBnSTTYVz/M9l9Aa34E2Ueq05K8kZ1UBlN2H0yqMyUBqaIB7dqBu0M6JJ
+xi8uCYqxb1t3oZJq8lu6wzem6QKBgQDZNVqOePZiFCtWznrfH/qVxKqFVrZZbpD/
+QwhVLyoVy6PbWbH11l8wvjcBW9RynBAslJZq2iRmPFkXAr9D/Ldzly/oH6SXe3qR
+my6Cpm8ONHXCONuz9dswj45hTo5WVwXVzdFdKy3k3tsWSMy6Ia9pKFLJapqeIdRf
+RGltHqOHcwKBgQCk1VWGO/uBPwonuV7FW8lZHs2VHkMnUELemMLKmHJv8kT6QyvM
+Kj2/BDNKCZzivVZiST9H6G9h2YeMcn30ITXMrOEIWZF+sP/odXhrJjEsbO3ocXWy
+5oCQlbuhWUkTzqwgMCttLREGN611IdQeyZCsD7auOvAxuduiRWlV6lyK6QKBgQCI
+G5nKS1xA61iZBbwTEyvoK5ubAFI1ykYL3opbLrnVfI0KB7OvVAzEM32uWUfQJaEw
+/k8fV+CVO92rwKnvxW2DfkqjzyhJUDPnB/HmJrrSkOb1tMFfjIE0ddCHgz1INzHN
+3zIBiuwwTcHFvgqj3DXZ1E3ELwwCaTp2FB1oJlncpwKBgEAeV1hfZCo+CHzpHnqG
+9v88DFW2ULDGiidPtNe9aKxjEuXq3NxIHsAsp/ff55QaNGbLKjJ3QntrzgzhOZdj
+MvrqkiEC5mVQ1/BE4rQu2A3xKdsg9tF2hDpEZW+QSwCwNqvuHaNsdhef6IpA/O08
+BMWk21C4UBIG0cBys0mGd0CT
+-----END PRIVATE KEY-----
diff --git a/Common/C#/SmartAPI/UnitTester/testkey_public.pem b/Common/C#/SmartAPI/UnitTester/testkey_public.pem
new file mode 100644 (file)
index 0000000..0952ba0
--- /dev/null
@@ -0,0 +1,9 @@
+-----BEGIN PUBLIC KEY-----
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1whLBZEYqX6i43/0hpYB
+cdwZa8AXUtLBlNPUXauwiXFxZAjO4rn0hLCvvNsD6hAidPmqNMvnKcY3GZGZJUdo
+yMTSySNkIKm0oDSOezZJ0kutz96KhIuFIIwhCyi9m8Z32JcneqSxk19LdpnjQfGr
+kIslUrmd/+53w+CuR8rQnXyBleRsG18zNBIUTiEiXBIzrFYah617DvFGsnICBv1Q
+aFzbHc0mmuVZHBdN17hQQAZXrz6D+O3PVTdZaeu0nLd0jYEhZRcm9fP08CL2RFI9
+LGkI/R0f4zXEKN5a/f63zN21DylumG9kA1Z7E32C8sVb4jzwC9b6tn/jFSYLn1/Z
+qwIDAQAB
+-----END PUBLIC KEY-----
diff --git a/Common/C#/SmartAPI/agents/Agent.cs b/Common/C#/SmartAPI/agents/Agent.cs
new file mode 100644 (file)
index 0000000..6f7eed5
--- /dev/null
@@ -0,0 +1,66 @@
+using System;
+using SmartAPI.Common;
+using System.Text;
+
+namespace SmartAPI.Agents
+{
+    public class Agent
+    {
+        // uri of the SMARTAPI registration service
+        protected String serverUri = null;
+
+        // identifier uri of the system running the agent
+        protected String myIdentity = null;
+
+        protected String authenticationHeader = null;
+
+        protected String defaultSerialization = SERIALIZATION.TURTLE;
+        protected bool debug = false;
+
+        // http client
+        protected HttpClient httpClient = new HttpClient();
+
+        public Agent()
+        {
+        }
+
+        public void setServerUri(String uri)
+        {
+            this.serverUri = uri;
+        }
+
+        public String getServerUri()
+        {
+            return this.serverUri;
+        }
+
+        public void setHTTPBasicAccessAuthenticationCredentials(String username, String password)
+        {
+            // using HTTP basic authentication, i.e., using username:password combination.
+            String combination = username + ":" + password;
+            String encoded = Convert.ToBase64String(Encoding.UTF8.GetBytes(combination));
+
+            this.authenticationHeader = "Basic " + encoded;
+        }
+
+        public void debugMode(bool value)
+        {
+            this.debug = value;
+        }
+
+        public bool debugMode()
+        {
+            return this.debug;
+        }
+
+        public String getSerialization()
+        {
+            return this.defaultSerialization;
+        }
+
+        public void setSerialization(String serialization)
+        {
+            this.defaultSerialization = serialization;
+        }
+    }
+}
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/agents/EventAgent.cs b/Common/C#/SmartAPI/agents/EventAgent.cs
new file mode 100644 (file)
index 0000000..e948595
--- /dev/null
@@ -0,0 +1,232 @@
+using System;
+using SmartAPI.Common;
+using uPLibrary.Networking.M2Mqtt;
+using System.Text;
+
+namespace SmartAPI.Agents
+{
+    public delegate void EventCallback(String topicPart1, String topicPart2, String topicPart3, String topicPart4, String message);
+
+    /***
+     * EventAgent in the main class of the EventAgent library. It provides
+     * functionality for publishing messages to topics and subscribing to 
+     * topics.
+     *
+     */
+
+    public class EventAgent : Agent
+    {
+        private int port = 1883;
+        private String clientIdentifier = "";
+        private int qos = 2;
+        MqttClient client;
+
+        // whether server should consider this as new client
+        // or deliver possible missed messages based on client id
+        private Boolean cleanSession = true;
+        private Boolean retained = true;
+        EventCallback callback = null;
+
+        public EventAgent()
+        {
+            this.serverUri = URLs.TALK_MQTT_BROKER_URI;
+            this.clientIdentifier = SmartAPICrypto.generate16ByteCryptoRandomString();
+            initClient();
+        }
+
+        /**
+         * Creates a new persistent EventAgent
+         * @param broker uri and port of the broker (e.g. "tcp://test.mosquitto.org:1883"), null for default broker
+         * defined in config.properties
+         * @param clientIdentifier globally unique identifier for identifying 
+         * client across restarts and reconnects
+         */
+        public EventAgent(String brokerUri, String clientIdentifier)
+        {
+            cleanSession = false;
+            this.clientIdentifier = clientIdentifier;
+            this.serverUri = brokerUri;
+            initClient();
+        }
+
+        /**
+         * Creates a new non-persistent EventAgent
+         * @param broker uri and port of the broker (e.g. "tcp://test.mosquitto.org:1883"), null for default broker
+         * defined in config.properties
+         */
+        public EventAgent(String brokerUri)
+        {
+            this.serverUri = brokerUri;
+            this.clientIdentifier = SmartAPICrypto.generate16ByteCryptoRandomString();
+            initClient();
+        }
+
+        private void initClient()
+        {
+            client = new MqttClient(this.serverUri);
+            this.client.MqttMsgSubscribed += this.subscriptionComplete;
+            this.client.MqttMsgPublished += this.deliveryComplete;
+            this.client.MqttMsgPublishReceived += this.messageArrived;
+        }
+
+        /**
+         * Publish provided message on the broker
+         * @param publisherUri publisher full URI given by SMARTAPI Registration Server (null if not applicable)
+         * @param publisherType publisher type/role full URI defined in SMARTAPI ontology (null if not applicable)
+         * @param topicUri event/conversation full URI (null if not applicable)
+         * @param topicType event/conversation type full URI defined in SMARTAPI ontology (null if not applicable)
+         * @param message notification message content
+         * @return true on success, false on failure
+         */
+        public void publish(String publisherUri, String publisherType, String topicUri, String topicType,
+                String message, String contentType)
+        {
+            String topic = (publisherUri == null ? "-" : urlEncode(publisherUri)) +
+                    "/" + (publisherType == null ? "-" : urlEncode(publisherType)) +
+                    "/" + (topicUri == null ? "-" : urlEncode(topicUri)) +
+                    "/" + (topicType == null ? "-" : urlEncode(topicType));
+            publish(topic, message);
+        }
+
+        public void publish(String topic, String message)
+        {
+            this.client.Publish(topic, Encoding.UTF8.GetBytes(message));
+        }
+
+        /**
+         * Subscribe to a topic on the broker.
+         * @param publisherUri publisher full URI given by SMARTAPI Registration Server (null for all)
+         * @param publisherType publisher type/role full URI defined in SMARTAPI ontology (null for all)
+         * @param topicUri event/conversation full URI (null for all)
+         * @param topicType event/conversation type full URI defined in SMARTAPI ontology (null for all)
+         * @param message notification message content
+         * @return true on success, false on failure
+         */
+        public Boolean subscribe(String publisherUri, String publisherType, String topicUri, String topicType)
+        {
+            String topic = (publisherUri == null ? "+" : urlEncode(publisherUri)) +
+                    "/" + (publisherType == null ? "+" : urlEncode(publisherType)) +
+                    "/" + (topicUri == null ? "+" : urlEncode(topicUri)) +
+                    "/" + (topicType == null ? "+" : urlEncode(topicType));
+
+            ushort msgId = client.Subscribe(new string[] { topic },
+                new byte[] { (byte)this.qos });  // simple cast should work as qos is always <= 2
+
+            return true;
+        }
+
+        /**
+         * Set quality of service level
+         * 0: messages are delivered max once
+         * 1: messages are delivered at least once
+         * 2: messages are delivered exactly once
+         * @param val new quality of service level
+         * @return true on success, false on failure caused by invalid argument
+         */
+        public Boolean setQos(int val)
+        {
+            if (val >= 0 && val <= 2)
+            {
+                this.qos = val;
+                return true;
+            }
+            return false;
+        }
+
+        public void connect()
+        {
+            this.client.Connect(this.clientIdentifier);
+        }
+
+        public void disconnect()
+        {
+            this.client.Disconnect();
+        }
+
+        public void setCallback(EventCallback cb)
+        {
+            this.callback = cb;
+        }
+
+        /**
+         * Sets whether or not the last sent message should
+         * be stored by the server and sent to new subscribers
+         * as an initial value
+         * @param retained if true last message is stored
+         */
+        public void setRetained(Boolean retained)
+        {
+            this.retained = retained;
+        }
+
+        /**
+         * URL Encodes a string (spaces are converted into %20)
+         * @param str string to be encoded
+         * @return encoded string
+         */
+        public String urlEncode(String str)
+        {
+            return System.Web.HttpUtility.UrlEncode(str);
+        }
+
+        /**
+         * Decodes URL encoded string
+         * @param str string to be decoded
+         * @return decoded string
+         */
+        public String urlDecode(String str)
+        {
+            return System.Web.HttpUtility.UrlDecode(str);
+        }
+
+        /**
+         * Get client identifier
+         * @return client identifier
+         */
+        public String getClientIdentifier()
+        {
+            return this.clientIdentifier;
+        }
+
+        void subscriptionComplete(object sender, uPLibrary.Networking.M2Mqtt.Messages.MqttMsgSubscribedEventArgs e)
+        {
+            Console.WriteLine("Subscribed for id = " + e.MessageId);
+        }
+
+        void deliveryComplete(Object sender, uPLibrary.Networking.M2Mqtt.Messages.MqttMsgPublishedEventArgs e)
+        {
+            Console.WriteLine("disconnected.");
+            this.disconnect();
+        }
+
+        void messageArrived(object sender, uPLibrary.Networking.M2Mqtt.Messages.MqttMsgPublishEventArgs e)
+        {
+            String message = Encoding.UTF8.GetString(e.Message);
+            String topic = e.Topic;
+
+            // url-decoce and split topic into parts
+            String [] topicParts = topic.Split('/');
+
+            // separate parts to strings
+            String topic1 = null;
+            String topic2 = null;
+            String topic3 = null;
+            String topic4 = null;
+                   if (topicParts.Length >= 1 && topicParts[0] != "-") {
+                topic1 = urlDecode(topicParts[0]);
+            }
+                   if (topicParts.Length >= 2 && topicParts[1] != "-") {
+                topic2 = urlDecode(topicParts[1]);
+            }
+                   if (topicParts.Length >= 3 && topicParts[2] != "-") {
+                topic3 = urlDecode(topicParts[2]);
+            }
+                   if (topicParts.Length >= 4 && topicParts[3] != "-") {
+                topic4 = urlDecode(topicParts[3]);
+            }
+
+            // callback to user code
+            callback(topic1, topic2, topic3, topic4, message);
+        }
+    }
+}
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/agents/RegistrationAgent.cs b/Common/C#/SmartAPI/agents/RegistrationAgent.cs
new file mode 100644 (file)
index 0000000..fc23a50
--- /dev/null
@@ -0,0 +1,358 @@
+using System;
+using SmartAPI.Common;
+using SmartAPI.Model;
+using SmartAPI.Factory;
+using SmartAPI.Exceptions;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+
+namespace SmartAPI.Agents
+{
+    public class RegistrationAgent : Agent
+    {
+        // uri of the SMARTAPI registration service
+        private String keyUri = URLs.FIND_KEY_URI;
+        private String method = RESOURCE.WRITE; // default
+        // switch to mark registration as locked so others cannot overwrite
+        private bool locked = false;
+
+        // list of entities to be registered
+        private List<Entity> entities = new List<Entity>();
+
+        // timestamp of the sent registration request
+        // DateTime timestamp;
+
+        /**
+         * Usage:
+         * 
+         * First build your entity
+         * Entity myEntity = ...
+         * ...
+         * 
+         * Then registrate it
+         * RegistrationAgent agent = new RegistrationAgent("http://mycompany.com/seas/CRegistrator");
+         * agent.registrate(myEntity);
+         * 
+         *
+         */
+
+        public RegistrationAgent(String registrantUri)
+        {
+            serverUri = URLs.FIND_URI;
+            this.setRegistrantUri(registrantUri);
+        }
+
+        public void setServerKeyUri(String serverUri)
+        {
+            keyUri = serverUri;
+        }
+
+        public Response registrate(Entity entity)
+        {
+            addEntity(entity);
+            return registrate((ResponseCallback)null);
+        }
+
+        public Response registrateAndLock(Entity entity)
+        {
+            this.locked = true;
+            Response resp = registrate(entity);
+            this.locked = false;
+            return resp;
+        }
+
+        public Response registrate(Entity entity, ResponseCallback callback)
+        {
+            addEntity(entity);
+            return registrate(callback);
+        }
+
+        public Response registrate()
+        {
+            return registrate((ResponseCallback)null);
+        }
+
+        public Response deRegistrate()
+        {
+            return deRegistrate((ResponseCallback)null);
+        }
+
+        public Response processRequest(ResponseCallback callback)
+        {
+            HttpMessage msg = null;
+            byte[] symmetricKey = null;
+            try
+            {
+                // serialize data
+                msg = generateEncryptedRegistrationMessage(ref symmetricKey);
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine("Exception while generating registration message.");
+                Console.WriteLine(e.Message);
+                Console.WriteLine(e.StackTrace);
+            }
+
+            try
+            {
+                httpClient.setDebugMode(debug);
+                // send message
+                Task<Tuple<string,string>> response = httpClient.sendPost(serverUri, msg);
+                try
+                {
+                    response.Wait(); // wait until the recipient has responded to our request
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine("Registration failed");
+                    Console.WriteLine(ex);
+                }
+
+                //if (debug)
+                //{
+                //    Console.WriteLine("Raw response from SMARTAPI Registration Service:");
+                //    Console.WriteLine(response.Result.Item1 + "\n");
+                //}
+
+                // parse response               
+                Response resp = Tools.parseResponse(response.Result.Item1, response.Result.Item2, defaultSerialization);
+                // decrypt activity
+                if (resp.hasActivity())
+                {
+                    Activity respAct = resp.getFirstActivity();
+                    if (respAct.isEncrypted())
+                    {
+                        respAct = ((Activity)respAct.decryptWithSymmenticKey(symmetricKey));
+                        if (debug)
+                        {
+                            Console.WriteLine("SMARTAPI Registration Service activity content:");
+                            respAct.turtlePrint();
+                        }
+                    }
+                    if (respAct.hasErrors())
+                    {
+                        Console.WriteLine("Registration had errors:");
+                        foreach(Error e in respAct.getErrors())
+                        {
+                            Console.WriteLine(e.getErrorMessage());
+                        }
+                    } else
+                    {
+                        List<Activity> acts = new List<Activity>();
+                        acts.Add(respAct);
+                        resp.setActivities(acts);
+                    }
+                }
+
+                // return in callback if provided
+                if (callback != null)
+                {
+                    callback.onResponse(resp);
+                }
+
+                return resp;
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine("Exception while sending an HTTP request to " + serverUri);
+                Console.WriteLine(e.Message);
+                Console.WriteLine(e.StackTrace);
+            }
+
+            return null;
+        }
+
+        public Response registrate(ResponseCallback callback)
+        {
+            this.method = RESOURCE.WRITE;
+            return processRequest(callback);           
+        }
+
+        public Response deRegistrate(ResponseCallback callback)
+        {
+            this.method = RESOURCE.DELETE;
+            return processRequest(callback);
+        }
+
+        public HttpMessage generateEncryptedRegistrationMessage(Entity entity, ref byte[] symmetricKey)
+        {
+            addEntity(entity);
+            return generateEncryptedRegistrationMessage(ref symmetricKey);
+        }
+
+        public HttpMessage generateEncryptedRegistrationMessage(byte[] serverPublicKey, Entity entity, ref byte[] symmetricKey)
+        {
+            addEntity(entity);
+            return generateEncryptedRegistrationMessage(serverPublicKey, ref symmetricKey);
+        }
+
+        public HttpMessage generateEncryptedRegistrationMessage(ref byte[] symmetricKey)
+        {
+            return generateEncryptedRegistrationMessage(getServerPublicKey(), ref symmetricKey);
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="serverPublicKey"></param>
+        /// <param name="symmetricKey"></param>
+        /// <returns></returns>
+        public HttpMessage generateEncryptedRegistrationMessage(byte[] serverPublicKey, ref byte[] symmetricKey)
+        {
+            Request req = generateRegistrationMessage();
+            // encrypt
+            if (req.hasActivity())
+                symmetricKey = req.getFirstActivity().encrypt(serverPublicKey);
+
+            HttpMessage message = Tools.serializeRequestToMessage(req, SERIALIZATION.TURTLE);
+            if (debug)
+            {
+                Console.WriteLine("\nRegistration request:");
+                Console.WriteLine(message.getBody() + "\n");
+            }
+            
+            return message;
+        }
+
+        public Request generateRegistrationMessage(Entity entity)
+        {
+            addEntity(entity);
+            return generateRegistrationMessage();
+        }
+
+        public Request generateRegistrationMessage()
+        {
+            try
+            {
+                // build registration request
+                Request request = RequestFactory.createRequest(this.myIdentity);
+
+                // check that there is something to register
+                if (entities.Count < 1 && !this.method.Equals(RESOURCE.DELETE))
+                {
+                    throw new InsufficientDataException("No SMARTAPI entities found in registration.");
+                }
+
+                Activity a = new Activity(ACTIVITIES.REGISTER);
+                request.addActivity(a);
+                a.setMethod(this.method);
+                if (!this.method.Equals(RESOURCE.DELETE))
+                {
+                    a.setEntities(entities);
+                    // set lock
+                    a.add(PROPERTY.LOCKED, this.locked);
+                }
+                if (debug)
+                {
+                    Console.WriteLine("\nRegistration request:");
+                    request.print();
+                }
+
+                return request;
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.StackTrace);
+                return null;
+            }
+        }
+
+        public void setRegistrantUri(String uri)
+        {
+            this.myIdentity = uri;
+        }
+
+        public String getRegistrantUri()
+        {
+            return this.myIdentity;
+        }
+
+        public void setRegistrationServiceUri(String uri)
+        {
+            this.setServerUri(uri);
+        }
+
+        public String getRegistrationServiceUri()
+        {
+            return this.getServerUri();
+        }
+
+        public void addEntity(Entity entity)
+        {
+            entities.Add(entity);
+        }
+
+        public int entitiesSize()
+        {
+            return entities.Count;
+        }
+
+        public void clearEntities()
+        {
+            this.entities = new List<Entity>();
+        }
+
+        public static Nullable<DateTime> getDescriptionTimestamp(Entity entity)
+        {
+            try
+            {
+                return entity.get(PROPERTY.GENERATEDAT)[0].asDate();
+            }
+            catch (Exception e)
+            {
+                // failed to get generatedAt value
+                Console.WriteLine(e.StackTrace);
+                return null;
+            }
+        }
+
+        ///**
+        // * Check if the entity has the same timestamp that the registrated entity
+        // * @param entity
+        // * @return true if successful
+        // */
+        //public bool registrationSuccessful(Entity entity)
+        //{
+        //    DateTime generatedAt = entity.get(PROPERTY.GENERATEDAT)[0].asDate();
+        //    if (generatedAt == null)
+        //    {
+        //        return false;
+        //    }
+        //    if (this.timestamp == null)
+        //    {
+        //        return false;
+        //    }
+        //    if (this.timestamp == generatedAt)
+        //    {
+        //        if (debug)
+        //        {
+        //            Console.WriteLine("Registration made successfully.");
+        //        }
+        //        return true;
+        //    }
+        //    else
+        //    {
+        //        if (debug)
+        //        {
+        //            Console.WriteLine("Registration was not successful.");
+        //            Console.WriteLine("Timestamp of the sent registration request: " + Tools.dateToString(this.timestamp));
+        //            Console.WriteLine("Timestamp of the current data on the registration server: " + Tools.dateToString(generatedAt));
+        //        }
+        //        return false;
+        //    }
+        //}
+
+        private byte[] getServerPublicKey()
+        {
+            string keyString = httpClient.sendGet(keyUri).Result;
+            if (debug)
+            {
+                Console.WriteLine("Found server public key");
+                Console.WriteLine(keyString);
+            }
+            // return SmartAPICrypto.extractPemFormatPublicKey(keyString, "RSA");
+            return Convert.FromBase64String(SmartAPICrypto.stripKey(keyString));
+        }
+    }
+}
diff --git a/Common/C#/SmartAPI/agents/ResponseCallback.cs b/Common/C#/SmartAPI/agents/ResponseCallback.cs
new file mode 100644 (file)
index 0000000..e26d762
--- /dev/null
@@ -0,0 +1,10 @@
+using SmartAPI.Model;
+
+namespace SmartAPI.Agents
+{
+    public abstract class ResponseCallback
+    {
+        public abstract void onResponse(Response response);
+        
+    }
+}
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/agents/SearchAgent .cs b/Common/C#/SmartAPI/agents/SearchAgent .cs
new file mode 100644 (file)
index 0000000..d9e5fb4
--- /dev/null
@@ -0,0 +1,521 @@
+using System;
+using SmartAPI.Common;
+using SmartAPI.Rdf;
+using SmartAPI.Model;
+using SmartAPI.Factory;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace SmartAPI.Agents
+{
+    public class SearchAgent : Agent
+    {
+        private Entity entity = new Entity();
+
+        public SearchAgent()
+        {
+            this.serverUri = URLs.FIND_URI;
+        }
+
+        public SearchAgent(String myUri)
+        {
+            this.myIdentity = myUri;
+            this.serverUri = URLs.FIND_URI;
+        }
+
+        public List<Entity> search()
+        {
+            return this.search(RESOURCE.READ);
+        }
+
+        public List<Entity> search(String method)
+        {
+            try
+            {
+                // serialize data
+                String messageBody = generateSearchMessage(method);
+                httpClient.setDebugMode(debug);
+                // set content-type
+                httpClient.setContentType(SERIALIZATION.toContentType(defaultSerialization));
+                httpClient.setSmartAPIMethodHeader(HttpClient.SMARTAPI_METHOD_REQUEST);
+                httpClient.setAcceptHeader(SERIALIZATION.toContentType(defaultSerialization));
+
+                try
+                {
+                    if (debug)
+                    {
+                        Console.WriteLine("\nRequest to SMARTAPI Search Service:");
+                        Console.WriteLine(messageBody + "\n");
+                    }
+
+                    // send message
+                    Task<string> responseString = httpClient.sendPost(serverUri, messageBody);
+                    try
+                    {
+                        responseString.Wait(); // wait until the recipient has responded to our request
+                    }
+                    catch (Exception ex)
+                    {
+                        Console.Error.WriteLine("The connection to the search service failed");
+                        Console.Error.WriteLine(ex);
+                    }
+
+                    String rsp = responseString.Result;
+                    if (debug)
+                    {
+                        Console.WriteLine("\nResponse from SMARTAPI Search Service:");
+                        Console.WriteLine(rsp + "\n");
+                    }
+                    Response response = (Response)Tools.fromStringAsObj(rsp, defaultSerialization);
+                    if (response != null)
+                    {
+                        if (response.hasActivity())
+                            return response.getFirstActivity().getEntities();
+                        else
+                            return null;
+                    }
+                    else
+                    {
+                        return null;
+                    }
+                }
+                catch (Exception e)
+                {
+                    Console.Error.WriteLine("Exception while sending an HTTP request to " + serverUri);
+                    Console.Error.WriteLine(e.StackTrace);
+                    return null;
+                }
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine("Exception while generating a search message.");
+                Console.Error.WriteLine(e.StackTrace);
+                return null;
+            }
+        }
+
+        public static List<Entity> searchByPointAndType(String myUri, int freshnessInDays, double latitude, double longitude, int distanceInKm, String[] types)
+        {
+            SearchAgent agent = new SearchAgent(myUri);
+            agent.anyOfTypes(types);
+            agent.daysOldData(freshnessInDays);
+            agent.pointSearchArea(new Coordinates(latitude, longitude), distanceInKm);
+            return agent.search();
+        }
+
+        public static List<Entity> searchByPointAndType(String myUri, double latitude, double longitude, int distanceInKm, String type)
+        {
+            SearchAgent agent = new SearchAgent(myUri);
+            if (type != null)
+                agent.ofType(type);            
+            agent.pointSearchArea(new Coordinates(latitude, longitude), distanceInKm);
+            return agent.search();
+        }
+
+        public static List<Entity> searchByNameAndType(String myUri, int freshnessInDays, String[] keywords, String[] types)
+        {
+            SearchAgent agent = new SearchAgent(myUri);
+            agent.anyOfTypes(types);
+            agent.daysOldData(freshnessInDays);
+            agent.anyOfNames(keywords);
+            return agent.search();
+        }
+
+        public static List<Entity> searchByName(String myUri, int freshnessInDays, String[] keywords)
+        {
+            SearchAgent agent = new SearchAgent(myUri);            
+            agent.daysOldData(freshnessInDays);
+            agent.anyOfNames(keywords);
+            return agent.search();
+        }
+
+        public static List<Entity> searchByName(String myUri, int freshnessInDays, String keyword)
+        {
+            SearchAgent agent = new SearchAgent(myUri);           
+            agent.daysOldData(freshnessInDays);
+            agent.ofName(keyword);
+            return agent.search();
+        }
+
+        public static List<Entity> searchById(String myUri, int freshnessInDays, String idRegex)
+        {
+            SearchAgent agent = new SearchAgent(myUri);
+            agent.ofType(RESOURCE.ENTITY);
+            agent.ofId(idRegex);
+            agent.daysOldData(freshnessInDays);
+            return agent.search();
+        }
+
+        public static List<Entity> searchById(String myId, String idRegex)
+        {
+            SearchAgent agent = new SearchAgent(myId);
+            agent.ofType(RESOURCE.ENTITY);
+            agent.ofId(idRegex);
+            return agent.search(RESOURCE.READ);
+        }
+
+        public static List<Entity> searchById(String myId, String idRegex, String type)
+        {
+            SearchAgent agent = new SearchAgent(myId);
+            agent.ofType(type);
+            agent.ofId(idRegex);
+            return agent.search(RESOURCE.READ);
+        }
+
+        public static List<Entity> searchByDescription(String myUri, int freshnessInDays, String searchString)
+        {
+            SearchAgent agent = new SearchAgent(myUri);
+            agent.ofType(RESOURCE.ENTITY);
+            agent.daysOldData(freshnessInDays);
+            agent.ofDescription(searchString);
+            return agent.search();
+        }
+
+        public static Entity fetchBySmartAPIId(String myUri, String idToFetch)
+        {
+            SearchAgent agent = new SearchAgent(myUri);
+            Entity e = new Entity(idToFetch);
+           
+            agent.setEntity(e);
+            List<Entity> res = agent.search();
+            if (res.Count > 0)
+            {
+                return res[0];
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        public static List<Entity> searchByType(String myId, String type)
+        {
+            SearchAgent agent = new SearchAgent(myId);
+            agent.ofType(type);
+            return agent.search();
+        }
+
+        public static List<Entity> searchByRegistrant(String myId, String registrantId)
+        {
+            SearchAgent agent = new SearchAgent(myId);
+            agent.ofRegistrant(registrantId);
+            return agent.search();
+        }
+
+        public static List<Entity> searchByRegistrant(String myId, String registrantId, String type)
+        {
+            SearchAgent agent = new SearchAgent(myId);
+            agent.ofRegistrant(registrantId);
+            agent.ofType(type);
+            return agent.search();
+        }
+
+        public void clear()
+        {
+            this.entity = new Entity();
+        }
+
+        public void setEntity(Entity entity)
+        {
+            this.entity = entity;
+        }
+
+        private String generateSearchMessage(String method)
+        {
+            Request request = RequestFactory.create(myIdentity);
+
+            Activity a = new Activity(ACTIVITIES.SEARCH);
+            request.setMethod(method);
+
+            request.addActivity(a);
+            a.addEntity(entity);
+                   // not multipart
+                   return Tools.toString(request, defaultSerialization);
+        }
+
+        /**
+         * Define search string for the name (rdfs:label) of the entity. Will return also partial hits.
+         * @param searchString search string
+         */
+        public void ofName(String searchString)
+        {
+            this.ofName(searchString, false);
+        }
+
+        public void ofId(String searchString)
+        {
+            Condition condition = new Condition();            
+            condition.addRegex("(?i)" + searchString);
+            entity.add(PROPERTY.ID, condition);
+        }
+
+        /**
+         * Define search string for the description (rdfs:comment) of the entity. Will return also partial hits.
+         * @param searchString search string
+         */
+        public void ofDescription(String searchString)
+        {
+            Condition condition = new Condition();
+            
+            condition.addRegex("(?i)" + searchString);
+            entity.add(PROPERTY.COMMENT, condition);
+        }
+
+        /**
+         * Define multiple search strings for the entity name (label). Will return also partial hits 
+         * for any of the strings.
+         * @param searchStrings
+         */
+        public void anyOfNames(String[] searchStrings)
+        {
+            if (searchStrings.Length > 0)
+            {
+                Condition condition = new Condition();
+                foreach (String str in searchStrings)
+                {         
+                    condition.addRegex("(?i)" + str);
+                }
+                entity.add(PROPERTY.RDFS_LABEL, condition);
+            }
+        }
+
+        /**
+         * Define search string for the name (rdfs:label) of the entity
+         * @param searchString search string
+         * @param exactMatch true if string has to match completely, false for partial hits
+         */
+        public void ofName(String searchString, bool exactMatch)
+        {
+            if (exactMatch)
+            {
+                entity.setName(searchString);
+            }
+            else
+            {
+                Condition condition = new Condition();                
+                condition.addRegex("(?i)" + searchString);
+                entity.add(PROPERTY.RDFS_LABEL, condition);
+            }
+        }
+
+        public void ofRegistrant(String id)
+        {
+            entity.add(PROPERTY.ISREGISTEREDBY, new Variant(new Uri(id)));
+        }
+
+        /**
+         * Define type to search
+         * @param type
+         */
+        public void ofType(String type)
+        {
+            entity.addType(type);
+        }
+
+        /**
+         * Define all the types that can match
+         * @param types
+         */
+        public void anyOfTypes(String[] types)
+        {
+            if (types.Length == 1)
+            {
+                this.ofType(types[0]);
+            }
+
+            if (types.Length > 1)
+            {
+                Condition condition = new Condition();
+                foreach (String type in types)
+                {
+                    // FIXME
+                    //condition.addOr(new Obj(type));
+                }
+                //entity.setType(condition);
+                entity.clearTypes();
+                entity.addType(RESOURCE.CONDITION);
+            }
+        }
+
+        public void clearTypes()
+        {
+            entity.clearTypes();
+        }
+
+        /**
+         * Define how many minutes old data will be searched.
+         * @param minutes
+         */
+        public void minutesOldData(int minutes)
+        {
+            try
+            {
+                TimeSpan duration = XmlConvert.ToTimeSpan(String.Format("P{0}Y{1}M{2}DT{3}H{4}M{5}S", 0, 0, 0, 0, minutes, 0));                
+                entity.add(PROPERTY.FRESHNESS, new Variant(duration));
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+            }
+        }
+
+        /**
+         * Define how many hours old data will be searched.
+         * @param hours
+         */
+        public void hoursOldData(int hours)
+        {
+            try
+            {
+                TimeSpan duration = XmlConvert.ToTimeSpan(String.Format("P{0}Y{1}M{2}DT{3}H{4}M{5}S", 0, 0, 0, hours, 0, 0));
+                entity.add(PROPERTY.FRESHNESS, new Variant(duration));
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+            }
+        }
+
+        /**
+         * Define how many days old data will be searched.
+         * @param days
+         */
+        public void daysOldData(int days)
+        {
+            try
+            {
+                TimeSpan duration = XmlConvert.ToTimeSpan(String.Format("P{0}Y{1}M{2}DT{3}H{4}M{5}S", 0, 0, days, 0, 0, 0));
+                entity.add(PROPERTY.FRESHNESS, new Variant(duration));
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+            }
+        }
+
+        /**
+         * Define how many months old data will be searched.
+         * @param months
+         */
+        public void monthsOldData(int months)
+        {
+            try
+            {
+                TimeSpan duration = XmlConvert.ToTimeSpan(String.Format("P{0}Y{1}M{2}DT{3}H{4}M{5}S", 0, months, 0, 0, 0, 0));
+                entity.add(PROPERTY.FRESHNESS, new Variant(duration));
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+            }
+        }
+
+        /**
+         * Define how many years old data will be searched.
+         * @param years
+         */
+        public void yearsOldData(int years)
+        {
+            try
+            {
+                TimeSpan duration = XmlConvert.ToTimeSpan(String.Format("P{0}Y{1}M{2}DT{3}H{4}M{5}S", years, 0, 0, 0, 0, 0));
+                entity.add(PROPERTY.FRESHNESS, new Variant(duration));
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+            }
+        }
+
+        /**
+         * Define polygon search area
+         * @param polygon list of coordinates
+         */
+        public void polygonSearchArea(List<Coordinates> polygon)
+        {
+            List<Obj> lo = polygon.ConvertAll(x => (Obj)x);
+            entity.add(PROPERTY.POLYGON, lo);
+        }
+
+        /**
+         * Define multipolygon search area
+         * @param polygons list of polygons
+         */
+        public void multipolygonSearchArea(List<List<Coordinates>> polygons)
+        {
+            // for each polygon
+            foreach (List<Coordinates> coords in polygons)
+            {
+                List<Obj> lo = coords.ConvertAll(x => (Obj)x);
+                entity.add(PROPERTY.POLYGON, lo);
+            }
+        }
+
+        /**
+         * Define bounding box search area
+         * @param minCoordinates
+         * @param maxCoordinates
+         */
+        public void rectangeSearchArea(Coordinates minCoordinates, Coordinates maxCoordinates)
+        {
+            entity.add(NS.SMARTAPI + "minLocation", minCoordinates);
+            entity.add(NS.SMARTAPI + "maxLocation", maxCoordinates);
+        }
+
+        /**
+         * Define circular search area
+         * @param center
+         * @param kilometers
+         */
+        public void pointSearchArea(Coordinates center, double kilometers)
+        {
+            Ring ring = new Ring();
+            ring.add(PROPERTY.LAT, center.getLatitude());
+            ring.add(PROPERTY.LONG, center.getLongitude());
+            ValueObject maxR = new ValueObject();
+            maxR.setQuantity(RESOURCE.LENGTH);
+            maxR.setUnit(RESOURCE.KILOMETER);
+            maxR.setValue(new Variant(kilometers));
+            ring.setMaxRadius(maxR);
+            entity.add(NS.SMARTAPI + "ring", ring);
+        }
+
+        /**
+         * Define ring shape search area
+         * @param center
+         * @param minRadius
+         * @param maxRadius
+         */
+        public void ringSearchArea(Coordinates center, double minRadius, double maxRadius)
+        {
+            Ring ring = new Ring();
+            ring.add(PROPERTY.LAT, center.getLatitude());
+            ring.add(PROPERTY.LONG, center.getLongitude());
+            ValueObject minR = new ValueObject();
+            minR.setQuantity(RESOURCE.LENGTH);
+            minR.setUnit(RESOURCE.KILOMETER);
+            minR.setValue(new Variant(minRadius));
+            ring.setMinRadius(minR);
+            ValueObject maxR = new ValueObject();
+            maxR.setQuantity(RESOURCE.LENGTH);
+            maxR.setUnit(RESOURCE.KILOMETER);
+            maxR.setValue(new Variant(maxRadius));
+            ring.setMaxRadius(maxR);
+            entity.add(NS.SMARTAPI + "ring", ring);
+        }
+
+        public void clearSearchArea()
+        {
+            entity.remove(PROPERTY.POLYGON);
+            entity.remove(NS.SMARTAPI + "maxLocation");
+            entity.remove(NS.SMARTAPI + "minLocation");
+            entity.remove(NS.SMARTAPI + "ring");
+        }
+    }
+}
\ No newline at end of file
diff --git a/Common/C#/SmartAPI/agents/SharingAgent.cs b/Common/C#/SmartAPI/agents/SharingAgent.cs
new file mode 100644 (file)
index 0000000..9b5d25e
--- /dev/null
@@ -0,0 +1,218 @@
+using System;
+using SmartAPI.Common;
+using SmartAPI.Model;
+using SmartAPI.Factory;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace SmartAPI.Agents
+{
+    public class SharingAgent : Agent
+    {
+        public SharingAgent(String myIdentity)
+        {
+            this.myIdentity = myIdentity;
+        }
+
+        public Entity share(String entityId, Availability availability, params Offering[] offering)
+        {
+            Entity entity = new Entity(entityId);
+            if (availability != null)
+            {
+                entity.addAvailability(availability);
+            }
+            if (offering != null && offering.Length > 0)
+            {
+                foreach (Offering o in offering)
+                {
+                    entity.addOffering(o);
+                }
+            }
+            return share(entity);
+        }
+
+        /// <summary>
+        /// Share entity 
+        /// </summary>
+        /// <param name="entity"></param>
+        /// <returns></returns>
+        public Entity share(Entity entity)
+        {
+            httpClient.setDebugMode(debug);
+            // add gr:offers property from offer maker to offering
+            Obj offerMaker = new Obj(this.myIdentity);
+            foreach (Offering offer in entity.getOfferings())
+            {
+                offerMaker.addOffering(offer);
+            }
+
+            Request request = RequestFactory.create(myIdentity);
+            Activity activity = request.newActivity(ACTIVITIES.SHARE);
+            activity.setMethod(RESOURCE.WRITE);
+            activity.addEntity(entity);
+
+            
+            try
+            {
+                // not multipart
+                httpClient.setContentType(SERIALIZATION.toContentType(defaultSerialization));
+                httpClient.setAcceptHeader(SERIALIZATION.toContentType(defaultSerialization));
+                // send message
+                Task<Response> response = httpClient.sendPost(serverUri, request, this.authenticationHeader);
+
+                try
+                {
+                    response.Wait(); // wait until the recipient has responded to our request
+                }
+                catch (Exception ex)
+                {
+                    Console.Error.WriteLine("The connection to the sharing service failed");
+                    Console.Error.WriteLine(ex);
+                }
+
+                Response resp = response.Result;
+                if (resp != null && resp.hasActivity() && resp.getFirstActivity().hasEntity())
+                    return resp.getFirstActivity().getEntities()[0];
+                else
+                    return null;
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine("Exception while generating a search message.");
+                Console.Error.WriteLine(e.StackTrace);
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// remove all sharings made by me
+        /// 
+        /// </summary>
+        /// <returns></returns>
+        public bool removeSharings()
+        {
+            return removeSharing(null);
+        }
+
+        /// <summary>
+        /// 
+        /// remove sharing of given entity
+        /// </summary>
+        /// <param name="entityId"></param>
+        /// <returns></returns>
+        public bool removeSharing(String entityId)
+        {
+            httpClient.setDebugMode(debug);
+            Request request = RequestFactory.create(myIdentity);
+            Activity activity = request.newActivity(ACTIVITIES.SHARE);
+            activity.setMethod(RESOURCE.DELETE);
+            if (entityId != null)
+            {
+                activity.addEntity(new Entity(entityId));
+            }
+            
+            try
+            {
+                // not multipart
+                httpClient.setContentType(SERIALIZATION.toContentType(defaultSerialization));
+                httpClient.setAcceptHeader(SERIALIZATION.toContentType(defaultSerialization));
+                // send message
+                Task<Response> response = httpClient.sendPost(serverUri, request, this.authenticationHeader);
+
+                try
+                {
+                    response.Wait(); // wait until the recipient has responded to our request
+                }
+                catch (Exception ex)
+                {
+                    Console.Error.WriteLine("The connection to the sharing service failed");
+                    Console.Error.WriteLine(ex);
+                }
+
+                Response resp = response.Result;
+                if (resp != null && !resp.hasErrors())
+                    return true;
+                else
+                    return false;
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine("Exception while generating a delete message.");
+                Console.Error.WriteLine(e.StackTrace);
+                return false;
+            }
+
+        }
+
+        public List<Entity> fetchSharings()
+        {
+            return doFetch(null);
+        }
+
+        public List<Entity> fetchSharings(Offering offering)
+        {
+            Entity e = new Entity();
+            e.addOffering(offering);
+            return doFetch(e);
+        }
+
+        public Entity fetchSharing(String entityId)
+        {
+            List<Entity> ret = doFetch(new Entity(entityId));
+            if (ret != null && ret.Count > 0)
+            {
+                return ret[0];
+            }
+            else
+            {
+                return new Entity();
+            }
+        }
+
+        private List<Entity> doFetch(Entity entity)
+        {
+            httpClient.setDebugMode(debug);
+            if (entity == null)
+            {
+                entity = new Entity();
+            }
+
+            Request request = RequestFactory.create(myIdentity);
+            Activity activity = request.newActivity(ACTIVITIES.SHARE);
+            activity.setMethod(RESOURCE.READ);
+            activity.addEntity(entity);
+            
+
+            try
+            {
+                // not multipart
+                httpClient.setContentType(SERIALIZATION.toContentType(defaultSerialization));
+                httpClient.setAcceptHeader(SERIALIZATION.toContentType(defaultSerialization));
+                // send message
+                Task<Response> response = httpClient.sendPost(serverUri, request, this.authenticationHeader);
+
+                try
+                {
+                    response.Wait(); // wait until the recipient has responded to our request
+                }
+                catch (Exception ex)
+                {
+                    Console.Error.WriteLine("The connection to the sharing service failed");
+                    Console.Error.WriteLine(ex);
+                }
+
+                Response resp = response.Result;
+                if (resp != null && resp.hasActivity() && resp.getFirstActivity().hasEntity())
+                    return resp.getFirstActivity().getEntities();
+                else
+                    return null;
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine("Exception while generating a search message.");
+                Console.Error.WriteLine(e.StackTrace);
+                return null;
+            }
+        }
+    }
+}
diff --git a/Common/C#/SmartAPI/agents/TradingAgent.cs b/Common/C#/SmartAPI/agents/TradingAgent.cs
new file mode 100644 (file)
index 0000000..019e8a4
--- /dev/null
@@ -0,0 +1,800 @@
+using System;
+using System.Text;
+using SmartAPI.Common;
+using SmartAPI.Rdf;
+using SmartAPI.Model;
+using SmartAPI.Factory;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Security.Cryptography;
+
+namespace SmartAPI.Agents
+{
+    public class TradingAgent:Agent
+    {        
+        public TradingAgent()
+        {
+        }
+        
+        /// <summary>
+        /// 
+        /// Creates an account on the Transaction Server.
+        /// </summary>
+        /// <param name="account"></param>
+        /// <param name="myIdentifier"></param>
+        /// <param name="privKey"></param>
+        /// <returns> true if account was successfully created</returns>
+        public bool createAccount(Account account, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT);
+            activity.setMethod(RESOURCE.INITIALIZE);
+            activity.newInput().add(PROPERTY.ACCOUNT, account);            
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Get an account with given parameters.
+        /// </summary>
+        /// <param name="sourceSystemUri"></param>
+        /// <param name="counterpartyUri"></param>
+        /// <param name="user"></param>
+        /// <param name="myIdentifier"></param>
+        /// <param name="privKey"></param>
+        /// <returns></returns>
+        public Account getAccount(String sourceSystemUri, String counterpartyUri, String user, String myIdentifier, RSAParameters privKey)
+        {
+            Account account = new Account();
+            account.setSourceSystemUri(sourceSystemUri);
+            account.setCounterPartyUri(counterpartyUri);
+            account.setUser(user);
+
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT);
+            activity.setMethod(RESOURCE.READ);
+            activity.newInput().add(PROPERTY.ACCOUNT, account);
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                            return (Account)a.getFirstOutput().get(PROPERTY.ACCOUNT)[0].asObj();
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Get an account with given identifier.
+        /// </summary>
+        /// <param name="accountUri"></param>
+        /// <param name="myIdentifier"></param>
+        /// <param name="privKey"></param>
+        /// <returns></returns>
+        public Account getAccount(String accountUri, String myIdentifier, RSAParameters privKey)
+        {
+            Account account = new Account(accountUri);
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT);
+            activity.setMethod(RESOURCE.READ);
+            activity.newInput().add(PROPERTY.ACCOUNT, account);
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            Output o = a.getFirstOutput();
+                            return (Account)o.get(PROPERTY.ACCOUNT)[0].asObj();
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        public List<Account> getAccountList(String myIdentifier, RSAParameters privKey)
+        {
+            return getAccountList(null, myIdentifier, privKey);
+        }
+
+        public List<Account> getAccountList(String sourceSystemUri, String myIdentifier, RSAParameters privKey)
+        {
+            Account account = new Account();
+            if (sourceSystemUri != null)
+            {
+                account.setSourceSystemUri(sourceSystemUri);
+            }
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT);
+            activity.setMethod(RESOURCE.READ);
+            activity.newInput().add(PROPERTY.ACCOUNT, account);
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            List<Variant> accs = a.getFirstOutput().get(PROPERTY.ACCOUNT);
+                            List<Account> results = new List<Account>();
+                            foreach (Variant acc in accs)
+                            {
+                                results.Add((Account)acc.asObj());
+                            }
+                            return results;
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+
+        }
+
+        public bool setAccount(Account account, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT);
+            activity.setMethod(RESOURCE.WRITE);
+            activity.newInput().add(PROPERTY.ACCOUNT, account);
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public bool createContract(Contract contract, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.CONTRACT);
+            activity.setMethod(RESOURCE.INITIALIZE);
+            activity.newInput().add(PROPERTY.CONTRACT, contract);
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public List<Contract> getContracts(String accountUri, String myIdentifier, RSAParameters privKey)
+        {
+            return getContracts(accountUri, null, myIdentifier, privKey);
+        }
+
+        public List<Contract> getContracts(String accountUri, String offeringUri, String myIdentifier, RSAParameters privKey)
+        {
+            Account account = new Account(accountUri);
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.CONTRACT);
+            activity.setMethod(RESOURCE.READ);
+            Input input = activity.newInput();
+            input.add(PROPERTY.ACCOUNT, account);
+            if (offeringUri != null)
+            {
+                input.add(PROPERTY.OFFERS, new Offering(offeringUri));
+            }
+
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            List<Variant> accs = a.getFirstOutput().get(PROPERTY.CONTRACT);
+                            List<Contract> results = new List<Contract>();
+                            foreach (Variant acc in accs)
+                            {
+                                results.Add((Contract)acc.asObj());
+                            }
+                            return results;
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+
+        }
+
+        public Contract getContract(String contractUri, String myIdentifier, RSAParameters privKey)
+        {
+            Contract contract = new Contract(contractUri);
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.CONTRACT);
+            activity.setMethod(RESOURCE.READ);
+            activity.newInput().add(PROPERTY.CONTRACT, contract);
+
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                            return (Contract)a.getFirstOutput().get(PROPERTY.CONTRACT)[0].asObj();
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        public bool setContract(Contract contract, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.CONTRACT);
+            activity.setMethod(RESOURCE.WRITE);
+            activity.newInput().add(PROPERTY.CONTRACT, contract);
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public List<AccountTransaction> getAccountTransactions(String accountId, String contractId, DateTime from, DateTime to, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_TRANSACTION);
+            activity.setMethod(RESOURCE.READ);
+            Input input = activity.newInput();
+            if (accountId != null)
+            {
+                input.add(PROPERTY.ACCOUNT, new Account(accountId));
+            }
+            if (contractId != null)
+            {
+                input.add(PROPERTY.CONTRACT, new Contract(contractId));
+            }
+            TemporalContext tcx = new TemporalContext();
+            input.add(PROPERTY.TEMPORALCONTEXT, tcx);
+            if (from != null)
+            {
+                tcx.setStart(from);
+            }
+            if (to != null)
+            {
+                tcx.setEnd(to);
+            }
+            Response resp = sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            List<Variant> accs = a.getFirstOutput().get(PROPERTY.ACCOUNTTRANSACTION);
+                            List<AccountTransaction> results = new List<AccountTransaction>();
+                            if (accs != null)
+                            {
+                                foreach (Variant acc in accs)
+                                {
+                                    results.Add((AccountTransaction)acc.asObj());
+                                }
+                            }
+                            return results;
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+
+        }
+
+        public bool addAccountTransaction(AccountTransaction accountTransaction, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_TRANSACTION);
+            activity.setMethod(RESOURCE.WRITE);
+            activity.newInput().add(PROPERTY.ACCOUNTTRANSACTION, accountTransaction);
+            Response resp = sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+
+        }
+
+        public ValueObject getAccountTransactionsSum(String accountId, DateTime from, DateTime to, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_TRANSACTION_SUM);
+            activity.setMethod(RESOURCE.READ);
+            Input input = activity.newInput();
+            if (accountId != null)
+            {
+                input.add(PROPERTY.ACCOUNT, new Account(accountId));
+            }            
+            TemporalContext tcx = new TemporalContext();
+            input.add(PROPERTY.TEMPORALCONTEXT, tcx);
+            if (from != null)
+            {
+                tcx.setStart(from);
+            }
+            if (to != null)
+            {
+                tcx.setEnd(to);
+            }
+            Response resp = sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            return a.getFirstOutput().getValueObjects()[0];
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+
+        }
+
+        public bool addAccountUserAsClient(String accountUri, String username, String myIdentifier, RSAParameters privKey)
+        {
+            Person p = new Person();
+            p.setUsername(username);
+            p.add("account_user_type", "client");
+            return addAccountUser(accountUri, p, myIdentifier, privKey);
+        }
+
+        public bool addAccountUserAsServiceProvider(String accountUri, String username, String myIdentifier, RSAParameters privKey)
+        {
+            Person p = new Person();
+            p.setUsername(username);
+            p.add("account_user_type", "service_provider");
+            return addAccountUser(accountUri, p, myIdentifier, privKey);
+        }
+
+        private bool addAccountUser(String accountUri, Person user, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_USER);
+            activity.setMethod(RESOURCE.INITIALIZE);
+            Input input = activity.newInput();
+            input.add(PROPERTY.ACCOUNT, new Account(accountUri));
+            input.add(PROPERTY.PERSON, user);
+            Response resp = sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public List<Person> getAccountUsers(String accountId, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_USER);
+            activity.setMethod(RESOURCE.READ);
+            activity.newInput().add(PROPERTY.ACCOUNT, new Account(accountId));
+           
+            Response resp = this.sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            List<Variant> accs = a.getFirstOutput().get(PROPERTY.PERSON);                            
+                            List<Person> results = new List<Person>();
+                            if (accs != null)
+                            {
+                                foreach (Variant acc in accs)
+                                {
+                                    results.Add((Person)acc.asObj());
+                                }
+                            }
+                            return results;
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        public bool removeAccountUser(String accountUri, String username, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_USER);
+            activity.setMethod(RESOURCE.DELETE);
+            Input input = activity.newInput();
+            input.add(PROPERTY.ACCOUNT, new Account(accountUri));
+            Person p = new Person();
+            p.setUsername(username);
+            input.add(PROPERTY.PERSON, p);
+            Response resp = sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public List<AccountAction> getAccountActions(String accountId, String myIdentifier, RSAParameters privKey)
+        {
+            return getAccountActions(accountId, null, null, myIdentifier, privKey);
+        }
+
+        public List<AccountAction> getAccountActions(String accountId, DateTime? from, DateTime? to, String myIdentifier, RSAParameters privKey)
+        {
+            Request request = RequestFactory.create(myIdentifier);
+            Activity activity = request.newActivity(ACTIVITIES.ACCOUNT_ACTION);
+            activity.setMethod(RESOURCE.READ);
+            Input input = activity.newInput();
+            if (accountId != null)
+            {
+                input.add(PROPERTY.ACCOUNT, new Account(accountId));
+            }           
+            TemporalContext tcx = new TemporalContext();
+            input.add(PROPERTY.TEMPORALCONTEXT, tcx);
+            if (from != null)
+            {
+                tcx.setStart(from.Value);
+            }
+            if (to != null)
+            {
+                tcx.setEnd(to.Value);
+            }
+            Response resp = sendRequest(request, serverUri, privKey);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity a in resp.getActivities())
+                    {
+                        if (a.hasErrors())
+                        {
+                            Tools.printErrors(a);
+                            return null;
+                        }
+                        if (a.hasOutput())
+                        {
+                            List<Variant> accs = a.getFirstOutput().get(PROPERTY.ACCOUNTACTION);
+                            List<AccountAction> results = new List<AccountAction>();
+                            if (results != null)
+                            {
+                                foreach (Variant acc in accs)
+                                {
+                                    results.Add((AccountAction)acc.asObj());
+                                }
+                            }
+                            return results;
+                        }
+                    }
+                    return null;
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        public Response sendRequest(Request req, String notary, RSAParameters privKey)
+        {
+            if (notary == null)
+                notary = URLs.TRANSACT_URI;
+            try
+            {
+                httpClient.setDebugMode(this.debugMode());
+                req.sign(privKey);
+                // multipart
+                HttpMessage message = Tools.serializeRequestToMessage(req, this.defaultSerialization);
+               
+                // send message
+                Task<Tuple<string, string>> response = httpClient.sendPost(serverUri, message, this.authenticationHeader);
+                try
+                {
+                    response.Wait(); // wait until the recipient has responded to our request
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine("Communication with Transaction server failed");
+                    Console.WriteLine(ex);
+                }
+
+               
+
+                // parse response   
+                Response resp = Tools.parseResponse(response.Result.Item1, response.Result.Item2, defaultSerialization);
+                if (resp != null)
+                {
+                    if (resp.hasErrors())
+                    {
+                        Console.Error.WriteLine("Communication with transaction server returned errors.");
+                        Tools.printErrors(resp);
+                        return null;
+                    }
+                    return resp;
+                }
+                return null;            
+            } catch ( Exception e ) {
+
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+                           return null;
+                   }
+        }
+
+
+    }
+}
diff --git a/Common/C#/SmartAPI/agents/TransactionAgent.cs b/Common/C#/SmartAPI/agents/TransactionAgent.cs
new file mode 100644 (file)
index 0000000..312610f
--- /dev/null
@@ -0,0 +1,429 @@
+using System;
+using SmartAPI.Common;
+using SmartAPI.Rdf;
+using SmartAPI.Model;
+using System.Security.Cryptography;
+using SmartAPI.Factory;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace SmartAPI.Agents
+{
+    public class TransactionAgent : Agent
+    { 
+        public TransactionAgent()
+        {
+            this.serverUri = URLs.TRANSACT_URI;
+        }
+
+        public TransactionAgent(String myUri)
+        {
+            this.myIdentity = myUri;
+            this.serverUri = URLs.TRANSACT_URI;
+        }
+
+        public String getDefaultNotary()
+        {
+            return this.serverUri;
+        }
+
+        public String storeObjectToNotary(String senderId, String notary, Obj obj, RSAParameters privKey)
+        {
+            Transaction transferTransaction = Factory.Factory.createTransaction(senderId);
+
+            transferTransaction.setSigner(senderId);
+            transferTransaction.setNotarizedObject(obj);
+           
+            // then send to server to store
+            return this.storeToTransactionServer(senderId, notary, transferTransaction, ACTIVITIES.STORE, privKey);
+        }
+
+        public List<Obj> fetchObjectFromNotary(String senderId, String notary, String transactionId, RSAParameters privKey)
+        {
+            List<Obj> ret = new List<Obj>();
+            Transaction transaction = Factory.Factory.createTransaction(transactionId, senderId);
+
+            Obj o = new Obj();
+            transaction.setNotarizedObject(o);
+            List<Transaction> allTs = new List<Transaction>();
+            allTs.Add(transaction);
+
+            // And then do the search
+            List<Transaction> lst = this.fetchFromTransactionServer(senderId, notary, allTs, ACTIVITIES.STORE, privKey);
+            foreach (Transaction trans in lst)
+            {
+                if (trans != null)
+                {
+                    if (trans.hasNotarizedObject())
+                        ret.Add(trans.getNotarizedObject());
+                    else
+                        Console.WriteLine("Returned transaction does not contain notarized object.");
+                }
+                else
+                {
+                    Console.WriteLine("Returned transaction was null.");
+                }
+            }
+            return ret;
+        }
+
+   
+        public String storeObjectToLedger(String senderId, String notary, Obj obj, RSAParameters privKey)
+        {
+            if (senderId.Length > 0 && obj != null && obj.hasIdentifierUri() && obj.hasOffering())
+            {
+                Transaction transaction = Factory.Factory.createTransaction(senderId);
+                transaction.setSigner(senderId);
+                transaction.setNotarizedObject(obj);
+                return storeToTransactionServer(senderId, notary, transaction, ACTIVITIES.LEDGER, privKey);
+            }
+            else
+            {
+                if (senderId.Length == 0)
+                    Console.WriteLine("Cannot notarize objects without specifying a sender");
+                if (obj == null || (obj != null && !obj.hasIdentifierUri()))
+                   Console.WriteLine("Cannot put into ledger objects that do not have an identifier");
+                if (obj == null || (obj != null && !obj.hasOffering()))
+                    Console.WriteLine("Cannot put into ledger objects that do not have an offering");
+            }
+
+            return null;
+        }
+
+
+        public List<Obj> fetchObjectFromLedger(String senderId, String notary, String transactionId, String objectId, RSAParameters privKey)
+        {
+
+            List<Obj> ret = new List<Obj>();
+            Transaction transaction = Factory.Factory.createTransaction(senderId);
+
+            Obj o = new Obj(transactionId);
+            transaction.setNotarizedObject(o);
+            List<Transaction> allTs = new List<Transaction>();
+            allTs.Add(transaction);
+
+            // And then do the search
+            List<Transaction> lst = fetchFromTransactionServer(senderId, notary, allTs, ACTIVITIES.LEDGER, privKey);
+            foreach (Transaction trans in lst)
+            {
+                if (trans != null)
+                {
+                    if (trans.hasNotarizedObject())
+                        ret.Add(trans.getNotarizedObject());
+                }
+            }
+
+            return ret;
+       }
+
+        public String sendKeyToNotary(String senderId, String objectId, String hashOfObject, String keyToDecryptObject, String signatureOfObject, String notary, RSAParameters privKey)
+        {
+            if (senderId != null && senderId.Length > 0 && objectId != null && objectId.Length > 0)
+            {
+                Transaction transaction = Factory.Factory.createTransaction(senderId);
+                transaction.setSigner(senderId);
+                Obj o = new Obj(objectId);
+                o.setHashCode(hashOfObject);
+                o.setSignature(signatureOfObject);
+                o.setSessionKey(keyToDecryptObject);
+                transaction.setNotarizedObject(o);
+                return storeToTransactionServer(senderId, notary, transaction, ACTIVITIES.KEYSTORE, privKey);
+            }
+
+            Console.WriteLine("Cannot notarize objects that do not have an identifier and the identifier of the system that generated them (generatedBy)");
+            return null;
+        }
+        
+
+        public String fetchKeyFromNotary(String senderId, String objectId, String objectHash, String objectSignature, String notary, RSAParameters? privKey = null)
+        {
+            String key = null;
+            Transaction transaction = Factory.Factory.createTransaction(senderId);
+            transaction.setSigner(senderId);
+            Obj o = new Obj(objectId);
+            o.setHashCode(objectHash);
+            o.setSignature(objectSignature);
+            transaction.setNotarizedObject(o);
+
+            List<Transaction> allTs = new List<Transaction>();
+            allTs.Add(transaction);
+
+            List<Transaction> lst = this.fetchFromTransactionServer(senderId, notary, allTs, ACTIVITIES.KEYSTORE, privKey);
+            foreach (Transaction transFound in lst)
+            {
+                if (transFound != null)
+                    if (transFound.hasNotarizedObject())
+                        if (transFound.getNotarizedObject().getIdentifierUri() == objectId)
+                            key = transFound.getNotarizedObject().getSessionKey();
+                else
+                    Console.WriteLine("TransactionAgent error: Requested transaction can not be found from notary!");
+            }
+            return key;
+        }
+
+        /*
+         The transaction server stores Transaction objects, signs them and offers them for authenticated retrieval.
+         To be eligible for storing, the transaction server requires
+         - the transaction to store _in its original text format that matches the hash sent_
+         - a hash of the transaction
+         - a signature of the hash of the transaction.
+
+
+         To be able to send the original text format of the transaction, the content of the transaction is always
+         placed in a separate MIME multipart. The Transaction server will extract this part, verify that the
+         hash and signature matches the part and if so, stores these values.
+
+         The transaction server also checks that the messages sent to it come from authorized parties.So to
+         send the transaction, it must be placed in a request and the request itself must be signed.Therefore
+         a minimum of two signatures must exist in the message
+         - the signature of the transaction; and
+         - the signature of the request
+
+         The transaction that is sent may further contain some number of objects which can be signed or encrypted.Their contents
+         are automatically placed in the corresponding slots of the eventual message.
+         
+        */
+        public String storeToTransactionServer(String senderId, String notary, Transaction transaction, String activityId, RSAParameters privKey)
+        {
+            // construct Request object
+            Request req = RequestFactory.create(senderId);
+            Activity a = new Activity(activityId);
+            a.setMethod(RESOURCE.WRITE);
+            req.addActivity(a);
+
+            transaction.sign(privKey);
+            a.setTransaction(transaction);
+
+            // Finally, sign our main request
+            req.sign(privKey);
+
+            Response resp = sendRequest(req, serverUri);
+            if (resp != null)
+            {
+                if (!resp.hasErrors())
+                {
+                    foreach (Activity ac in resp.getActivities())
+                    {
+                        if (ac.hasErrors())
+                        {
+                            Tools.printErrors(ac);
+                            return null;
+                        }
+                    }
+                    return transaction.getIdentifierUri();
+                }
+                else
+                {
+                    Tools.printErrors(resp);
+                    return null;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+        /*
+        public String storeToTransactionServer(String senderId, String notary, Transaction transaction, String activityId, RSAParameters privKey)
+        {
+
+            HttpClient client = new HttpClient();
+            client.setDebugMode(this.debugMode());
+            HttpMessage sentHttpMessage = new HttpMessage();
+
+            // Process the transaction first into the format we need for storage
+            // This is the text representation of the object and needs to be exactly in the same
+            // format as will be during transit (pay attention to blank rows, line endings etc)
+            String transactionSerialization = Tools.toString(transaction, SERIALIZATION.TURTLE);
+
+            //... and the hash that matches the representation
+            String transactionHash = SmartAPICrypto.createEncodedMessageDigest(transactionSerialization);
+
+            // ... and a signature of the representation
+            String transactionSignature = SmartAPICrypto.sign(privKey, transactionSerialization);
+
+            // construct Request object
+            Request req = RequestFactory.create(senderId);
+            Activity a = new Activity(activityId);
+            a.setMethod(RESOURCE.WRITE);
+            req.addActivity(a);
+
+            Transaction t = new Transaction(transaction.getIdentifierUri());
+            t.setSignature(transactionSignature);
+            t.setHashCode(transactionHash);
+            t.addType(RESOURCE.REFERENCE);
+            t.addType(RESOURCE.MULTIPARTREFERENCE);
+            a.setTransaction(t);
+
+            // Finally, sign our main request
+            req.sign(privKey);
+
+            // The data is now ready to be serialized into the message.
+            sentHttpMessage = Tools.serializeRequestToMessage(req, SERIALIZATION.TURTLE);
+            sentHttpMessage.add(transaction.getIdentifierUri(), transactionSerialization, "text/turtle");
+
+            // send out this multipart message  
+            Task<Tuple<String, String>> respAndContentType = client.sendPost(notary, sentHttpMessage, this.authenticationHeader);
+
+            return transaction.getIdentifierUri();
+        }
+        */
+
+        public List<Transaction> fetchFromTransactionServer(String senderId, String notary, List<Transaction> transactions, String activityId, RSAParameters? privKey = null)
+        {
+            List<Transaction> lst = new List<Transaction>();
+
+            // construct Request object
+            Request req = RequestFactory.create(senderId);
+            Activity a = new Activity(activityId);
+            a.setMethod(RESOURCE.READ);
+            req.addActivity(a);
+
+            // The transactions we add are just empty shells (as is specified in the read protocol of Smart API)
+            // We just have the identifiers which specify exactly which transactions should be fetched.
+            // However, note that when notarized keys are fetched, the server will refuse to return anything unless
+            // the hash of the key is included. This is in the message part of the transaction. Therefore copy
+            // the full transaction into the Activity.
+            foreach (Transaction transaction in transactions)
+            {
+                a.setTransaction(transaction);
+            }
+
+            // Now just sign it and send it
+            if (privKey != null)
+            {
+                req.sign(privKey);
+            }
+
+            Response resp = sendRequest(req, serverUri);
+            if (resp != null)
+            {
+                if (resp.hasErrors())
+                {
+                    Tools.printErrors(resp);
+                }
+                Activity ar = resp.firstActivity();
+                if (ar != null)
+                {
+                    if (ar.hasErrors())
+                    {
+                        Tools.printErrors(ar);
+                    }
+                    Transaction tr = ar.getTransaction();
+                    if (tr != null)
+                    {
+                        lst.Add(tr);
+                    }
+                    else
+                    {
+                        Console.WriteLine("No transaction in the server response activity");
+                    }
+                }
+                else
+                {
+                    Console.WriteLine("No activity in the server response");
+                }
+            }
+            else
+            {
+                Console.WriteLine("Server response was null");
+            }
+            return lst;
+        }
+
+        /*
+        public List<Transaction> fetchFromTransactionServer(String senderId, String notary, List<Transaction> transactions, String activityId, RSAParameters privKey)
+        {
+            HttpClient client = new HttpClient();
+            client.setDebugMode(this.debugMode());
+            List<Transaction> lst = new List<Transaction>();
+
+            // main request
+            Request req = RequestFactory.create(senderId);
+            Activity a = new Activity(activityId);
+            a.setMethod(RESOURCE.READ);
+            req.addActivity(a);
+
+            // The transactions we add are just empty shells (as is specified in the read protocol of Smart API)
+            // We just have the identifiers which specify exactly which transactions should be fetched.
+            // However, note that when notarized keys are fetched, the server will refuse to return anything unless
+            // the hash of the key is included. This is in the message part of the transaction. Therefore copy
+            // the full transaction into the Activity.
+            foreach(Transaction transaction in transactions)
+            {
+                a.setTransaction(transaction);
+            }
+
+            // Now just sign it and send it
+            req.sign(privKey);
+            HttpMessage httpMessage = Tools.serializeRequestToMessage(req, SERIALIZATION.TURTLE);
+            
+            // send out this multipart message  
+            Task<Tuple<String, String>> respAndContentType = client.sendPost(notary, httpMessage, this.authenticationHeader);
+            respAndContentType.Wait();
+            Tuple<String, String> rsp = respAndContentType.Result;
+            Response responseObj = Tools.parseResponse(rsp.Item1, rsp.Item2, SERIALIZATION.TURTLE);
+
+            if (responseObj != null)
+            {
+                Activity ar = responseObj.firstActivity();
+                if (ar != null) {
+                    Transaction tr = ar.getTransaction();
+                    if (tr != null)
+                        lst.Add(tr);
+                }
+
+            }
+            else
+                Console.WriteLine("No transaction in the server response");
+
+            return lst;
+        }
+        */
+
+        public Response sendRequest(Request req, String notary)
+        {
+            if (notary == null)
+                notary = URLs.TRANSACT_URI;
+            try
+            {
+                httpClient.setDebugMode(this.debugMode());
+                // multipart
+                HttpMessage message = Tools.serializeRequestToMessage(req, this.defaultSerialization);
+
+                // send message
+                Task<Tuple<string, string>> response = httpClient.sendPost(serverUri, message, this.authenticationHeader);
+                try
+                {
+                    response.Wait(); // wait until the recipient has responded to our request
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine("Communication with Transaction server failed");
+                    Console.WriteLine(ex);
+                }
+                // parse response   
+                Response resp = Tools.parseResponse(response.Result.Item1, response.Result.Item2, defaultSerialization);
+                if (resp != null)
+                {
+                    if (resp.hasErrors())
+                    {
+                        Console.Error.WriteLine("Communication with transaction server returned errors.");
+                        Tools.printErrors(resp);
+                        return null;
+                    }
+                    return resp;
+                }
+                return null;
+            }
+            catch (Exception e)
+            {
+                Console.Error.WriteLine(e.Message);
+                Console.Error.WriteLine(e.StackTrace);
+                return null;
+            }
+        }
+    }
+}
diff --git a/Common/C#/SmartAPI/app.config b/Common/C#/SmartAPI/app.config
new file mode 100644 (file)
index 0000000..3e1e85d
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.4.9.5" newVersion="1.4.9.5"/>
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="VDS.Common" publicKeyToken="ab5f4eb908061bf0" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.6.3.0" newVersion="1.6.3.0"/>
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
diff --git a/Common/C#/SmartAPI/common/ACTIVITIES.cs b/Common/C#/SmartAPI/common/ACTIVITIES.cs
new file mode 100644 (file)
index 0000000..48e6bf0
--- /dev/null
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SmartAPI.Common
+{
+    public sealed class ACTIVITIES
+    {
+        public const String SMARTAPI_DOMAIN = "http://smart-api.io/";
+
+        public const String REGISTER = SMARTAPI_DOMAIN + "activity/register/v1.0";
+           public const String SEARCH = SMARTAPI_DOMAIN + "activity/search/v1.0";
+           public const String SHARE = SMARTAPI_DOMAIN + "activity/share/v1.0";
+           public const String STORE = SMARTAPI_DOMAIN + "activity/store/v1.0";
+           public const String KEYSTORE = SMARTAPI_DOMAIN + "activity/keystore/v1.0";
+           public const String LEDGER = SMARTAPI_DOMAIN + "activity/ledger/v1.0";
+           public const String ACCOUNT = SMARTAPI_DOMAIN + "activity/account/v1.0";
+           public const String ACCOUNT_TRANSACTION = SMARTAPI_DOMAIN + "activity/account-transaction/v1.0";
+           public const String ACCOUNT_TRANSACTION_SUM = SMARTAPI_DOMAIN + "activity/account-transaction-sum/v1.0";
+           public const String ACCOUNT_ACTION = SMARTAPI_DOMAIN + "activity/account-action/v1.0";
+           public const String ACCOUNT_USER = SMARTAPI_DOMAIN + "activity/account-user/v1.0";
+           public const String CONTRACT = SMARTAPI_DOMAIN + "activity/contract/v1.0";
+    }
+}
diff --git a/Common/C#/SmartAPI/common/Bictionary.cs b/Common/C#/SmartAPI/common/Bictionary.cs
new file mode 100644 (file)
index 0000000..26a8fc3
--- /dev/null
@@ -0,0 +1,131 @@
+using System;
+using System.Collections.Generic;
+
+namespace SmartAPI.Common
+{
+    public class Bictionary<T1, T2>
+    {
+        IDictionary<T1, T2> firstToSecond = new Dictionary<T1, T2>();
+        IDictionary<T2, T1> secondToFirst = new Dictionary<T2, T1>();
+
+        public Bictionary()
+        {
+        }
+
+        public void Add(T1 first, T2 second)
+        {
+            if (firstToSecond.ContainsKey(first) || secondToFirst.ContainsKey(second))
+                throw new ArgumentException("Duplicate first or second");
+
+            firstToSecond.Add(first, second);
+            secondToFirst.Add(second, first);
+        }
+
+        public Boolean ContainsFirst(T1 first)
+        {
+            if (firstToSecond.ContainsKey(first))
+                return true;
+
+            return false;
+        }
+
+        public Boolean ContainsSecond(T2 second)
+        {
+            if (secondToFirst.ContainsKey(second))
+                return true;
+
+            return false;
+        }
+
+        public T2 GetByFirst(T1 first)
+        {
+            T2 second;
+            if (!firstToSecond.TryGetValue(first, out second))
+                return second;
+
+            return second;
+        }
+
+        public T1 GetBySecond(T2 second)
+        {
+            T1 first;
+            if (!secondToFirst.TryGetValue(second, out first))
+                return first;
+
+            return first;
+        }
+
+        public void RemoveByFirst(T1 first)
+        {
+            T2 second;
+            if (!firstToSecond.TryGetValue(first, out second))
+                throw new ArgumentException("first");
+
+            firstToSecond.Remove(first);
+            secondToFirst.Remove(second);
+        }
+
+        public void RemoveBySecond(T2 second)
+        {
+            T1 first;
+            if (!secondToFirst.TryGetValue(second, out first))
+                throw new ArgumentException("second");
+
+            secondToFirst.Remove(second);
+            firstToSecond.Remove(first);
+        }
+
+  &nb