├── conveyor-parallel ├── .gitignore ├── src │ ├── main │ │ ├── resources │ │ │ └── MANIFEST.MF │ │ └── java │ │ │ └── com │ │ │ └── aegisql │ │ │ └── conveyor │ │ │ └── parallel │ │ │ └── utils │ │ │ └── task_pool_conveyor │ │ │ ├── TaskId.java │ │ │ ├── TaskManagerLabel.java │ │ │ ├── RoundRobinLoop.java │ │ │ ├── TaskExecutor.java │ │ │ ├── TaskManager.java │ │ │ └── TaskPoolConveyorMBean.java │ └── test │ │ ├── resources │ │ └── log4j.properties │ │ └── java │ │ └── com │ │ └── aegisql │ │ └── conveyor │ │ ├── parallel │ │ └── utils │ │ │ └── task_pool_conveyor │ │ │ └── RoundRobinLoopTest.java │ │ ├── PropertiesBuilder.java │ │ └── multichannel │ │ └── UserBuilderEvents.java ├── .settings │ └── .gitignore └── pom.xml ├── conveyor-persistence ├── .gitignore ├── conveyor-persistence-core │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── MANIFEST.MF │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── aegisql │ │ │ │ └── conveyor │ │ │ │ └── persistence │ │ │ │ ├── cleanup │ │ │ │ └── SingleKey.java │ │ │ │ ├── converters │ │ │ │ ├── ObjectToByteArrayConverter.java │ │ │ │ ├── arrays │ │ │ │ │ ├── ObjectArrayToByteArrayConverter.java │ │ │ │ │ ├── BytesPrimToBytesConverter.java │ │ │ │ │ ├── sql │ │ │ │ │ │ ├── SqlDatesToBytesConverter.java │ │ │ │ │ │ ├── SqlTimesToBytesConverter.java │ │ │ │ │ │ └── SqlTimestampsToBytesConverter.java │ │ │ │ │ ├── BytesToBytesConverter.java │ │ │ │ │ ├── ClassesToBytesConverter.java │ │ │ │ │ └── BooleansToBytesConverter.java │ │ │ │ ├── BitSetToBytesConverter.java │ │ │ │ ├── ClassToBytesConverter.java │ │ │ │ ├── NullConverter.java │ │ │ │ ├── ByteToBytesConverter.java │ │ │ │ ├── BooleanToBytesConverter.java │ │ │ │ ├── StringToBytesConverter.java │ │ │ │ ├── BigIntegerToBytesConverter.java │ │ │ │ ├── LongToBytesConverter.java │ │ │ │ ├── FloatToBytesConverter.java │ │ │ │ ├── ShortToBytesConverter.java │ │ │ │ ├── DoubleToBytesConverter.java │ │ │ │ ├── CharToBytesConverter.java │ │ │ │ ├── IntegerToBytesConverter.java │ │ │ │ ├── DateToBytesConverter.java │ │ │ │ ├── BigDecimalToBytesConverter.java │ │ │ │ ├── ProtobufToBytesConverter.java │ │ │ │ └── sql │ │ │ │ │ ├── SqlDateToBytesConverter.java │ │ │ │ │ ├── SqlTimeToBytesConverter.java │ │ │ │ │ └── SqlTimestampToBytesConverter.java │ │ │ │ ├── archive │ │ │ │ ├── ArchiveStrategy.java │ │ │ │ └── Archiver.java │ │ │ │ ├── core │ │ │ │ ├── ObjectConverter.java │ │ │ │ ├── PersistenceException.java │ │ │ │ ├── PersistenceInit.java │ │ │ │ └── LazyPersistenceSupplier.java │ │ │ │ └── utils │ │ │ │ └── CartOutputStream.java │ │ └── test │ │ │ ├── resources │ │ │ ├── user.proto │ │ │ ├── user.avsc │ │ │ └── log4j.properties │ │ │ └── java │ │ │ └── com │ │ │ └── aegisql │ │ │ └── conveyor │ │ │ └── persistence │ │ │ ├── core │ │ │ ├── harness │ │ │ │ ├── TrioPart.java │ │ │ │ ├── TrioBuilder.java │ │ │ │ ├── ThreadPool.java │ │ │ │ └── TrioConveyor.java │ │ │ ├── BinaryLogConfigTest.java │ │ │ └── EncryptingConverterBuilderTest.java │ │ │ └── utils │ │ │ └── PersistUtilsTest.java │ ├── testZip 2 │ │ ├── test1.cart │ │ └── test2.cart │ └── .settings │ │ └── .gitignore ├── conveyor-persistence-jdbc │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── MANIFEST.MF │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── aegisql │ │ │ │ └── conveyor │ │ │ │ └── persistence │ │ │ │ └── jdbc │ │ │ │ ├── builders │ │ │ │ ├── package.html │ │ │ │ └── RestoreOrder.java │ │ │ │ ├── converters │ │ │ │ ├── StringLabelConverter.java │ │ │ │ ├── MapToJsonConverter.java │ │ │ │ ├── StringConverter.java │ │ │ │ └── EnumConverter.java │ │ │ │ └── engine │ │ │ │ ├── connectivity │ │ │ │ └── ConnectionDefaults.java │ │ │ │ ├── statement_executor │ │ │ │ ├── CachingStatementExecutor.java │ │ │ │ └── NonCachingStatementExecutor.java │ │ │ │ ├── derby │ │ │ │ ├── DerbyEngine.java │ │ │ │ └── DerbyMemoryEngine.java │ │ │ │ ├── mariadb │ │ │ │ └── MariaDbEngine.java │ │ │ │ └── mysql │ │ │ │ └── MysqlEngine.java │ │ └── test │ │ │ ├── resources │ │ │ └── log4j.properties │ │ │ └── java │ │ │ └── com │ │ │ └── aegisql │ │ │ └── conveyor │ │ │ └── persistence │ │ │ └── core │ │ │ └── harness │ │ │ ├── TrioPart.java │ │ │ ├── TrioPartExpireable.java │ │ │ ├── TrioBuilder.java │ │ │ ├── SummBuilder.java │ │ │ ├── TrioBuilderExpireable.java │ │ │ ├── ThreadPool.java │ │ │ └── TrioConveyor.java │ ├── .settings │ │ └── .gitignore │ └── .gitignore ├── .settings │ └── .gitignore └── src │ ├── main │ └── java │ │ └── org │ │ └── conveyor │ │ └── persistence │ │ └── App.java │ └── test │ └── java │ └── org │ └── conveyor │ └── persistence │ └── AppTest.java ├── doc └── img │ ├── builder1.png │ ├── builder2.png │ ├── builder3.png │ ├── builder4.png │ ├── builder5.png │ ├── builder6.png │ ├── builder7.png │ ├── pc1mbean.png │ ├── pc2mbean.png │ ├── Aggregator.gif │ ├── cart1.001.jpeg │ ├── cart-struct.umd3 │ ├── AggregatorIcon.gif │ ├── priority_queue.png │ └── no_priority_queue.png ├── .gitignore ├── conveyor-core ├── .gitignore ├── src │ ├── main │ │ ├── resources │ │ │ └── MANIFEST.MF │ │ └── java │ │ │ └── com │ │ │ └── aegisql │ │ │ └── conveyor │ │ │ ├── utils │ │ │ ├── Wrapped.java │ │ │ ├── queue_pump │ │ │ │ ├── PumpId.java │ │ │ │ ├── PumpLabel.java │ │ │ │ └── ScalarHolder.java │ │ │ ├── map │ │ │ │ └── MapConveyor.java │ │ │ ├── schedule │ │ │ │ ├── SchedulableClosure.java │ │ │ │ └── Schedule.java │ │ │ ├── delay_line │ │ │ │ ├── DelayLineConveyor.java │ │ │ │ └── DelayLineBuilder.java │ │ │ ├── collection │ │ │ │ ├── CollectionBuilder.java │ │ │ │ └── CollectionConveyor.java │ │ │ ├── scalar │ │ │ │ └── ScalarConvertingConveyor.java │ │ │ ├── caching │ │ │ │ └── ImmutableValueConsumer.java │ │ │ └── KeyValue.java │ │ │ ├── serial │ │ │ ├── SerializableRunnable.java │ │ │ ├── SerializableSupplier.java │ │ │ ├── SerializableBiConsumer.java │ │ │ ├── SerializableConsumer.java │ │ │ ├── SerializableFunction.java │ │ │ ├── SerializablePredicate.java │ │ │ └── SerializableBiPredicate.java │ │ │ ├── validation │ │ │ └── DuplicateValueException.java │ │ │ ├── TimeoutAction.java │ │ │ ├── AbstractBin.java │ │ │ ├── FootageKeeper.java │ │ │ ├── consumers │ │ │ ├── result │ │ │ │ ├── RunnableConsumer.java │ │ │ │ ├── IgnoreResult.java │ │ │ │ ├── ProductConsumer.java │ │ │ │ └── ObservableResultConsumer.java │ │ │ └── scrap │ │ │ │ ├── IgnoreScrap.java │ │ │ │ ├── ObservableScrapConsumer.java │ │ │ │ └── LastScrapReference.java │ │ │ ├── Interruptable.java │ │ │ ├── Acknowledge.java │ │ │ ├── Testing.java │ │ │ ├── TestingState.java │ │ │ ├── Status.java │ │ │ ├── FutureSupplier.java │ │ │ ├── ConveyorInitiatingService.java │ │ │ ├── cart │ │ │ └── LoadType.java │ │ │ └── InitiationServiceRegister.java │ └── test │ │ ├── resources │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── com.aegisql.conveyor.ConveyorInitiatingService │ │ └── log4j.properties │ │ └── java │ │ └── com │ │ └── aegisql │ │ └── conveyor │ │ ├── poc │ │ ├── aggregator │ │ │ └── model │ │ │ │ ├── State.java │ │ │ │ ├── OrderStatus.java │ │ │ │ ├── Order.java │ │ │ │ ├── Inventory.java │ │ │ │ └── Item.java │ │ ├── thread_pool │ │ │ ├── RoundRobinLoop.java │ │ │ └── TaskHolder.java │ │ ├── TestProdBuilder.java │ │ ├── TestProd.java │ │ └── LinkedHashMapAccessOrderTest.java │ │ ├── demo │ │ ├── reflection │ │ │ ├── Address.java │ │ │ ├── PersonBuilder.java │ │ │ └── Person.java │ │ ├── DemoTests.java │ │ ├── word_count │ │ │ ├── WordCounter.java │ │ │ └── CountedWord.java │ │ ├── map_reduce │ │ │ ├── WordCounter.java │ │ │ └── WordCount.java │ │ ├── weather │ │ │ └── MonthSummaryLabels.java │ │ ├── simple_builder │ │ │ ├── PersonBuilder.java │ │ │ ├── Person.java │ │ │ └── Demo.java │ │ ├── simple_conveyor │ │ │ ├── PersonBuilder.java │ │ │ └── Person.java │ │ ├── smart_conveyor_labels │ │ │ ├── PersonBuilderLabel.java │ │ │ ├── Person.java │ │ │ └── PersonBuilder.java │ │ ├── scalar_conveyor │ │ │ ├── PersonBuilder.java │ │ │ └── Person.java │ │ ├── simple_builder_asynch │ │ │ ├── PersonBuilder.java │ │ │ └── Person.java │ │ ├── smart_conveyor │ │ │ ├── Person.java │ │ │ └── PersonBuilder.java │ │ ├── caching_conveyor │ │ │ ├── Person.java │ │ │ └── PersonBuilder.java │ │ ├── conveyor_timeout │ │ │ ├── Person.java │ │ │ └── PersonBuilder.java │ │ ├── conveyor_smart_builder │ │ │ └── Person.java │ │ ├── conveyor_timeout_action │ │ │ └── Person.java │ │ └── ThreadPool.java │ │ ├── cart │ │ ├── command │ │ │ ├── CreateCommandTest.java │ │ │ └── GeneralCommandTest.java │ │ ├── ShoppingCartTest.java │ │ ├── ResultConsumerCartTest.java │ │ └── MultiKeyCartTest.java │ │ ├── consumers │ │ ├── scrap │ │ │ ├── IgnoreScrapTest.java │ │ │ ├── ScrapCounterTest.java │ │ │ ├── StreamScrapTest.java │ │ │ └── LastScrapsTest.java │ │ └── result │ │ │ ├── ResultCounterTest.java │ │ │ ├── RunnableConsumerTest.java │ │ │ └── ForwardResultTest.java │ │ ├── serial │ │ ├── SerializablePredicateTest.java │ │ └── SerializableBiPredicateTest.java │ │ ├── utils │ │ ├── queue_pump │ │ │ └── QueuePumpTest.java │ │ ├── MultiValueTest.java │ │ ├── SimpleTestService.java │ │ ├── ConveyorAdapterTest.java │ │ ├── KeyValueTest.java │ │ └── counter │ │ │ └── CounterTest.java │ │ ├── TestUtils.java │ │ ├── LazyConveyorSupplierTest.java │ │ ├── ConveyorRuntimeExceptionTest.java │ │ ├── user │ │ ├── LowerUser.java │ │ ├── UpperUser.java │ │ ├── LowerCaseUserBuilder.java │ │ ├── UpperCaseUserBuilder.java │ │ ├── UserBuilderEvents4.java │ │ └── UserBuilderEvents3.java │ │ ├── KeepRunningConveyorExceptionTest.java │ │ ├── BuilderAndFutureSupplierTest.java │ │ ├── AcknowledgeStatusTest.java │ │ ├── ConveyorTest.java │ │ ├── ReadinessPredicateTest.java │ │ ├── ConveyorInitiatingServiceTest.java │ │ └── delay │ │ └── DelayBoxTest.java ├── .settings │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs └── .project ├── .settings ├── org.eclipse.core.resources.prefs └── org.eclipse.m2e.core.prefs ├── TODO ├── conveyor-configurator ├── .gitignore ├── src │ ├── main │ │ ├── resources │ │ │ └── MANIFEST.MF │ │ └── java │ │ │ └── com │ │ │ └── aegisql │ │ │ └── conveyor │ │ │ └── config │ │ │ └── AssemblingConveyorMI.java │ └── test │ │ ├── resources │ │ ├── test1.yml │ │ ├── test1.yaml │ │ ├── log4j.properties │ │ ├── types.properties │ │ ├── test13.yml │ │ ├── test9.yml │ │ ├── test11.yml │ │ ├── test12.yml │ │ └── test14.properties │ │ └── java │ │ └── com │ │ └── aegisql │ │ └── conveyor │ │ └── config │ │ ├── harness │ │ ├── TestBean.java │ │ ├── IntegerSupplier.java │ │ ├── NameLabel.java │ │ └── StringSupplier.java │ │ └── OrderedPropertiesTest.java └── .settings │ └── .gitignore ├── .github └── dependabot.yml ├── LICENSE └── .project /conveyor-parallel/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /conveyor-persistence/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /doc/img/builder1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder1.png -------------------------------------------------------------------------------- /doc/img/builder2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder2.png -------------------------------------------------------------------------------- /doc/img/builder3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder3.png -------------------------------------------------------------------------------- /doc/img/builder4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder4.png -------------------------------------------------------------------------------- /doc/img/builder5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder5.png -------------------------------------------------------------------------------- /doc/img/builder6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder6.png -------------------------------------------------------------------------------- /doc/img/builder7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/builder7.png -------------------------------------------------------------------------------- /doc/img/pc1mbean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/pc1mbean.png -------------------------------------------------------------------------------- /doc/img/pc2mbean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/pc2mbean.png -------------------------------------------------------------------------------- /doc/img/Aggregator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/Aggregator.gif -------------------------------------------------------------------------------- /doc/img/cart1.001.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/cart1.001.jpeg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /bin/ 3 | /.settings/ 4 | .classpath 5 | .project 6 | .idea/ 7 | .gradle/ 8 | -------------------------------------------------------------------------------- /conveyor-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /bin/ 3 | /.settings/ 4 | .classpath 5 | .project 6 | *.txt 7 | -------------------------------------------------------------------------------- /doc/img/cart-struct.umd3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/cart-struct.umd3 -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Add more supported databases 2 | Add initialization from sql script defined by path or YAML file 3 | -------------------------------------------------------------------------------- /doc/img/AggregatorIcon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/AggregatorIcon.gif -------------------------------------------------------------------------------- /doc/img/priority_queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/priority_queue.png -------------------------------------------------------------------------------- /conveyor-core/src/main/resources/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Automatic-Module-Name: conveyor.core 3 | -------------------------------------------------------------------------------- /doc/img/no_priority_queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/doc/img/no_priority_queue.png -------------------------------------------------------------------------------- /conveyor-configurator/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /derby.log 3 | /testConv/ 4 | /test/ 5 | /c9/ 6 | /p11/ 7 | /conveyor.db 8 | -------------------------------------------------------------------------------- /conveyor-parallel/src/main/resources/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Automatic-Module-Name: conveyor.parallel 3 | -------------------------------------------------------------------------------- /conveyor-configurator/src/main/resources/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Automatic-Module-Name: conveyor.configurator 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /conveyor-core/src/test/resources/META-INF/services/com.aegisql.conveyor.ConveyorInitiatingService: -------------------------------------------------------------------------------- 1 | com.aegisql.conveyor.utils.SimpleTestService 2 | -------------------------------------------------------------------------------- /conveyor-core/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /test.cart 3 | /test.zip 4 | /cartOSStream.bin 5 | /testZip/ 6 | /testZip 2/ 7 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/resources/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Automatic-Module-Name: conveyor.persistence.core 3 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/resources/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Automatic-Module-Name: conveyor.persistence.jdbc 3 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/aggregator/model/State.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc.aggregator.model; 2 | 3 | public enum State { 4 | NY,NJ,CT 5 | } 6 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/testZip 2/test1.cart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/conveyor-persistence/conveyor-persistence-core/testZip 2/test1.cart -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/testZip 2/test2.cart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aegisql/conveyor/HEAD/conveyor-persistence/conveyor-persistence-core/testZip 2/test2.cart -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/reflection/Address.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.demo.reflection; 2 | 3 | public class Address { 4 | String address; 5 | } 6 | -------------------------------------------------------------------------------- /conveyor-parallel/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.jdt.core.prefs 2 | /org.eclipse.m2e.core.prefs 3 | /org.eclipse.core.resources.prefs 4 | /org.eclipse.wst.common.project.facet.core.xml 5 | -------------------------------------------------------------------------------- /conveyor-configurator/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.jdt.core.prefs 3 | /org.eclipse.m2e.core.prefs 4 | /org.eclipse.wst.common.project.facet.core.xml 5 | -------------------------------------------------------------------------------- /conveyor-persistence/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.jdt.core.prefs 3 | /org.eclipse.m2e.core.prefs 4 | /org.eclipse.wst.common.project.facet.core.xml 5 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/aggregator/model/OrderStatus.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc.aggregator.model; 2 | 3 | public enum OrderStatus { 4 | CREATED, SUBMITTED 5 | } 6 | -------------------------------------------------------------------------------- /conveyor-parallel/src/main/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/TaskId.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 2 | 3 | public record TaskId(K key, long id) { 4 | } 5 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.jdt.core.prefs 3 | /org.eclipse.m2e.core.prefs 4 | /org.eclipse.wst.common.project.facet.core.xml 5 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/.settings/.gitignore: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resources.prefs 2 | /org.eclipse.jdt.core.prefs 3 | /org.eclipse.m2e.core.prefs 4 | /org.eclipse.wst.common.project.facet.core.xml 5 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test1.yml: -------------------------------------------------------------------------------- 1 | test: 2 | testName: test1 3 | conveyor: 4 | test1: 5 | idleHeartBeat: 2 SECONDS 6 | defaultBuilderTimeout: 1 SECONDS 7 | rejectUnexpireableCartsOlderThan: 10 SECONDS -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/Wrapped.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils; 2 | 3 | import java.io.Serializable; 4 | 5 | public interface Wrapped extends Serializable { 6 | T unwrap(); 7 | } 8 | -------------------------------------------------------------------------------- /conveyor-core/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding//src/test/resources=UTF-8 6 | encoding/=UTF-8 7 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializableRunnable.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import java.io.Serializable; 4 | 5 | @FunctionalInterface 6 | public interface SerializableRunnable extends Runnable, Serializable { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializableSupplier.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import java.util.function.Supplier; 4 | 5 | @FunctionalInterface 6 | public interface SerializableSupplier extends Supplier{ 7 | 8 | } 9 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /derby.log 3 | /conveyor_db/ 4 | /carts_db/ 5 | /testConv/ 6 | /perfConv/ 7 | /testDb1/ 8 | /perfConvArchive/ 9 | /test/ 10 | /test_engine/ 11 | /*.db 12 | /*.sqlite 13 | /conveyor_db_sqlite 14 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/queue_pump/PumpId.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.queue_pump; 2 | 3 | /** 4 | * The enum Pump id. 5 | */ 6 | public enum PumpId { 7 | /** 8 | * Pump id pump id. 9 | */ 10 | PUMP_ID 11 | } 12 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/queue_pump/PumpLabel.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.queue_pump; 2 | 3 | /** 4 | * The enum Pump label. 5 | */ 6 | public enum PumpLabel { 7 | /** 8 | * Pump pump label. 9 | */ 10 | PUMP 11 | } 12 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/validation/DuplicateValueException.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.validation; 2 | 3 | public class DuplicateValueException extends RuntimeException { 4 | public DuplicateValueException(String s) { 5 | super(s); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/resources/user.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package com.aegisql.conveyor.persistence.protobuf.example; 4 | 5 | // The user message definition 6 | message User { 7 | string name = 1; 8 | int32 age = 2; 9 | string email = 3; 10 | } 11 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/builders/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Provides builders for customizable persistence configuration 6 | 7 | -------------------------------------------------------------------------------- /conveyor-parallel/src/main/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/TaskManagerLabel.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | public interface TaskManagerLabel extends SmartLabel> { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /conveyor-persistence/src/main/java/org/conveyor/persistence/App.java: -------------------------------------------------------------------------------- 1 | package org.conveyor.persistence; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test1.yaml: -------------------------------------------------------------------------------- 1 | time1: 1 2 | time2: 2 3 | time3: 10 4 | timeUnits: SECONDS 5 | test: 6 | testName: test1 7 | conveyor.test1: 8 | idleHeartBeat: ${time2} ${timeUnits} 9 | defaultBuilderTimeout: ${time1} ${timeUnits} 10 | rejectUnexpireableCartsOlderThan: ${time3} ${timeUnits} -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializableBiConsumer.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | import java.io.Serializable; 3 | import java.util.function.BiConsumer; 4 | 5 | @FunctionalInterface 6 | public interface SerializableBiConsumer extends BiConsumer, Serializable { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializableConsumer.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import java.io.Serializable; 4 | import java.util.function.Consumer; 5 | 6 | @FunctionalInterface 7 | public interface SerializableConsumer extends Consumer, Serializable { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializableFunction.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import java.io.Serializable; 4 | import java.util.function.Function; 5 | 6 | @FunctionalInterface 7 | public interface SerializableFunction extends Function, Serializable { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/cleanup/SingleKey.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.cleanup; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Enum SingleKey. 6 | */ 7 | public enum SingleKey { 8 | 9 | /** The batch. */ 10 | BATCH 11 | } 12 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/aggregator/model/Order.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc.aggregator.model; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | public class Order { 7 | 8 | String orderNumber; 9 | Date date; 10 | CustomerInfo customerInfo; 11 | List items; 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/resources/user.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "type": "record", 3 | "name": "User", 4 | "namespace": "com.aegisql.conveyor.persistence.avro.example", 5 | "fields": [ 6 | {"name": "name", "type": "string"}, 7 | {"name": "age", "type": "int"}, 8 | {"name": "email", "type": "string"} 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializablePredicate.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import java.io.Serializable; 4 | import java.util.function.Predicate; 5 | 6 | @FunctionalInterface 7 | public interface SerializablePredicate extends Predicate, Serializable { 8 | SerializablePredicate ANY = k->true; 9 | } 10 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/TimeoutAction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor; 5 | 6 | // TODO: Auto-generated Javadoc 7 | /** 8 | * The Interface TimeoutAction. 9 | */ 10 | public interface TimeoutAction { 11 | 12 | /** 13 | * On timeout. 14 | */ 15 | void onTimeout(); 16 | } 17 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/AbstractBin.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | abstract class AbstractBin { 4 | 5 | public final Conveyor conveyor; 6 | public final K key; 7 | 8 | AbstractBin(Conveyor conveyor, K key) { 9 | this.key = key; 10 | this.conveyor = conveyor; 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/FootageKeeper.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | public interface FootageKeeper { 4 | void setMaxFootage(long maxFootage); 5 | void incFootage(BuildingSite buildingSite); 6 | void decFootage(BuildingSite buildingSite); 7 | K getOldestInactiveKey(); 8 | void removeKey(K key); 9 | } 10 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/consumers/result/RunnableConsumer.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.result; 2 | 3 | import com.aegisql.conveyor.ProductBin; 4 | 5 | public class RunnableConsumer implements ResultConsumer{ 6 | @Override 7 | public void accept(ProductBin bin) { 8 | bin.product.run(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/DemoTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo; 5 | 6 | import org.junit.platform.suite.api.SelectPackages; 7 | import org.junit.platform.suite.api.Suite; 8 | 9 | @Suite 10 | @SelectPackages("com.aegisql.conveyor.demo") 11 | public class DemoTests { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: maven 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "11:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: com.fasterxml.jackson.core:jackson-core 11 | versions: 12 | - 2.12.1 13 | - dependency-name: org.yaml:snakeyaml 14 | versions: 15 | - "1.27" 16 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/Interruptable.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Interface Interruptable. 6 | */ 7 | public interface Interruptable { 8 | 9 | /** 10 | * Interrupt. 11 | * 12 | * @param conveyorThread the conveyor thread 13 | */ 14 | void interrupt(Thread conveyorThread); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/Acknowledge.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Interface Acknowledge. 6 | */ 7 | public interface Acknowledge { 8 | 9 | /** 10 | * Ack. 11 | */ 12 | void ack(); 13 | 14 | /** 15 | * Checks if is acknowledged. 16 | * 17 | * @return true, if is acknowledged 18 | */ 19 | boolean isAcknowledged(); 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/word_count/WordCounter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.demo.word_count; 2 | 3 | import java.util.function.Supplier; 4 | 5 | public class WordCounter implements Supplier { 6 | 7 | private int counter = 0; 8 | 9 | @Override 10 | public Integer get() { 11 | return counter; 12 | } 13 | 14 | public void count() { 15 | counter++; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/converters/StringLabelConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.converters; 2 | 3 | public class StringLabelConverter extends StringConverter { 4 | @Override 5 | public String fromPersistence(String p) { 6 | return p; 7 | } 8 | @Override 9 | public String conversionHint() { 10 | return "?:String"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/cart/command/CreateCommandTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.cart.command; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertNotNull; 6 | 7 | public class CreateCommandTest { 8 | @Test 9 | public void createTest() { 10 | CreateCommand cc = new CreateCommand<>(1,0,0); 11 | assertNotNull(cc.copy()); 12 | } 13 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/ObjectToByteArrayConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | import com.aegisql.conveyor.persistence.core.ObjectConverter; 4 | 5 | /** 6 | * The Interface ObjectToByteArrayConverter. 7 | * 8 | * @param the generic type 9 | */ 10 | public interface ObjectToByteArrayConverter extends ObjectConverter { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/Testing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor; 5 | 6 | import java.io.Serializable; 7 | 8 | // TODO: Auto-generated Javadoc 9 | /** 10 | * The Interface Testing. 11 | */ 12 | @FunctionalInterface 13 | public interface Testing extends Serializable { 14 | 15 | /** 16 | * Test. 17 | * 18 | * @return true, if successful 19 | */ 20 | boolean test(); 21 | } 22 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, 2 | 3 | log4j.logger.UnitTestLogger=DEBUG,stdout 4 | log4j.logger.com.aegisql=OFF 5 | 6 | # Direct log messages to stdout 7 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 8 | log4j.appender.stdout.Target=System.out 9 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 10 | log4j.appender.stdout.layout.ConversionPattern=%p:%L [%t] - %m%n 11 | 12 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/TestingState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor; 5 | 6 | import com.aegisql.conveyor.serial.SerializablePredicate; 7 | 8 | /** 9 | * The Interface TestingState. 10 | * 11 | * @param the key type 12 | * @param the generic type 13 | */ 14 | @FunctionalInterface 15 | public interface TestingState extends SerializablePredicate> { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/Status.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Enum Status. 6 | */ 7 | public enum Status{ 8 | 9 | /** The waiting data. */ 10 | WAITING_DATA, 11 | 12 | /** The timed out. */ 13 | TIMED_OUT, 14 | 15 | /** The ready. */ 16 | READY, 17 | 18 | /** The canceled. */ 19 | CANCELED, 20 | 21 | /** The invalid. */ 22 | INVALID, 23 | 24 | /** Build not found. */ 25 | NOT_FOUND 26 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/cart/ShoppingCartTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.cart; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | 7 | public class ShoppingCartTest { 8 | @Test 9 | public void creationTest() { 10 | Cart c = new ShoppingCart(1, "test", "label", 0, 0, new HashMap<>(), LoadType.PART, 0, true); 11 | c.addProperty("test","val"); 12 | c.clearProperty("test"); 13 | } 14 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/arrays/ObjectArrayToByteArrayConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters.arrays; 2 | 3 | import com.aegisql.conveyor.persistence.core.ObjectConverter; 4 | 5 | /** 6 | * The Interface ObjectArrayToByteArrayConverter. 7 | * 8 | * @param the generic type 9 | */ 10 | public interface ObjectArrayToByteArrayConverter extends ObjectConverter { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/thread_pool/RoundRobinLoop.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc.thread_pool; 2 | 3 | public class RoundRobinLoop { 4 | 5 | private final int size; 6 | 7 | private volatile int next = 0; 8 | 9 | public RoundRobinLoop(int size) { 10 | this.size = size; 11 | } 12 | 13 | public synchronized int next() { 14 | if(next == size) { 15 | next = 0; 16 | } 17 | return next++; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-core/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, 2 | 3 | log4j.logger.UnitTestLogger=DEBUG,stdout 4 | log4j.logger.com.aegisql=DEBUG,stdout 5 | log4j.logger.org.springframework=DEBUG,stdout 6 | 7 | # Direct log messages to stdout 8 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 9 | log4j.appender.stdout.Target=System.out 10 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.stdout.layout.ConversionPattern=%p:%L [%t] - %m%n 12 | 13 | -------------------------------------------------------------------------------- /conveyor-parallel/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, 2 | 3 | log4j.logger.UnitTestLogger=DEBUG,stdout 4 | log4j.logger.com.aegisql=DEBUG,stdout 5 | log4j.logger.org.springframework=DEBUG,stdout 6 | 7 | # Direct log messages to stdout 8 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 9 | log4j.appender.stdout.Target=System.out 10 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.stdout.layout.ConversionPattern=%p:%L [%t] - %m%n 12 | 13 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, 2 | 3 | log4j.logger.UnitTestLogger=DEBUG,stdout 4 | log4j.logger.com.aegisql=DEBUG,stdout 5 | log4j.logger.org.springframework=DEBUG,stdout 6 | 7 | # Direct log messages to stdout 8 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 9 | log4j.appender.stdout.Target=System.out 10 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.stdout.layout.ConversionPattern=%p:%L [%t] - %m%n 12 | 13 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/types.properties: -------------------------------------------------------------------------------- 1 | conveyor.assembling.init= 2 | conveyor.kbalanced.parallel= 3 3 | conveyor.a.acceptLabels="X" 4 | conveyor.a.forward = \ 5 | var label = "Y";\ 6 | var name = "test1";\ 7 | var keyTransformer = function(k){return 'X'+k}; 8 | conveyor.b.init= 9 | conveyor.lbalanced.parallel= a,b 10 | conveyor.batch.supplier = new com.aegisql.conveyor.utils.batch.BatchConveyor 11 | conveyor.persistent.persistence = com.aegisql.conveyor.persistence.derby.testConv:type=persistent 12 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/consumers/scrap/IgnoreScrapTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.scrap; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import org.junit.jupiter.api.Test; 5 | 6 | public class IgnoreScrapTest { 7 | 8 | @Test 9 | public void accept() { 10 | IgnoreScrap is = new IgnoreScrap(); 11 | IgnoreScrap is2 = IgnoreScrap.of(new AssemblingConveyor<>()); 12 | ScrapConsumer is3 = is.andThen(is2); 13 | is3.accept(null); 14 | } 15 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=DEBUG, 2 | 3 | log4j.logger.UnitTestLogger=DEBUG,stdout 4 | log4j.logger.com.aegisql=DEBUG,stdout 5 | log4j.logger.org.springframework=DEBUG,stdout 6 | 7 | # Direct log messages to stdout 8 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 9 | log4j.appender.stdout.Target=System.out 10 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.stdout.layout.ConversionPattern=%p:%L [%t] - %m%n 12 | 13 | -------------------------------------------------------------------------------- /conveyor-core/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.release=disabled 9 | org.eclipse.jdt.core.compiler.source=1.8 10 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/FutureSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor; 5 | 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | // TODO: Auto-generated Javadoc 9 | /** 10 | * The Interface FutureSupplier. 11 | * 12 | * @param the generic type 13 | */ 14 | public interface FutureSupplier { 15 | 16 | /** 17 | * Gets the future. 18 | * 19 | * @return the future 20 | */ 21 | CompletableFuture getFuture(); 22 | } 23 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/reflection/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.reflection; 5 | 6 | import java.util.Date; 7 | import java.util.function.Supplier; 8 | 9 | public class PersonBuilder implements Supplier { 10 | 11 | public String firstName; 12 | public String lastName; 13 | public Date dateOfBirth; 14 | 15 | @Override 16 | public Person get() { 17 | return new Person(firstName,lastName,dateOfBirth); 18 | } 19 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/serial/SerializablePredicateTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.io.Serializable; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertTrue; 8 | 9 | public class SerializablePredicateTest { 10 | @Test 11 | public void functionalInterfaceTest() { 12 | SerializablePredicate sp = a->true; 13 | assertTrue(sp instanceof Serializable); 14 | assertTrue(sp.test("this")); 15 | } 16 | } -------------------------------------------------------------------------------- /conveyor-parallel/src/main/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/RoundRobinLoop.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 2 | 3 | public class RoundRobinLoop { 4 | 5 | private final int size; 6 | 7 | private volatile int next = 0; 8 | 9 | public RoundRobinLoop(int size) { 10 | this.size = size; 11 | } 12 | 13 | public synchronized int next() { 14 | if(next == size) { 15 | next = 0; 16 | } 17 | return next++; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/cart/ResultConsumerCartTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.cart; 2 | 3 | import com.aegisql.conveyor.consumers.result.IgnoreResult; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertNotNull; 7 | 8 | public class ResultConsumerCartTest { 9 | 10 | @Test 11 | public void copyTest() { 12 | ResultConsumerCart rcc = new ResultConsumerCart<>(1,new IgnoreResult<>(),0,0,0); 13 | assertNotNull(rcc.copy()); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /conveyor-configurator/src/test/java/com/aegisql/conveyor/config/harness/TestBean.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.config.harness; 2 | 3 | public class TestBean { 4 | 5 | public int timeout = 1000; 6 | 7 | public String type = "value"; 8 | 9 | @Override 10 | public String toString() { 11 | final StringBuilder sb = new StringBuilder("TestBean{"); 12 | sb.append("timeout=").append(timeout); 13 | sb.append(", type='").append(type).append('\''); 14 | sb.append('}'); 15 | return sb.toString(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/ConveyorInitiatingService.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | /** 4 | * The interface Conveyor initiating service. 5 | * To activate the service create a file 6 | * META-INF/services/com.aegisql.conveyor.ConveyorInitiatingService 7 | * file should contain a fully qualified name of the conveyor 8 | * initializing service interface implementation(s) per each line 9 | * Use one initializer per conveyor 10 | */ 11 | public interface ConveyorInitiatingService { 12 | Conveyor getConveyor(); 13 | } 14 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/consumers/result/ResultCounterTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.result; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | 7 | public class ResultCounterTest { 8 | 9 | @Test 10 | public void counterTest() { 11 | ResultConsumer rc = new ResultCounter(); 12 | rc.accept(ResultConsumerTest.getProductBin(1,"test")); 13 | System.out.println(rc); 14 | assertEquals(1,((ResultCounter) rc).get()); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/TestProdBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc; 2 | 3 | import java.util.function.Supplier; 4 | 5 | public class TestProdBuilder implements Supplier{ 6 | 7 | private String a = ""; 8 | private String b = ""; 9 | 10 | @Override 11 | public TestProd get() { 12 | return new TestProd(a, b); 13 | } 14 | 15 | public static void setA(TestProdBuilder tpb, String a) { 16 | tpb.a = tpb.a+a; 17 | } 18 | 19 | public static void setB(TestProdBuilder tpb, String b) { 20 | tpb.b = tpb.b+b; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/java/com/aegisql/conveyor/config/harness/IntegerSupplier.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.config.harness; 2 | 3 | import java.util.function.Supplier; 4 | 5 | public class IntegerSupplier implements Supplier { 6 | 7 | private final Integer s; 8 | 9 | public IntegerSupplier() { 10 | System.out.println("StringSupplier init"); 11 | s = 1; 12 | } 13 | 14 | public IntegerSupplier(Integer init) { 15 | System.out.println("IntegerSupplier init "+init); 16 | s = init; 17 | } 18 | 19 | 20 | @Override 21 | public Integer get() { 22 | return s; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/cart/LoadType.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.cart; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Enum LoadType. 6 | */ 7 | public enum LoadType { 8 | 9 | /** The part. */ 10 | PART, 11 | 12 | /** The multi key part. */ 13 | MULTI_KEY_PART, 14 | 15 | /** The static part. */ 16 | STATIC_PART, 17 | 18 | /** The result consumer. */ 19 | RESULT_CONSUMER, 20 | /** The future. */ 21 | //15 char max 22 | FUTURE, 23 | 24 | /** The builder. */ 25 | BUILDER, 26 | 27 | /** The command. */ 28 | COMMAND, 29 | 30 | /** The postponed task*/ 31 | TASK 32 | } 33 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/map_reduce/WordCounter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.map_reduce; 5 | 6 | import java.util.function.Supplier; 7 | 8 | public class WordCounter implements Supplier { 9 | 10 | private int count = 0; 11 | private String word; 12 | 13 | @Override 14 | public WordCount get() { 15 | return new WordCount(word,count); 16 | } 17 | 18 | public static void add(WordCounter counter, WordCount word) { 19 | counter.word = word.getWord(); 20 | counter.count += word.getCount(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/converters/MapToJsonConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.converters; 2 | 3 | import com.aegisql.conveyor.persistence.converters.ObjectToJsonStringConverter; 4 | 5 | import java.util.Map; 6 | // TODO: Auto-generated Javadoc 7 | /** 8 | * The Class BlobConverter. 9 | * 10 | */ 11 | public class MapToJsonConverter extends ObjectToJsonStringConverter { 12 | 13 | 14 | /** 15 | * Instantiates a new blob converter. 16 | */ 17 | public MapToJsonConverter() { 18 | super(Map.class); 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/map_reduce/WordCount.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.map_reduce; 5 | 6 | public final class WordCount { 7 | 8 | private final String word; 9 | private final int count; 10 | 11 | public WordCount(String word, int count) { 12 | this.word = word; 13 | this.count = count; 14 | } 15 | 16 | public String getWord() { 17 | return word; 18 | } 19 | 20 | public int getCount() { 21 | return count; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return word + " = " + count; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016,2017,2018,2019,2020,2021,2022,2023,2024,2025 AEGIS DATA SOLUTIONS, LLC 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/TestProd.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc; 2 | 3 | public class TestProd { 4 | 5 | private final String a; 6 | private final String b; 7 | 8 | public TestProd(String a, String b) { 9 | if(a.equals("X")) { 10 | throw new RuntimeException("X captured"); 11 | } 12 | this.a = a; 13 | this.b = b; 14 | } 15 | 16 | public String getA() { 17 | return a; 18 | } 19 | 20 | public String getB() { 21 | return b; 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return "TestProd [" + (a != null ? "a=" + a + ", " : "") + (b != null ? "b=" + b : "") + "]"; 27 | } 28 | 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/cart/command/GeneralCommandTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.cart.command; 2 | 3 | import com.aegisql.conveyor.CommandLabel; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertNotNull; 7 | 8 | public class GeneralCommandTest { 9 | @Test 10 | public void testGeneralCommand() { 11 | GeneralCommand c1 = new GeneralCommand(1, "", CommandLabel.CHECK_BUILD, 0); 12 | GeneralCommand c2 = new GeneralCommand(k->true,"",CommandLabel.CHECK_BUILD, 0,0); 13 | assertNotNull(c1.copy()); 14 | assertNotNull(c2.copy()); 15 | } 16 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/utils/queue_pump/QueuePumpTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.queue_pump; 2 | 3 | import com.aegisql.conveyor.consumers.result.ProductConsumer; 4 | import org.junit.jupiter.api.Test; 5 | 6 | public class QueuePumpTest { 7 | 8 | @Test 9 | public void basicQueuePumpTest() { 10 | QueuePump qp = new QueuePump<>(); 11 | qp.setName("basicQueuePumpTest"); 12 | qp.resultConsumer(ProductConsumer.of(qp).apply(str->{ 13 | System.out.println(str); 14 | })).set(); 15 | qp.part().value("Hello").place(); 16 | qp.part().value("World").place().join(); 17 | } 18 | 19 | 20 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/TestUtils.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.Objects; 6 | 7 | public class TestUtils { 8 | 9 | public static Map pairsToMap(String... pairs){ 10 | HashMap m = new HashMap<>(); 11 | Objects.requireNonNull(pairs); 12 | if(pairs.length % 2 == 1) { 13 | throw new IllegalArgumentException("Number of parameters must be even"); 14 | } 15 | for(int i = 0; i < pairs.length; i+=2) { 16 | m.put(pairs[i],pairs[i+1]); 17 | } 18 | 19 | return m; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test13.yml: -------------------------------------------------------------------------------- 1 | test.testName: persistence end to end 12 with connection pool 2 | conveyor: 3 | c13: 4 | keyType: java.lang.Integer 5 | labelType: com.aegisql.conveyor.config.harness.NameLabel 6 | productType: java.lang.String 7 | supportedValueTypes: 8 | - com.aegisql.conveyor.config.harness.NameLabel.FIRST java.lang.String,java.lang.String 9 | - com.aegisql.conveyor.config.harness.NameLabel.LAST java.lang.String,java.lang.String 10 | - com.aegisql.conveyor.config.harness.NameLabel.END java.lang.String,java.lang.Integer,java.lang.String,java.lang.String 11 | builderSupplier: new com.aegisql.conveyor.config.harness.StringSupplier("c13"); 12 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/aggregator/model/Inventory.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc.aggregator.model; 2 | 3 | import java.util.Map; 4 | 5 | public class Inventory { 6 | 7 | Map items; 8 | 9 | 10 | public Map getItems() { 11 | return items; 12 | } 13 | 14 | public void setItems(Map items) { 15 | this.items = items; 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | final StringBuilder sb = new StringBuilder("Inventory{"); 21 | sb.append("items=").append(items); 22 | sb.append('}'); 23 | return sb.toString(); 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/LazyConveyorSupplierTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertNotNull; 7 | 8 | public class LazyConveyorSupplierTest { 9 | 10 | @Test 11 | public void getConveyor() { 12 | 13 | AssemblingConveyor ac = new AssemblingConveyor<>(); 14 | ac.setName("testLazySupplier"); 15 | LazyConveyorSupplier ls = new LazyConveyorSupplier("testLazySupplier"); 16 | assertNotNull(ls.get()); 17 | ls.reset(); 18 | assertNotNull(ls.get()); 19 | System.out.println(ls); 20 | } 21 | } -------------------------------------------------------------------------------- /conveyor-parallel/src/test/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/RoundRobinLoopTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.*; 6 | 7 | class RoundRobinLoopTest { 8 | 9 | @Test 10 | void test() { 11 | RoundRobinLoop loop = new RoundRobinLoop(3); 12 | assertEquals(0,loop.next()); 13 | assertEquals(1,loop.next()); 14 | assertEquals(2,loop.next()); 15 | assertEquals(0,loop.next()); 16 | assertEquals(1,loop.next()); 17 | assertEquals(2,loop.next()); 18 | assertEquals(0,loop.next()); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/consumers/scrap/ScrapCounterTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.scrap; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertEquals; 7 | 8 | public class ScrapCounterTest { 9 | 10 | @Test 11 | public void testOf() { 12 | AssemblingConveyor ac = new AssemblingConveyor<>(); 13 | ScrapCounter sc1 = ScrapCounter.of(ac); 14 | ScrapCounter sc2 = ScrapCounter.of(ac,x->true); 15 | sc1.accept(null); 16 | assertEquals(1,sc1.get()); 17 | System.out.println(sc1); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/archive/ArchiveStrategy.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.archive; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Enum ArchiveStrategy. 6 | */ 7 | public enum ArchiveStrategy { 8 | 9 | /** The custom. */ 10 | CUSTOM, 11 | /** The delete. */ 12 | //set strategy 13 | DELETE, 14 | 15 | /** The set archived. */ 16 | SET_ARCHIVED, 17 | 18 | /** The move to schema table. */ 19 | MOVE_TO_PERSISTENCE, 20 | /** The move to file. */ 21 | //schema,table 22 | MOVE_TO_FILE, 23 | /** The no action. */ 24 | //path,file 25 | NO_ACTION //external archive strategy 26 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioPart.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | import java.util.function.BiConsumer; 6 | 7 | public enum TrioPart implements SmartLabel { 8 | TEXT1(SmartLabel.of(TrioBuilder::setText1)), 9 | TEXT2(SmartLabel.of(TrioBuilder::setText2)), 10 | NUMBER(SmartLabel.of(TrioBuilder::setNumber)) 11 | ; 12 | private final SmartLabel inner; 13 | TrioPart(SmartLabel inner) { 14 | this.inner = inner; 15 | } 16 | @Override 17 | public BiConsumer get() { 18 | return inner.get(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioPart.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | import java.util.function.BiConsumer; 6 | 7 | public enum TrioPart implements SmartLabel{ 8 | TEXT1(SmartLabel.of(TrioBuilder::setText1)), 9 | TEXT2(SmartLabel.of(TrioBuilder::setText2)), 10 | NUMBER(SmartLabel.of(TrioBuilder::setNumber)) 11 | ; 12 | private final SmartLabel inner; 13 | TrioPart(SmartLabel inner) { 14 | this.inner = inner; 15 | } 16 | @Override 17 | public BiConsumer get() { 18 | return inner.get(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-parallel/src/main/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/TaskExecutor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 2 | 3 | import com.aegisql.conveyor.Testing; 4 | 5 | import java.util.Objects; 6 | import java.util.function.Supplier; 7 | 8 | public class TaskExecutor implements Supplier, Testing { 9 | 10 | private T result; 11 | 12 | @Override 13 | public T get() { 14 | return result; 15 | } 16 | 17 | public void task(Supplier task) { 18 | Objects.requireNonNull(task,"task cannot be null"); 19 | this.result = task.get(); 20 | } 21 | 22 | @Override 23 | public boolean test() { 24 | return true; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/BitSetToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | import java.util.BitSet; 4 | 5 | /** 6 | * The type Bit set to bytes converter. 7 | */ 8 | public class BitSetToBytesConverter implements ObjectToByteArrayConverter { 9 | @Override 10 | public byte[] toPersistence(BitSet bs) { 11 | return bs.toByteArray(); 12 | } 13 | 14 | @Override 15 | public BitSet fromPersistence(byte[] bytes) { 16 | return BitSet.valueOf(bytes); 17 | } 18 | 19 | @Override 20 | public String conversionHint() { 21 | return "java.util.BitSet:byte[]"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/converters/StringConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.converters; 2 | 3 | import com.aegisql.conveyor.persistence.core.ObjectConverter; 4 | 5 | // TODO: Auto-generated Javadoc 6 | /** 7 | * The Class StringConverter. 8 | * 9 | * @param the generic type 10 | */ 11 | public abstract class StringConverter implements ObjectConverter { 12 | 13 | /* (non-Javadoc) 14 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 15 | */ 16 | @Override 17 | public String toPersistence(O obj) { 18 | if(obj == null) return null; 19 | return ""+obj; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/java/com/aegisql/conveyor/config/OrderedPropertiesTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.config; 2 | 3 | import org.junit.jupiter.api.*; 4 | 5 | import java.io.IOException; 6 | 7 | public class OrderedPropertiesTest { 8 | 9 | @BeforeAll 10 | public static void setUpBeforeClass() { 11 | } 12 | 13 | @AfterAll 14 | public static void tearDownAfterClass() { 15 | } 16 | 17 | @BeforeEach 18 | public void setUp() { 19 | } 20 | 21 | @AfterEach 22 | public void tearDown() { 23 | } 24 | 25 | @Test 26 | public void test() throws IOException { 27 | OrderedProperties op = new OrderedProperties(); 28 | op.load("src/test/resources/test2.properties"); 29 | op.forEach(p->System.out.println(p)); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/ConveyorRuntimeExceptionTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import com.aegisql.conveyor.exception.ConveyorRuntimeException; 4 | import org.junit.jupiter.api.Test; 5 | 6 | public class ConveyorRuntimeExceptionTest { 7 | 8 | @Test 9 | public void testConstructors() { 10 | ConveyorRuntimeException e1 = new ConveyorRuntimeException(); 11 | ConveyorRuntimeException e2 = new ConveyorRuntimeException("test"); 12 | ConveyorRuntimeException e3 = new ConveyorRuntimeException(e1); 13 | ConveyorRuntimeException e4 = new ConveyorRuntimeException("test",e1); 14 | ConveyorRuntimeException e5 = new ConveyorRuntimeException("test",e1,true,false); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/utils/MultiValueTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | import static org.junit.jupiter.api.Assertions.assertNotNull; 7 | 8 | public class MultiValueTest { 9 | 10 | @Test 11 | public void test() { 12 | MultiValue mv = new MultiValue("first").add("second"); 13 | String first = mv.cast(String.class,0); 14 | assertNotNull(first); 15 | assertEquals("first",first); 16 | 17 | String second = mv.asString(1); 18 | assertNotNull(second); 19 | assertEquals("second",second); 20 | 21 | System.out.println(mv); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /conveyor-configurator/src/test/java/com/aegisql/conveyor/config/harness/NameLabel.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.config.harness; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | import java.util.function.BiConsumer; 6 | 7 | public enum NameLabel implements SmartLabel{ 8 | 9 | FIRST(SmartLabel.of(StringSupplier::first).get()), 10 | LAST(SmartLabel.of(StringSupplier::last).get()), 11 | END(SmartLabel.bare().get()) 12 | ; 13 | 14 | 15 | final BiConsumer consumer; 16 | 17 | NameLabel(BiConsumer consumer) { 18 | this.consumer = consumer; 19 | } 20 | 21 | @Override 22 | public BiConsumer get() { 23 | return consumer; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/weather/MonthSummaryLabels.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.demo.weather; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | import java.util.function.BiConsumer; 6 | 7 | public enum MonthSummaryLabels implements SmartLabel { 8 | WEATHER_RECORD(MonthSummaryCollector::weatherRecord), 9 | ; 10 | private final BiConsumer consumer; 11 | 12 | MonthSummaryLabels(BiConsumer consumer) { 13 | this.consumer = (BiConsumer) consumer; 14 | } 15 | 16 | @Override 17 | public BiConsumer get() { 18 | return consumer; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/consumers/result/RunnableConsumerTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.result; 2 | 3 | import com.aegisql.conveyor.ProductBin; 4 | import com.aegisql.conveyor.Status; 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class RunnableConsumerTest { 8 | 9 | @Test 10 | public void runnableTest() { 11 | RunnableConsumer rc = new RunnableConsumer<>(); 12 | ProductBin bin = new ProductBin<>(null, 13 | 1, new Runnable() { 14 | @Override 15 | public void run() { 16 | System.out.println("RAN!"); 17 | } 18 | },0, Status.CANCELED,null,null 19 | ); 20 | rc.accept(bin); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/user/LowerUser.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.user; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Class LowerUser. 6 | */ 7 | public class LowerUser extends User { 8 | 9 | /** 10 | * Instantiates a new lower user. 11 | * 12 | * @param first the first 13 | * @param last the last 14 | * @param yob the yob 15 | */ 16 | public LowerUser(String first, String last, int yob) { 17 | super(first, last, yob); 18 | } 19 | 20 | /* (non-Javadoc) 21 | * @see com.aegisql.conveyor.user.User#toString() 22 | */ 23 | @Override 24 | public String toString() { 25 | return "LowerUser [first=" + first + ", last=" + last + ", yearOfBirth=" + yearOfBirth + "]"; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/user/UpperUser.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.user; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Class UpperUser. 6 | */ 7 | public class UpperUser extends User { 8 | 9 | /** 10 | * Instantiates a new upper user. 11 | * 12 | * @param first the first 13 | * @param last the last 14 | * @param yob the yob 15 | */ 16 | public UpperUser(String first, String last, int yob) { 17 | super(first, last, yob); 18 | } 19 | 20 | /* (non-Javadoc) 21 | * @see com.aegisql.conveyor.user.User#toString() 22 | */ 23 | @Override 24 | public String toString() { 25 | return "UpperUser [first=" + first + ", last=" + last + ", yearOfBirth=" + yearOfBirth + "]"; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test9.yml: -------------------------------------------------------------------------------- 1 | test.testName: persistence end to end 2 | conveyor: 3 | c9-1: 4 | builderSupplier: new com.aegisql.conveyor.config.harness.StringSupplier("c9-1"); 5 | defaultBuilderTimeout: 1 SECONDS 6 | firstResultConsumer: new com.aegisql.conveyor.consumers.result.LogResult() 7 | firstScrapConsumer: new com.aegisql.conveyor.consumers.scrap.LogScrap() 8 | readyWhenAccepted: 9 | - com.aegisql.conveyor.config.harness.NameLabel.FIRST 10 | - com.aegisql.conveyor.config.harness.NameLabel.LAST 11 | persistence: 12 | derby.c9.parts: 13 | keyClass: java.lang.Integer 14 | archiveStrategy: 15 | path: ./ 16 | maxFileSize: 20KB 17 | bucketSize: 50 18 | zip: true 19 | -------------------------------------------------------------------------------- /conveyor-core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | conveyor-core 4 | Reactive Builder Framework core. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.m2e.core.maven2Nature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/core/ObjectConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Interface ObjectConverter. 6 | * 7 | * @param the generic type 8 | * @param

the generic type 9 | */ 10 | public interface ObjectConverter { 11 | 12 | /** 13 | * To persistence. 14 | * 15 | * @param obj the obj 16 | * @return the p 17 | */ 18 | P toPersistence(O obj); 19 | 20 | /** 21 | * From persistence. 22 | * 23 | * @param p the p 24 | * @return the o 25 | */ 26 | O fromPersistence(P p); 27 | 28 | /** 29 | * Conversion hint. 30 | * 31 | * 32 | * @return the string 33 | */ 34 | String conversionHint(); 35 | } 36 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/builders/RestoreOrder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.builders; 2 | 3 | import java.util.LinkedHashMap; 4 | 5 | public enum RestoreOrder { 6 | NO_ORDER 7 | ,BY_ID("ID","ASC") 8 | ,BY_PRIORITY_AND_ID("PRIORITY","DESC","ID","ASC") 9 | ; 10 | 11 | final LinkedHashMap order = new LinkedHashMap<>(); 12 | 13 | public LinkedHashMap getOrder() { 14 | return order; 15 | } 16 | 17 | RestoreOrder(String ... fields) { 18 | if(fields != null) { 19 | for(int i = 0; i < fields.length-1; i+=2) { 20 | String field = fields[i]; 21 | String dir = fields[i+1]; 22 | order.put(field, dir); 23 | } 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/queue_pump/ScalarHolder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.queue_pump; 2 | 3 | import com.aegisql.conveyor.Testing; 4 | 5 | import java.util.function.Supplier; 6 | 7 | /** 8 | * The type Scalar holder. 9 | * 10 | * @param the type parameter 11 | */ 12 | public class ScalarHolder implements Supplier, Testing { 13 | private OUT value; 14 | 15 | /** 16 | * Sets value. 17 | * 18 | * @param value the value 19 | */ 20 | public void setValue(OUT value) { 21 | this.value = value; 22 | } 23 | @Override 24 | public OUT get() { 25 | return value; 26 | } 27 | 28 | @Override 29 | public boolean test() { 30 | return true; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/word_count/CountedWord.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.demo.word_count; 2 | 3 | public class CountedWord implements Comparable { 4 | private final String word; 5 | private final int count; 6 | 7 | public CountedWord(String word, int count) { 8 | this.word = word; 9 | this.count = count; 10 | } 11 | 12 | @Override 13 | public String toString() { 14 | final StringBuilder sb = new StringBuilder("\n"); 15 | sb.append("'").append(word).append('\''); 16 | sb.append("=").append(count); 17 | return sb.toString(); 18 | } 19 | 20 | @Override 21 | public int compareTo(CountedWord o) { 22 | return Integer.compare(o.count, this.count); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/KeepRunningConveyorExceptionTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import com.aegisql.conveyor.exception.KeepRunningConveyorException; 4 | import org.junit.jupiter.api.Test; 5 | 6 | public class KeepRunningConveyorExceptionTest { 7 | 8 | @Test 9 | public void testConstructors() { 10 | KeepRunningConveyorException e1 = new KeepRunningConveyorException(); 11 | KeepRunningConveyorException e2 = new KeepRunningConveyorException("test"); 12 | KeepRunningConveyorException e3 = new KeepRunningConveyorException(e1); 13 | KeepRunningConveyorException e4 = new KeepRunningConveyorException("test",e1); 14 | KeepRunningConveyorException e5 = new KeepRunningConveyorException("test",e1,true,false); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/engine/connectivity/ConnectionDefaults.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.engine.connectivity; 2 | 3 | public interface ConnectionDefaults { 4 | default String defaultHostname() { 5 | return "localhost"; 6 | } 7 | 8 | default int defaultPort() { 9 | return -1; 10 | } 11 | 12 | default String defaultDriverClassName() { 13 | return ""; 14 | } 15 | 16 | default ConnectionFactory defaultConnectionFactory() { 17 | return ConnectionFactory.driverManagerFactoryInstance(); 18 | } 19 | 20 | default ConnectionFactory defaultConnectionPoolFactory() { 21 | return ConnectionFactory.DBCP2FactoryInstance(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /conveyor-parallel/src/test/java/com/aegisql/conveyor/PropertiesBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.function.Supplier; 6 | 7 | public class PropertiesBuilder implements Supplier> { 8 | 9 | private final Map map = new HashMap<>(); 10 | 11 | private PropertiesBuilder() { 12 | 13 | } 14 | 15 | public static PropertiesBuilder putFirst(String key, Object val) { 16 | PropertiesBuilder mb = new PropertiesBuilder(); 17 | mb.map.put(key, val); 18 | return mb; 19 | } 20 | 21 | public PropertiesBuilder put(String key, Object val) { 22 | this.map.put(key, val); 23 | return this; 24 | } 25 | 26 | @Override 27 | public Map get() { 28 | return map; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioPartExpireable.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | import java.util.function.BiConsumer; 6 | 7 | public enum TrioPartExpireable implements SmartLabel{ 8 | TEXT1(SmartLabel.of(TrioBuilderExpireable::setText1)), 9 | TEXT2(SmartLabel.of(TrioBuilderExpireable::setText2)), 10 | NUMBER(SmartLabel.of(TrioBuilderExpireable::setNumber)) 11 | ; 12 | private final SmartLabel inner; 13 | TrioPartExpireable(SmartLabel inner) { 14 | this.inner = inner; 15 | } 16 | @Override 17 | public BiConsumer get() { 18 | return inner.get(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/utils/SimpleTestService.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.Conveyor; 5 | import com.aegisql.conveyor.ConveyorInitiatingService; 6 | import com.aegisql.conveyor.user.User; 7 | import com.aegisql.conveyor.user.UserBuilderEvents; 8 | 9 | public class SimpleTestService implements ConveyorInitiatingService { 10 | Conveyor conveyor; 11 | @Override 12 | public Conveyor getConveyor() { 13 | if(conveyor==null) { 14 | conveyor = new AssemblingConveyor<>(); 15 | conveyor.setName("SimpleTestServiceConveyor"); 16 | } 17 | return conveyor; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/BuilderAndFutureSupplierTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.concurrent.CompletableFuture; 6 | import java.util.function.Supplier; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertNotNull; 9 | 10 | public class BuilderAndFutureSupplierTest { 11 | 12 | @Test 13 | public void getTest() { 14 | BuilderAndFutureSupplier s = new BuilderAndFutureSupplier<>(new BuilderSupplier() { 15 | @Override 16 | public Supplier get() { 17 | return ()->"TEST"; 18 | } 19 | }, new CompletableFuture<>()); 20 | assertNotNull(s.get()); 21 | assertNotNull(s.getFuture()); 22 | assertNotNull(s.toString()); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/core/PersistenceException.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core; 2 | 3 | import java.io.Serial; 4 | 5 | public class PersistenceException extends RuntimeException { 6 | 7 | @Serial 8 | private static final long serialVersionUID = 1L; 9 | 10 | public PersistenceException() { 11 | } 12 | 13 | public PersistenceException(String arg0) { 14 | super(arg0); 15 | } 16 | 17 | public PersistenceException(Throwable arg0) { 18 | super(arg0); 19 | } 20 | 21 | public PersistenceException(String arg0, Throwable arg1) { 22 | super(arg0, arg1); 23 | } 24 | 25 | public PersistenceException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { 26 | super(arg0, arg1, arg2, arg3); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_builder/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_builder; 5 | 6 | import java.util.Date; 7 | import java.util.function.Supplier; 8 | 9 | public class PersonBuilder implements Supplier { 10 | 11 | private String firstName; 12 | private String lastName; 13 | private Date dateOfBirth; 14 | 15 | public void setFirstName(String firstName) { 16 | this.firstName = firstName; 17 | } 18 | 19 | public void setLastName(String lastName) { 20 | this.lastName = lastName; 21 | } 22 | 23 | public void setDateOfBirth(Date dateOfBirth) { 24 | this.dateOfBirth = dateOfBirth; 25 | } 26 | 27 | @Override 28 | public Person get() { 29 | return new Person(firstName,lastName,dateOfBirth); 30 | } 31 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_conveyor/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_conveyor; 5 | 6 | import java.util.Date; 7 | import java.util.function.Supplier; 8 | 9 | public class PersonBuilder implements Supplier { 10 | 11 | private String firstName; 12 | private String lastName; 13 | private Date dateOfBirth; 14 | 15 | public void setFirstName(String firstName) { 16 | this.firstName = firstName; 17 | } 18 | 19 | public void setLastName(String lastName) { 20 | this.lastName = lastName; 21 | } 22 | 23 | public void setDateOfBirth(Date dateOfBirth) { 24 | this.dateOfBirth = dateOfBirth; 25 | } 26 | 27 | @Override 28 | public Person get() { 29 | return new Person(firstName,lastName,dateOfBirth); 30 | } 31 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/smart_conveyor_labels/PersonBuilderLabel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.smart_conveyor_labels; 5 | 6 | import com.aegisql.conveyor.SmartLabel; 7 | 8 | import java.util.function.BiConsumer; 9 | 10 | public enum PersonBuilderLabel implements SmartLabel { 11 | 12 | SET_FIRST(PersonBuilder::setFirstName), 13 | SET_LAST(PersonBuilder::setLastName), 14 | SET_YEAR(PersonBuilder::setDateOfBirth); 15 | 16 | final BiConsumer setter; 17 | 18 | PersonBuilderLabel(BiConsumer setter) { 19 | this.setter = (BiConsumer) setter; 20 | } 21 | 22 | @Override 23 | public BiConsumer get() { 24 | return setter; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import java.io.Serializable; 4 | import java.util.function.Supplier; 5 | 6 | public class TrioBuilder implements Supplier, Serializable { 7 | 8 | private static final long serialVersionUID = 1L; 9 | private String text1; 10 | private String text2; 11 | private int number; 12 | 13 | 14 | @Override 15 | public Trio get() { 16 | return new Trio(text1,text2,number); 17 | } 18 | 19 | public static void setText1(TrioBuilder b,String txt) { 20 | b.text1 = txt; 21 | } 22 | public static void setText2(TrioBuilder b,String txt) { 23 | b.text2 = txt; 24 | } 25 | public static void setNumber(TrioBuilder b,Integer x) { 26 | b.number = x; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | conveyor 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.m2e.core.maven2Builder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.m2e.core.maven2Nature 26 | org.eclipse.wst.common.project.facet.core.nature 27 | org.eclipse.jdt.core.javanature 28 | 29 | 30 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/scalar_conveyor/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.scalar_conveyor; 5 | 6 | import java.util.Date; 7 | import java.util.function.Supplier; 8 | 9 | public class PersonBuilder implements Supplier { 10 | 11 | private String firstName; 12 | private String lastName; 13 | private Date dateOfBirth; 14 | 15 | public void setFirstName(String firstName) { 16 | this.firstName = firstName; 17 | } 18 | 19 | public void setLastName(String lastName) { 20 | this.lastName = lastName; 21 | } 22 | 23 | public void setDateOfBirth(Date dateOfBirth) { 24 | this.dateOfBirth = dateOfBirth; 25 | } 26 | 27 | @Override 28 | public Person get() { 29 | return new Person(firstName,lastName,dateOfBirth); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_builder_asynch/PersonBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_builder_asynch; 5 | 6 | import java.util.Date; 7 | import java.util.function.Supplier; 8 | 9 | public class PersonBuilder implements Supplier { 10 | 11 | private String firstName; 12 | private String lastName; 13 | private Date dateOfBirth; 14 | 15 | public void setFirstName(String firstName) { 16 | this.firstName = firstName; 17 | } 18 | 19 | public void setLastName(String lastName) { 20 | this.lastName = lastName; 21 | } 22 | 23 | public void setDateOfBirth(Date dateOfBirth) { 24 | this.dateOfBirth = dateOfBirth; 25 | } 26 | 27 | @Override 28 | public Person get() { 29 | return new Person(firstName,lastName,dateOfBirth); 30 | } 31 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import java.io.Serializable; 4 | import java.util.function.Supplier; 5 | 6 | public class TrioBuilder implements Supplier, Serializable{ 7 | 8 | 9 | private static final long serialVersionUID = 1L; 10 | private String text1; 11 | private String text2; 12 | private int number; 13 | 14 | 15 | @Override 16 | public Trio get() { 17 | return new Trio(text1,text2,number); 18 | } 19 | 20 | public static void setText1(TrioBuilder b,String txt) { 21 | b.text1 = txt; 22 | } 23 | public static void setText2(TrioBuilder b,String txt) { 24 | b.text2 = txt; 25 | } 26 | public static void setNumber(TrioBuilder b,Integer x) { 27 | b.number = x; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test11.yml: -------------------------------------------------------------------------------- 1 | test.testName: persistence end to end 11 2 | conveyor: 3 | c11: 4 | builderSupplier: new com.aegisql.conveyor.config.harness.StringSupplier("c11"); 5 | defaultBuilderTimeout: 1 SECONDS 6 | firstResultConsumer: new com.aegisql.conveyor.consumers.result.LogResult() 7 | firstScrapConsumer: new com.aegisql.conveyor.consumers.scrap.LogScrap() 8 | readyWhenAccepted: 9 | - 2 com.aegisql.conveyor.config.harness.NameLabel.FIRST 10 | - 2 com.aegisql.conveyor.config.harness.NameLabel.LAST 11 | - com.aegisql.conveyor.config.harness.NameLabel.END 12 | persistence: 13 | derby.p11.parts11: 14 | minCompactSize: 4 15 | keyClass: java.lang.Integer 16 | archiveStrategy: 17 | path: ./ 18 | maxFileSize: 1MB 19 | bucketSize: 50 20 | zip: true 21 | -------------------------------------------------------------------------------- /conveyor-persistence/src/test/java/org/conveyor/persistence/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.conveyor.persistence; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/map/MapConveyor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.map; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | 5 | import java.util.Map; 6 | 7 | // TODO: Auto-generated Javadoc 8 | /** 9 | * The Class MapConveyor. 10 | * 11 | * @param the key type 12 | * @param the generic type 13 | * @param the value type 14 | */ 15 | public class MapConveyor extends AssemblingConveyor> { 16 | 17 | /** 18 | * Instantiates a new map conveyor. 19 | */ 20 | public MapConveyor() { 21 | super(); 22 | this.setName("MapConveyor"); 23 | 24 | this.setDefaultCartConsumer((label,value,builder)->{ 25 | var mb = (MapBuilder)builder; 26 | if(label == null && value == null) { 27 | mb.complete(); 28 | } else { 29 | mb.add(label, (V)value); 30 | } 31 | }); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/utils/ConveyorAdapterTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.Conveyor; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | class ConveyorAdapterTest { 10 | 11 | class TestAdapterConveyor extends ConveyorAdapter{ 12 | 13 | /** 14 | * Constructs a AssemblingConveyorAdapter with the specified inner conveyor. 15 | * 16 | */ 17 | public TestAdapterConveyor() { 18 | super(new AssemblingConveyor<>()); 19 | } 20 | } 21 | 22 | @Test 23 | public void instanceTest() { 24 | TestAdapterConveyor c = new TestAdapterConveyor(); 25 | c.setName("TestAdapterConveyor"); 26 | c.stop(); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /conveyor-parallel/src/main/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/TaskManager.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 2 | 3 | import com.aegisql.conveyor.Testing; 4 | import com.aegisql.conveyor.exception.ConveyorRuntimeException; 5 | 6 | import java.util.function.Supplier; 7 | 8 | public class TaskManager implements Supplier, Testing { 9 | 10 | private T result; 11 | private boolean ready = false; 12 | 13 | public void done(T result) { 14 | this.result = result; 15 | this.ready = true; 16 | } 17 | 18 | public void error(Throwable error) { 19 | throw new ConveyorRuntimeException("Task failed",error); 20 | } 21 | 22 | @Override 23 | public T get() { 24 | return result; 25 | } 26 | 27 | @Override 28 | public boolean test() { 29 | return ready; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/consumers/scrap/StreamScrapTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.scrap; 2 | 3 | import com.aegisql.conveyor.ScrapBin; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.io.ByteArrayOutputStream; 7 | import java.io.IOException; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertNotNull; 10 | import static org.junit.jupiter.api.Assertions.assertThrows; 11 | 12 | public class StreamScrapTest { 13 | 14 | ByteArrayOutputStream os = new ByteArrayOutputStream(); 15 | 16 | @Test 17 | public void accept() throws IOException { 18 | StreamScrap ss = new StreamScrap<>(os); 19 | assertNotNull(ss.getPrintStream()); 20 | ss.close(); 21 | assertThrows(RuntimeException.class,()->ss.accept(new ScrapBin<>(null,1,this,"TEST", null, ScrapBin.FailureType.GENERAL_FAILURE,null,null))); 22 | } 23 | } -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/schedule/SchedulableClosure.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.schedule; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Interface SchedulableClosure. 6 | */ 7 | @FunctionalInterface 8 | public interface SchedulableClosure { 9 | 10 | /** 11 | * Apply. 12 | */ 13 | void apply(); 14 | 15 | /** 16 | * And then. 17 | * 18 | * @param next the next 19 | * @return the schedulable closure 20 | */ 21 | default SchedulableClosure andThen(SchedulableClosure next) { 22 | return () -> { 23 | this.apply(); 24 | next.apply(); 25 | }; 26 | } 27 | 28 | /** 29 | * Compose. 30 | * 31 | * @param next the next 32 | * @return the schedulable closure 33 | */ 34 | default SchedulableClosure compose(SchedulableClosure next) { 35 | return () -> { 36 | next.apply(); 37 | this.apply(); 38 | }; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/AcknowledgeStatusTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | import static org.junit.jupiter.api.Assertions.assertNotNull; 10 | 11 | public class AcknowledgeStatusTest { 12 | 13 | @Test 14 | public void testAckStatus() { 15 | Map pm = new HashMap<>(); 16 | pm.put("test", "TEST"); 17 | AcknowledgeStatus as = new AcknowledgeStatus<>(1, Status.READY, pm); 18 | System.out.println(as); 19 | assertNotNull(as.getProperties()); 20 | assertEquals(Integer.valueOf(1),as.getKey()); 21 | assertEquals(Status.READY,as.getStatus()); 22 | assertEquals("TEST",as.getProperty("test",String.class)); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/serial/SerializableBiPredicate.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.serial; 2 | 3 | import java.io.Serializable; 4 | import java.util.Map; 5 | import java.util.function.BiPredicate; 6 | import java.util.function.Predicate; 7 | 8 | @FunctionalInterface 9 | public interface SerializableBiPredicate extends BiPredicate, Serializable { 10 | 11 | SerializableBiPredicate ANY = (str,val)->true; 12 | 13 | static SerializableBiPredicate forKey(final String key, Predicate filter){ 14 | return (str,val)-> str.equals(key) && filter.test(val); 15 | } 16 | 17 | default boolean testMap(Map map) { 18 | for(Map.Entry entry: map.entrySet()) { 19 | if(this.test(entry.getKey(),entry.getValue())) { 20 | return true; 21 | } 22 | } 23 | return false; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/ConveyorTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.*; 6 | 7 | public class ConveyorTest { 8 | 9 | @Test 10 | public void getConsumerFor() { 11 | LabeledValueConsumer lc1 = Conveyor.getConsumerFor(null); 12 | LabeledValueConsumer lc2 = Conveyor.getConsumerFor(null,null); 13 | assertNotNull(lc1); 14 | assertNotNull(lc2); 15 | try{ 16 | lc1.accept("","",null); 17 | fail("Must fail"); 18 | } catch (Exception e) { } 19 | try{ 20 | lc2.accept("","",null); 21 | fail("Must fail"); 22 | } catch (Exception e) { } 23 | } 24 | 25 | @Test 26 | public void unRegister() { 27 | assertThrows(RuntimeException.class,()->Conveyor.unRegister("something wrong :")); 28 | } 29 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/engine/statement_executor/CachingStatementExecutor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.engine.statement_executor; 2 | 3 | import java.sql.Connection; 4 | import java.util.function.Supplier; 5 | 6 | /** 7 | * The type Caching statement executor. 8 | */ 9 | public class CachingStatementExecutor extends AbstractStatementExecutor { 10 | 11 | /** 12 | * Instantiates a new Caching statement executor. 13 | * 14 | * @param connectionSupplier the connection supplier 15 | */ 16 | public CachingStatementExecutor(Supplier connectionSupplier) { 17 | super(connectionSupplier); 18 | } 19 | 20 | 21 | @Override 22 | public void close() { 23 | // just do nothings. 24 | // close with the connection factory close method 25 | // if needed 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/consumers/scrap/IgnoreScrap.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.scrap; 2 | 3 | import com.aegisql.conveyor.Conveyor; 4 | import com.aegisql.conveyor.ScrapBin; 5 | 6 | // TODO: Auto-generated Javadoc 7 | /** 8 | * The Class IgnoreScrap. 9 | * 10 | * @param the key type 11 | */ 12 | public class IgnoreScrap implements ScrapConsumer{ 13 | 14 | public final static IgnoreScrap INSTANCE = new IgnoreScrap(); 15 | 16 | /* (non-Javadoc) 17 | * @see java.util.function.Consumer#accept(java.lang.Object) 18 | */ 19 | @Override 20 | public void accept(ScrapBin t) { 21 | //Ignore 22 | } 23 | 24 | /** 25 | * Of. 26 | * 27 | * @param the key type 28 | * @param conveyor the conveyor 29 | * @return the ignore scrap 30 | */ 31 | public static IgnoreScrap of(Conveyor conveyor) { 32 | return new IgnoreScrap<>(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/scalar_conveyor/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.scalar_conveyor; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_builder/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_builder; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/smart_conveyor/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.smart_conveyor; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/caching_conveyor/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.caching_conveyor; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/conveyor_timeout/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.conveyor_timeout; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/java/com/aegisql/conveyor/persistence/core/BinaryLogConfigTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core; 2 | 3 | import com.aegisql.conveyor.persistence.archive.BinaryLogConfiguration; 4 | import org.junit.jupiter.api.*; 5 | 6 | public class BinaryLogConfigTest { 7 | 8 | @BeforeAll 9 | public static void setUpBeforeClass() { 10 | } 11 | 12 | @AfterAll 13 | public static void tearDownAfterClass() { 14 | } 15 | 16 | @BeforeEach 17 | public void setUp() { 18 | } 19 | 20 | @AfterEach 21 | public void tearDown() { 22 | } 23 | 24 | @Test 25 | public void test() { 26 | BinaryLogConfiguration bc = BinaryLogConfiguration.builder().path("/tmp").partTableName("test").build(); 27 | 28 | String file = bc.getFilePath(); 29 | String fileStamped = bc.getStampedFilePath(); 30 | System.out.println(file); 31 | System.out.println(fileStamped); 32 | 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_conveyor/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_conveyor; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/conveyor_smart_builder/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.conveyor_smart_builder; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/conveyor_timeout_action/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.conveyor_timeout_action; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/smart_conveyor_labels/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.smart_conveyor_labels; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | } -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/InitiationServiceRegister.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import java.util.*; 4 | 5 | enum InitiationServiceRegister { 6 | SERVICES; 7 | 8 | private final ServiceLoader serviceLoader = ServiceLoader.load(ConveyorInitiatingService.class); 9 | 10 | public Set getLoadedConveyorNames() { 11 | var set = new HashSet(); 12 | serviceLoader.iterator().forEachRemaining(service->set.add(service.getConveyor().getName())); 13 | return set; 14 | } 15 | 16 | public List getLoadedConveyorServices() { 17 | var set = new ArrayList(); 18 | serviceLoader.iterator().forEachRemaining(service->{ 19 | set.add(service); 20 | }); 21 | return set; 22 | } 23 | 24 | public void reload() { 25 | serviceLoader.reload(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/reflection/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.reflection; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | public final String firstName; 11 | public final String lastName; 12 | public final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_builder_asynch/Person.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_builder_asynch; 5 | 6 | import java.util.Date; 7 | 8 | public class Person { 9 | 10 | final String firstName; 11 | final String lastName; 12 | final Date dateOfBirth; 13 | 14 | public Person(String firstName, String lastName, Date dateOfBirth) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.dateOfBirth = dateOfBirth; 18 | } 19 | 20 | public String getFirstName() { 21 | return firstName; 22 | } 23 | 24 | public String getLastName() { 25 | return lastName; 26 | } 27 | 28 | public Date getDateOfBirth() { 29 | return dateOfBirth; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Person [firstName=" + firstName + ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + "]"; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/utils/KeyValueTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.Objects; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class KeyValueTest { 10 | 11 | @Test 12 | public void basicTest() { 13 | new KeyValue<>(); 14 | var a100 = new KeyValue("A",100); 15 | var a200 = a100.value(200); 16 | var b200 = a200.key("B"); 17 | assertEquals("A",a100.key); 18 | assertEquals("A",a200.key); 19 | assertEquals("B",b200.key); 20 | assertEquals(Integer.valueOf(100),a100.value); 21 | assertEquals(Integer.valueOf(200),a200.value); 22 | assertEquals(Integer.valueOf(200),b200.value); 23 | assertEquals(Objects.hash("A",100),a100.hashCode()); 24 | assertEquals(a100,new KeyValue("A",100)); 25 | System.out.println(a100); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /conveyor-configurator/src/main/java/com/aegisql/conveyor/config/AssemblingConveyorMI.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.config; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.cart.Cart; 5 | import com.aegisql.conveyor.meta.ConveyorMetaInfo; 6 | 7 | import java.util.Queue; 8 | import java.util.function.Supplier; 9 | 10 | public class AssemblingConveyorMI extends AssemblingConveyor { 11 | 12 | private final ConveyorMetaInfo metaInfo; 13 | 14 | public AssemblingConveyorMI(ConveyorMetaInfo metaInfo) { 15 | super(); 16 | this.metaInfo = metaInfo; 17 | } 18 | 19 | public AssemblingConveyorMI(Supplier>> cartQueueSupplier, ConveyorMetaInfo metaInfo) { 20 | super(cartQueueSupplier); 21 | this.metaInfo = metaInfo; 22 | } 23 | 24 | @Override 25 | public ConveyorMetaInfo getMetaInfo() { 26 | return metaInfo; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/consumers/result/IgnoreResult.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.result; 2 | 3 | import com.aegisql.conveyor.Conveyor; 4 | import com.aegisql.conveyor.ProductBin; 5 | 6 | // TODO: Auto-generated Javadoc 7 | /** 8 | * The Class IgnoreResult. 9 | * 10 | * @param the key type 11 | * @param the element type 12 | */ 13 | public class IgnoreResult implements ResultConsumer { 14 | 15 | public final static IgnoreResult INSTANCE = new IgnoreResult(); 16 | 17 | /* (non-Javadoc) 18 | * @see java.util.function.Consumer#accept(java.lang.Object) 19 | */ 20 | @Override 21 | public void accept(ProductBin t) { 22 | //Ignore 23 | } 24 | 25 | /** 26 | * Of. 27 | * 28 | * @param the key type 29 | * @param the element type 30 | * @param conveyor the conveyor 31 | * @return the ignore result 32 | */ 33 | public static IgnoreResult of(Conveyor conveyor) { 34 | return new IgnoreResult<>(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/ClassToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | import com.aegisql.conveyor.persistence.core.PersistenceException; 4 | 5 | public class ClassToBytesConverter implements ObjectToByteArrayConverter { 6 | 7 | public ClassToBytesConverter() { 8 | // TODO Auto-generated constructor stub 9 | } 10 | 11 | @Override 12 | public byte[] toPersistence(Class obj) { 13 | return obj.getName().getBytes(); 14 | } 15 | 16 | @Override 17 | public Class fromPersistence(byte[] p) { 18 | if(p == null || p.length == 0) { 19 | return null; 20 | } 21 | try { 22 | return Class.forName(new String(p)); 23 | } catch (ClassNotFoundException e) { 24 | throw new PersistenceException(conversionHint()+" conversion error",e); 25 | } 26 | } 27 | 28 | @Override 29 | public String conversionHint() { 30 | return "Class:byte[]"; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /conveyor-parallel/src/main/java/com/aegisql/conveyor/parallel/utils/task_pool_conveyor/TaskPoolConveyorMBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.parallel.utils.task_pool_conveyor; 5 | 6 | import com.aegisql.conveyor.Conveyor; 7 | 8 | /** 9 | * The interface Task pool conveyor m bean. 10 | */ 11 | public interface TaskPoolConveyorMBean { 12 | 13 | /** 14 | * Gets name. 15 | * 16 | * @return the name 17 | */ 18 | String getName(); 19 | 20 | /** 21 | * Gets enclosed conveyor name. 22 | * 23 | * @return the enclosed conveyor name 24 | */ 25 | String getEnclosedConveyorName(); 26 | 27 | /** 28 | * Pool size int. 29 | * 30 | * @return the int 31 | */ 32 | int getPoolSize(); 33 | 34 | /** 35 | * Conveyor conveyor. 36 | * 37 | * @param the type parameter 38 | * @param the type parameter 39 | * @param the type parameter 40 | * @return the conveyor 41 | */ 42 | Conveyor conveyor(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/java/com/aegisql/conveyor/persistence/core/harness/SummBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import com.aegisql.conveyor.SmartLabel; 4 | 5 | import java.io.Serializable; 6 | import java.util.function.BiConsumer; 7 | import java.util.function.Supplier; 8 | 9 | public class SummBuilder implements Supplier,Serializable { 10 | 11 | public enum SummStep implements SmartLabel { 12 | ADD { 13 | @Override 14 | public BiConsumer get() { 15 | return SummBuilder::value; 16 | } 17 | }, 18 | DONE { 19 | @Override 20 | public BiConsumer get() { 21 | return (a,b)->{}; 22 | } 23 | } 24 | } 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | private long summ = 0; 29 | 30 | @Override 31 | public Long get() { 32 | return summ; 33 | } 34 | 35 | public static void value(SummBuilder b, Object val) { 36 | b.summ += (Long)val; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioBuilderExpireable.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import com.aegisql.conveyor.Expireable; 4 | 5 | import java.util.function.Supplier; 6 | 7 | public class TrioBuilderExpireable implements Supplier, Expireable{ 8 | 9 | 10 | private String text1; 11 | private String text2; 12 | private int number; 13 | private final long expirationTime = System.currentTimeMillis() + 1000; 14 | 15 | 16 | @Override 17 | public Trio get() { 18 | return new Trio(text1,text2,number); 19 | } 20 | 21 | public static void setText1(TrioBuilderExpireable b,String txt) { 22 | b.text1 = txt; 23 | } 24 | public static void setText2(TrioBuilderExpireable b,String txt) { 25 | b.text2 = txt; 26 | } 27 | public static void setNumber(TrioBuilderExpireable b,Integer x) { 28 | b.number = x; 29 | } 30 | 31 | @Override 32 | public long getExpirationTime() { 33 | return expirationTime ; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/delay_line/DelayLineConveyor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.delay_line; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.SmartLabel; 5 | import com.aegisql.conveyor.loaders.PartLoader; 6 | 7 | // TODO: Auto-generated Javadoc 8 | /** 9 | * The Class DelayLineConveyor. 10 | * 11 | * @param the key type 12 | * @param the generic type 13 | */ 14 | public class DelayLineConveyor extends AssemblingConveyor>, IN> { 15 | 16 | /** 17 | * Instantiates a new delay line conveyor. 18 | */ 19 | public DelayLineConveyor() { 20 | super(); 21 | this.setName("DelayLineConveyor"); 22 | this.setBuilderSupplier(DelayLineBuilder::new); 23 | } 24 | 25 | public SmartLabel> DELAY = SmartLabel.of((b,v)-> DelayLineBuilder.add(b, (IN)v)); 26 | 27 | @Override 28 | public PartLoader>> part() { 29 | return super.part().label(DELAY); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/utils/CartOutputStream.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.utils; 2 | 3 | import com.aegisql.conveyor.cart.Cart; 4 | import com.aegisql.conveyor.persistence.converters.CartToBytesConverter; 5 | 6 | import java.io.FilterOutputStream; 7 | import java.io.IOException; 8 | import java.io.OutputStream; 9 | 10 | public class CartOutputStream extends FilterOutputStream { 11 | 12 | private final CartToBytesConverter converter; 13 | 14 | private long totalSize = 0; 15 | 16 | public CartOutputStream(CartToBytesConverter converter, OutputStream out) { 17 | super(out); 18 | this.converter = converter; 19 | } 20 | 21 | public long writeCart(Cart cart) throws IOException { 22 | byte[] bytes = converter.toPersistence((Cart)cart); 23 | write(bytes); 24 | flush(); 25 | totalSize += bytes.length; 26 | return bytes.length; 27 | } 28 | 29 | public long getTotalWrittenBytes() { 30 | return totalSize; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/java/com/aegisql/conveyor/persistence/core/harness/ThreadPool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.persistence.core.harness; 5 | 6 | import java.util.concurrent.ExecutorService; 7 | import java.util.concurrent.Executors; 8 | import java.util.concurrent.Future; 9 | 10 | public class ThreadPool { 11 | 12 | private final ExecutorService pool; 13 | 14 | public ThreadPool() { 15 | pool = Executors.newFixedThreadPool(3); 16 | } 17 | 18 | public ThreadPool(int n) { 19 | pool = Executors.newFixedThreadPool(n); 20 | } 21 | 22 | public Future runAsynchWithDelay(long delay, Runnable runnable) { 23 | return pool.submit(()->{ 24 | try { 25 | Thread.sleep(delay); 26 | } catch (Exception e) {} 27 | runnable.run(); 28 | } 29 | ); 30 | } 31 | 32 | public Future runAsynch(Runnable runnable) { 33 | return pool.submit(runnable); 34 | } 35 | 36 | public void shutdown() { 37 | pool.shutdown(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/test/java/com/aegisql/conveyor/persistence/core/harness/ThreadPool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.persistence.core.harness; 5 | 6 | import java.util.concurrent.ExecutorService; 7 | import java.util.concurrent.Executors; 8 | import java.util.concurrent.Future; 9 | 10 | public class ThreadPool { 11 | 12 | private final ExecutorService pool; 13 | 14 | public ThreadPool() { 15 | pool = Executors.newFixedThreadPool(3); 16 | } 17 | 18 | public ThreadPool(int n) { 19 | pool = Executors.newFixedThreadPool(n); 20 | } 21 | 22 | public Future runAsynchWithDelay(long delay, Runnable runnable) { 23 | return pool.submit(()->{ 24 | try { 25 | Thread.sleep(delay); 26 | } catch (Exception e) {} 27 | runnable.run(); 28 | } 29 | ); 30 | } 31 | 32 | public Future runAsynch(Runnable runnable) { 33 | return pool.submit(runnable); 34 | } 35 | 36 | public void shutdown() { 37 | pool.shutdown(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/core/PersistenceInit.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core; 2 | 3 | public interface PersistenceInit { 4 | 5 | void initDatabase(String database); 6 | void initSchema(String schema); 7 | void initPartPersistence(Class keyClass, String partTableName); 8 | void initLogPersistence(Class keyClass, String partTableName); 9 | 10 | static PersistenceInit NO_ACTION(Class keyClass) { 11 | return new PersistenceInit<>() { 12 | @Override 13 | public void initDatabase(String database) { 14 | } 15 | 16 | @Override 17 | public void initSchema(String schema) { 18 | } 19 | 20 | @Override 21 | public void initPartPersistence(Class keyClass, String partTableName) { 22 | } 23 | 24 | @Override 25 | public void initLogPersistence(Class keyClass, String partTableName) { 26 | } 27 | }; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/NullConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | import com.aegisql.conveyor.persistence.core.ObjectConverter; 4 | 5 | // TODO: Auto-generated Javadoc 6 | /** 7 | * The Class NullConverter. 8 | */ 9 | public class NullConverter implements ObjectConverter { 10 | 11 | /* (non-Javadoc) 12 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 13 | */ 14 | @Override 15 | public byte[] toPersistence(Object obj) { 16 | return null; 17 | } 18 | 19 | /* (non-Javadoc) 20 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#fromPersistence(java.lang.Object) 21 | */ 22 | @Override 23 | public Object fromPersistence(byte[] p) { 24 | return null; 25 | } 26 | 27 | /* (non-Javadoc) 28 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#conversionHint() 29 | */ 30 | @Override 31 | public String conversionHint() { 32 | return "null:null"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/ReadinessPredicateTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.ArrayList; 6 | import java.util.HashMap; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertFalse; 9 | import static org.junit.jupiter.api.Assertions.assertTrue; 10 | 11 | public class ReadinessPredicateTest { 12 | 13 | @Test 14 | public void readinessPredicateTest() { 15 | 16 | ReadinessPredicate rp = (st, sup) -> st.key.equals(1) && sup.get().equals("test"); 17 | State st1 = new State<>( 18 | 1,0,0,0,0,0,new HashMap<>(),new ArrayList<>() 19 | ); 20 | rp=rp.or((st, sup) -> st.key.equals(2) && sup.get().equals("TEST")); 21 | assertTrue(rp.test(st1, ()->"test")); 22 | State st2 = new State<>( 23 | 2,0,0,0,0,0,new HashMap<>(),new ArrayList<>() 24 | ); 25 | assertTrue(rp.test(st2, ()->"TEST")); 26 | assertFalse(rp.test(st2, ()->"OTHER")); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /conveyor-configurator/src/test/java/com/aegisql/conveyor/config/harness/StringSupplier.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.config.harness; 2 | 3 | import java.io.Serializable; 4 | import java.util.function.Supplier; 5 | 6 | public class StringSupplier implements Supplier, Serializable { 7 | 8 | private String s; 9 | 10 | public StringSupplier() { 11 | System.out.println("StringSupplier init"); 12 | s = "TEST"; 13 | } 14 | 15 | public StringSupplier(String init) { 16 | System.out.println("StringSupplier init "+init); 17 | s = init; 18 | } 19 | 20 | 21 | @Override 22 | public String get() { 23 | return s; 24 | } 25 | 26 | public static void first(StringSupplier ss, String first) { 27 | System.out.println("StringSupplier first "+first); 28 | ss.s = first+ss.s; 29 | } 30 | 31 | public static void last(StringSupplier ss, String last) { 32 | System.out.println("StringSupplier last "+last); 33 | ss.s = ss.s+last; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "StringSupplier [" + (s != null ? "s=" + s : "") + "]"; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/demo/simple_builder/Demo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * COPYRIGHT (C) AEGIS DATA SOLUTIONS, LLC, 2015 3 | */ 4 | package com.aegisql.conveyor.demo.simple_builder; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.text.ParseException; 9 | import java.text.SimpleDateFormat; 10 | 11 | public class Demo { 12 | 13 | public static void main(String[] args) throws ParseException { 14 | 15 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); 16 | PersonBuilder builder = new PersonBuilder(); 17 | // << Builder is created, but it is empty. 18 | // Needs three pieces of data to build the person 19 | // Adding building parts in the same thread 20 | builder.setFirstName("John"); 21 | builder.setLastName("Silver"); 22 | builder.setDateOfBirth( format.parse("1695-11-10") ); 23 | // << Ok, here we know that we ready to build the Person 24 | Person person = builder.get(); 25 | 26 | System.out.println( person ); 27 | 28 | } 29 | 30 | @Test 31 | public void test() throws Exception { 32 | main(null); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test12.yml: -------------------------------------------------------------------------------- 1 | test.testName: persistence end to end 12 with connection pool 2 | conveyor: 3 | c12: 4 | javaPath: com.aegisql.conveyor.config.harness.TestBean 5 | builderSupplier: new com.aegisql.conveyor.config.harness.StringSupplier("c12"); 6 | defaultBuilderTimeout: javapath:(Duration millisec(10000)) 7 | firstResultConsumer: new com.aegisql.conveyor.consumers.result.LogResult() 8 | # firstResultConsumer: javapath:(com.aegisql.conveyor.consumers.result.LogResult logResult).@ 9 | firstScrapConsumer: new com.aegisql.conveyor.consumers.scrap.LogScrap() 10 | readyWhenAccepted: 11 | - 2 com.aegisql.conveyor.config.harness.NameLabel.FIRST 12 | - 2 com.aegisql.conveyor.config.harness.NameLabel.LAST 13 | - com.aegisql.conveyor.config.harness.NameLabel.END 14 | persistence: 15 | sqlite-memory.p12.parts12: 16 | dbcp2: true 17 | poolConnection: true 18 | keyClass: java.lang.Integer 19 | archiveStrategy: DELETE 20 | properties: 21 | user: tester 22 | password: secret 23 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-jdbc/src/main/java/com/aegisql/conveyor/persistence/jdbc/engine/statement_executor/NonCachingStatementExecutor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.jdbc.engine.statement_executor; 2 | 3 | import com.aegisql.conveyor.persistence.core.PersistenceException; 4 | 5 | import java.sql.Connection; 6 | import java.sql.SQLException; 7 | import java.util.function.Supplier; 8 | 9 | /** 10 | * The type Non caching statement executor. 11 | */ 12 | public class NonCachingStatementExecutor extends AbstractStatementExecutor { 13 | 14 | 15 | /** 16 | * Instantiates a new Non caching statement executor. 17 | * 18 | * @param connectionSupplier the connection supplier 19 | */ 20 | public NonCachingStatementExecutor(Supplier connectionSupplier) { 21 | super(connectionSupplier); 22 | } 23 | 24 | @Override 25 | public void close() { 26 | try { 27 | connection.close(); 28 | } catch (SQLException e) { 29 | throw new PersistenceException("Failed closing connection",e); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/arrays/BytesPrimToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters.arrays; 2 | 3 | import com.aegisql.conveyor.persistence.core.ObjectConverter; 4 | 5 | // TODO: Auto-generated Javadoc 6 | /** 7 | * The Class BytesPrimToBytesConverter. 8 | */ 9 | public class BytesPrimToBytesConverter implements ObjectConverter { 10 | 11 | /* (non-Javadoc) 12 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 13 | */ 14 | @Override 15 | public byte[] toPersistence(byte[] obj) { 16 | return obj; 17 | } 18 | 19 | /* (non-Javadoc) 20 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#fromPersistence(java.lang.Object) 21 | */ 22 | @Override 23 | public byte[] fromPersistence(byte[] p) { 24 | return p; 25 | } 26 | 27 | /* (non-Javadoc) 28 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#conversionHint() 29 | */ 30 | @Override 31 | public String conversionHint() { 32 | return "byte[]:byte[]"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/collection/CollectionBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.collection; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | import java.util.function.Supplier; 6 | 7 | // TODO: Auto-generated Javadoc 8 | /** 9 | * The Class CollectionBuilder. 10 | * 11 | * @param the generic type 12 | */ 13 | public class CollectionBuilder implements Supplier> { 14 | 15 | /** The collection. */ 16 | private final Collection collection; 17 | 18 | /** 19 | * Instantiates a new collection builder. 20 | */ 21 | public CollectionBuilder() { 22 | super(); 23 | this.collection = new ArrayList<>(); 24 | } 25 | 26 | /* (non-Javadoc) 27 | * @see java.util.function.Supplier#get() 28 | */ 29 | @Override 30 | public Collection get() { 31 | return collection; 32 | } 33 | 34 | /** 35 | * Adds the. 36 | * 37 | * @param the generic type 38 | * @param builder the builder 39 | * @param value the value 40 | */ 41 | public static void add(CollectionBuilder builder, T value) { 42 | builder.collection.add(value); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/ByteToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Class ByteToBytesConverter. 6 | */ 7 | public class ByteToBytesConverter implements ObjectToByteArrayConverter { 8 | 9 | /* (non-Javadoc) 10 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 11 | */ 12 | @Override 13 | public byte[] toPersistence(Byte obj) { 14 | if(obj==null) { 15 | return null; 16 | } 17 | return new byte[]{obj}; 18 | } 19 | 20 | /* (non-Javadoc) 21 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#fromPersistence(java.lang.Object) 22 | */ 23 | @Override 24 | public Byte fromPersistence(byte[] p) { 25 | if(p == null || p.length == 0) { 26 | return null; 27 | } 28 | return p[0]; 29 | } 30 | 31 | /* (non-Javadoc) 32 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#conversionHint() 33 | */ 34 | @Override 35 | public String conversionHint() { 36 | return "Byte:byte[]"; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/consumers/scrap/LastScrapsTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.scrap; 2 | 3 | import com.aegisql.conveyor.ScrapBin; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.util.HashMap; 7 | import java.util.List; 8 | 9 | import static org.junit.jupiter.api.Assertions.*; 10 | 11 | public class LastScrapsTest { 12 | 13 | public ScrapBin getScrapBin(int id,String scrap) { 14 | return new ScrapBin<>(null,id,scrap,"test",null, 15 | ScrapBin.FailureType.GENERAL_FAILURE,new HashMap<>(),null); 16 | } 17 | 18 | @Test 19 | public void lastScrapsTest() { 20 | LastScraps ls = new LastScraps<>(2); 21 | ls.accept(getScrapBin(1,"s1")); 22 | ls.accept(getScrapBin(2,"s2")); 23 | ls.accept(getScrapBin(3,"s3")); 24 | System.out.println(ls); 25 | List last = ls.getLast(); 26 | assertEquals(2,last.size()); 27 | assertTrue(last.contains("s2")); 28 | assertTrue(last.contains("s3")); 29 | LastScraps ls2 = LastScraps.of(null,3); 30 | assertNotNull(ls2); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /conveyor-configurator/src/test/resources/test14.properties: -------------------------------------------------------------------------------- 1 | conveyor.idleHeartBeat = 1.5 SECONDS 2 | conveyor.c14.defaultBuilderTimeout = 1 SECONDS 3 | conveyor.c14.rejectUnexpireableCartsOlderThan = 10000 4 | conveyor.c14.firstResultConsumer = new com.aegisql.conveyor.consumers.result.LogResult() 5 | conveyor.c14.firstScrapConsumer = new com.aegisql.conveyor.consumers.scrap.LogScrap() 6 | conveyor.c14.readyWhenAccepted = com.aegisql.conveyor.config.harness.NameLabel.FIRST,com.aegisql.conveyor.config.harness.NameLabel.LAST 7 | conveyor.c14.readyWhenAccepted = com.aegisql.conveyor.config.harness.NameLabel.END 8 | #METAINFO 9 | conveyor.c14.keyType = java.lang.Integer 10 | conveyor.c14.labelType = com.aegisql.conveyor.config.harness.NameLabel 11 | conveyor.c14.productType = java.lang.String 12 | conveyor.c14.supportedValueTypes = com.aegisql.conveyor.config.harness.NameLabel.FIRST java.lang.String,java.lang.String 13 | conveyor.c14.supportedValueTypes = com.aegisql.conveyor.config.harness.NameLabel.LAST java.lang.String,java.lang.String 14 | conveyor.c14.supportedValueTypes = com.aegisql.conveyor.config.harness.NameLabel.END java.lang.String,java.lang.Integer,java.lang.String,java.lang.String -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/archive/Archiver.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.archive; 2 | 3 | import com.aegisql.conveyor.persistence.core.Persistence; 4 | 5 | import java.util.Collection; 6 | 7 | // TODO: Auto-generated Javadoc 8 | /** 9 | * The Interface Archiver. 10 | * 11 | * @param the key type 12 | */ 13 | public interface Archiver { 14 | 15 | /** 16 | * Archive parts. 17 | * 18 | * @param ids the ids 19 | */ 20 | void archiveParts(Collection ids); 21 | 22 | /** 23 | * Archive keys. 24 | * 25 | * @param keys the keys 26 | */ 27 | void archiveKeys(Collection keys); 28 | 29 | /** 30 | * Archive complete keys. 31 | * 32 | * @param keys the keys 33 | */ 34 | void archiveCompleteKeys(Collection keys); 35 | 36 | /** 37 | * Archive expired parts. 38 | */ 39 | void archiveExpiredParts(); 40 | 41 | /** 42 | * Archive all. 43 | */ 44 | void archiveAll(); 45 | 46 | /** 47 | * Sets the persistence. 48 | * 49 | * @param persistence the new persistence 50 | */ 51 | void setPersistence(Persistence persistence); 52 | 53 | } 54 | 55 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/java/com/aegisql/conveyor/persistence/core/harness/TrioConveyor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.core.harness; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.Conveyor; 5 | import com.aegisql.conveyor.SmartLabel; 6 | import com.aegisql.conveyor.consumers.result.LogResult; 7 | import com.aegisql.conveyor.consumers.result.ResultMap; 8 | import com.aegisql.conveyor.consumers.scrap.LogScrap; 9 | 10 | 11 | 12 | public class TrioConveyor extends AssemblingConveyor, Trio> { 13 | 14 | public final ResultMap results = new ResultMap<>(); 15 | 16 | public TrioConveyor() { 17 | this.setName("TrioConveyor"); 18 | this.setBuilderSupplier(TrioBuilder::new); 19 | this.resultConsumer(LogResult.debug(this)).andThen(results).set(); 20 | this.scrapConsumer(LogScrap.error(this)).set(); 21 | this.setReadinessEvaluator(Conveyor.getTesterFor(this).accepted(TrioPart.TEXT1,TrioPart.TEXT2,TrioPart.NUMBER)); 22 | } 23 | 24 | @Override 25 | public String toString() { 26 | return this.getName()+" [results=" + results + "]"; 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/consumers/result/ProductConsumer.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.consumers.result; 2 | 3 | import com.aegisql.conveyor.Conveyor; 4 | import com.aegisql.conveyor.ProductBin; 5 | 6 | import java.util.function.Consumer; 7 | import java.util.function.Function; 8 | 9 | /** 10 | * The type Product consumer. 11 | * 12 | * @param the type parameter 13 | */ 14 | public class ProductConsumer implements ResultConsumer{ 15 | 16 | private final Consumer consumer; 17 | 18 | /** 19 | * Of function. 20 | * 21 | * @param the type parameter 22 | * @param the type parameter 23 | * @param conveyor the conveyor 24 | * @return the function 25 | */ 26 | public static Function, ResultConsumer> of(Conveyor conveyor) { 27 | return consumer -> (ResultConsumer) new ProductConsumer(consumer); 28 | } 29 | 30 | private ProductConsumer(Consumer consumer) { 31 | this.consumer = consumer; 32 | } 33 | 34 | @Override 35 | public void accept(ProductBin bin) { 36 | consumer.accept(bin.product); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/BooleanToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Class BooleanToBytesConverter. 6 | */ 7 | public class BooleanToBytesConverter implements ObjectToByteArrayConverter { 8 | 9 | /* (non-Javadoc) 10 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 11 | */ 12 | @Override 13 | public byte[] toPersistence(Boolean obj) { 14 | if(obj==null) { 15 | return null; 16 | } 17 | return new byte[]{(byte) (obj?1:0)}; 18 | } 19 | 20 | /* (non-Javadoc) 21 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#fromPersistence(java.lang.Object) 22 | */ 23 | @Override 24 | public Boolean fromPersistence(byte[] p) { 25 | if(p == null || p.length == 0) { 26 | return null; 27 | } 28 | return p[0] != 0; 29 | } 30 | 31 | /* (non-Javadoc) 32 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#conversionHint() 33 | */ 34 | @Override 35 | public String conversionHint() { 36 | return "Boolean:byte[]"; 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/test/java/com/aegisql/conveyor/persistence/utils/PersistUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.utils; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.io.IOException; 6 | import java.util.zip.DataFormatException; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | import static org.junit.jupiter.api.Assertions.assertTrue; 10 | 11 | public class PersistUtilsTest { 12 | 13 | @Test 14 | public void compressDecompressTest() throws IOException, DataFormatException { 15 | 16 | String test = "Test Test Test Test Test Test Test"; 17 | byte[] compressed = PersistUtils.compress(test.getBytes()); 18 | byte[] decompressed = PersistUtils.decompress(compressed); 19 | System.out.println("Test length: "+test.length()); 20 | System.out.println("Compressed length: "+compressed.length); 21 | System.out.println("Compressed: "+new String(compressed)); 22 | System.out.println("Decompressed length: "+decompressed.length); 23 | assertEquals(test,new String(decompressed)); 24 | assertTrue(compressed.length < decompressed.length); 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/ConveyorInitiatingServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import static org.junit.jupiter.api.Assertions.*; 9 | 10 | public class ConveyorInitiatingServiceTest { 11 | 12 | @Test 13 | public void loadServiceTest() { 14 | Set loadedConveyorNames = Conveyor.getLoadedConveyorNames(); 15 | assertNotNull(loadedConveyorNames); 16 | assertTrue(loadedConveyorNames.contains("SimpleTestServiceConveyor")); 17 | Conveyor simpleTestServiceConveyor = Conveyor.byName("SimpleTestServiceConveyor"); 18 | assertNotNull(simpleTestServiceConveyor); 19 | List loadedConveyorServices = Conveyor.getLoadedConveyorServices(); 20 | assertNotNull(loadedConveyorServices); 21 | assertTrue(loadedConveyorServices.size()>0); 22 | ConveyorInitiatingService conveyorInitiatingService = loadedConveyorServices.get(0); 23 | assertNotNull(conveyorInitiatingService); 24 | assertEquals(simpleTestServiceConveyor,conveyorInitiatingService.getConveyor()); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /conveyor-parallel/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.aegisql 6 | conveyor 7 | 1.7.3-SNAPSHOT 8 | 9 | com.aegisql 10 | conveyor-parallel 11 | ${project.version} 12 | conveyor-parallel 13 | http://maven.apache.org 14 | 15 | UTF-8 16 | 17 | 18 | 19 | com.aegisql 20 | conveyor-core 21 | ${project.version} 22 | 23 | 24 | 25 | AEGIS DATA SOLUTIONS, LLC 26 | http://www.aegisql.com 27 | 28 | Implementation of Parallel Conveyor interface 29 | 30 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/scalar/ScalarConvertingConveyor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.scalar; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.Conveyor; 5 | import com.aegisql.conveyor.loaders.PartLoader; 6 | 7 | // TODO: Auto-generated Javadoc 8 | /** 9 | * The Class ScalarConvertingConveyor. 10 | * 11 | * @param the key type 12 | * @param the generic type 13 | * @param the generic type 14 | */ 15 | public class ScalarConvertingConveyor extends AssemblingConveyor { 16 | 17 | /** 18 | * Instantiates a new scalar converting conveyor. 19 | */ 20 | public ScalarConvertingConveyor() { 21 | super(); 22 | this.setName("ScalarConvertingConveyor"); 23 | this.setReadinessEvaluator((state,builder) -> true ); //ready right after evaluation 24 | this.setDefaultCartConsumer(Conveyor.getConsumerFor(this).filter(l->true, (b,v)->{ 25 | ScalarConvertingBuilder builder = (ScalarConvertingBuilder)b; 26 | ScalarConvertingBuilder.add(builder, v); 27 | }) 28 | ); 29 | } 30 | 31 | @Override 32 | public PartLoader part() { 33 | return super.part().label("SCALAR"); 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/user/LowerCaseUserBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.user; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Class LowerCaseUserBuilder. 6 | */ 7 | public class LowerCaseUserBuilder extends AbstractSmartUserBuilder { 8 | 9 | /* (non-Javadoc) 10 | * @see java.util.function.Supplier#get() 11 | */ 12 | @Override 13 | public User get() { 14 | return new LowerUser(first, last, yearOfBirth); 15 | } 16 | 17 | /* (non-Javadoc) 18 | * @see com.aegisql.conveyor.user.AbstractSmartUserBuilder#acceptYearOfBirth(java.lang.Integer) 19 | */ 20 | @Override 21 | public void acceptYearOfBirth(Integer yob) { 22 | this.yearOfBirth = yob; 23 | } 24 | 25 | /* (non-Javadoc) 26 | * @see com.aegisql.conveyor.user.AbstractSmartUserBuilder#acceptFirst(java.lang.String) 27 | */ 28 | @Override 29 | public void acceptFirst(String first) { 30 | this.first = first.toLowerCase(); 31 | } 32 | 33 | /* (non-Javadoc) 34 | * @see com.aegisql.conveyor.user.AbstractSmartUserBuilder#acceptLast(java.lang.String) 35 | */ 36 | @Override 37 | public void acceptLast(String last) { 38 | this.last = last.toLowerCase(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/user/UpperCaseUserBuilder.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.user; 2 | 3 | // TODO: Auto-generated Javadoc 4 | /** 5 | * The Class UpperCaseUserBuilder. 6 | */ 7 | public class UpperCaseUserBuilder extends AbstractSmartUserBuilder { 8 | 9 | /* (non-Javadoc) 10 | * @see java.util.function.Supplier#get() 11 | */ 12 | @Override 13 | public User get() { 14 | return new UpperUser(first, last, yearOfBirth); 15 | } 16 | 17 | /* (non-Javadoc) 18 | * @see com.aegisql.conveyor.user.AbstractSmartUserBuilder#acceptYearOfBirth(java.lang.Integer) 19 | */ 20 | @Override 21 | public void acceptYearOfBirth(Integer yob) { 22 | this.yearOfBirth = yob; 23 | } 24 | 25 | /* (non-Javadoc) 26 | * @see com.aegisql.conveyor.user.AbstractSmartUserBuilder#acceptFirst(java.lang.String) 27 | */ 28 | @Override 29 | public void acceptFirst(String first) { 30 | this.first = first.toUpperCase(); 31 | } 32 | 33 | /* (non-Javadoc) 34 | * @see com.aegisql.conveyor.user.AbstractSmartUserBuilder#acceptLast(java.lang.String) 35 | */ 36 | @Override 37 | public void acceptLast(String last) { 38 | this.last = last.toUpperCase(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/caching/ImmutableValueConsumer.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.caching; 2 | 3 | import com.aegisql.conveyor.LabeledValueConsumer; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | import java.io.Serial; 8 | 9 | // TODO: Auto-generated Javadoc 10 | /** 11 | * The Class ImmutableValueConsumer. 12 | * 13 | * @param the generic type 14 | */ 15 | public class ImmutableValueConsumer implements LabeledValueConsumer>{ 16 | 17 | @Serial 18 | private static final long serialVersionUID = 1L; 19 | /** The Constant LOG. */ 20 | protected final static Logger LOG = LoggerFactory.getLogger(ImmutableValueConsumer.class); 21 | 22 | /** 23 | * Instantiates a new immutable value consumer. 24 | */ 25 | public ImmutableValueConsumer() { 26 | 27 | } 28 | 29 | /* (non-Javadoc) 30 | * @see com.aegisql.conveyor.LabeledValueConsumer#accept(java.lang.Object, java.lang.Object, java.lang.Object) 31 | */ 32 | @Override 33 | public void accept(Object label, Object value, ImmutableReference builder) { 34 | LOG.warn("Unexpected event for immutable cache {} {} {}",label,value,builder); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/LinkedHashMapAccessOrderTest.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | 7 | public class LinkedHashMapAccessOrderTest { 8 | 9 | @Test 10 | public void testAccessOrder() { 11 | // Create a LinkedHashMap with access order 12 | java.util.LinkedHashMap map = new java.util.LinkedHashMap<>(16, 0.75f, true); 13 | 14 | // Add some entries 15 | map.put("key1", "value1"); 16 | map.put("key2", "value2"); 17 | map.put("key3", "value3"); 18 | System.out.println(map.keySet()); 19 | assertEquals("key1", map.entrySet().stream().findFirst().get().getKey()); 20 | // Access some entries 21 | map.get("key1"); 22 | map.get("key2"); 23 | // Print the order of keys 24 | System.out.println(map.keySet()); 25 | assertEquals("key3", map.entrySet().stream().findFirst().get().getKey()); 26 | map.get("key3"); 27 | System.out.println(map.keySet()); 28 | assertEquals("key1", map.entrySet().stream().findFirst().get().getKey()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/StringToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | import java.nio.charset.StandardCharsets; 4 | 5 | // TODO: Auto-generated Javadoc 6 | /** 7 | * The Class StringToBytesConverter. 8 | */ 9 | public class StringToBytesConverter implements ObjectToByteArrayConverter { 10 | 11 | /* (non-Javadoc) 12 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 13 | */ 14 | @Override 15 | public byte[] toPersistence(String obj) { 16 | if(obj==null) { 17 | return null; 18 | } 19 | return obj.getBytes(StandardCharsets.UTF_8); 20 | } 21 | 22 | /* (non-Javadoc) 23 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#fromPersistence(java.lang.Object) 24 | */ 25 | @Override 26 | public String fromPersistence(byte[] p) { 27 | if(p == null || p.length == 0) { 28 | return null; 29 | } 30 | return new String(p); 31 | } 32 | 33 | /* (non-Javadoc) 34 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#conversionHint() 35 | */ 36 | @Override 37 | public String conversionHint() { 38 | return "String:byte[]"; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/BigIntegerToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters; 2 | 3 | import java.math.BigInteger; 4 | 5 | // TODO: Auto-generated Javadoc 6 | /** 7 | * The Class BigIntegerToBytesConverter. 8 | */ 9 | public class BigIntegerToBytesConverter implements ObjectToByteArrayConverter { 10 | 11 | /* (non-Javadoc) 12 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#toPersistence(java.lang.Object) 13 | */ 14 | @Override 15 | public byte[] toPersistence(BigInteger obj) { 16 | if(obj==null) { 17 | return null; 18 | } 19 | return obj.toByteArray(); 20 | } 21 | 22 | /* (non-Javadoc) 23 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#fromPersistence(java.lang.Object) 24 | */ 25 | @Override 26 | public BigInteger fromPersistence(byte[] p) { 27 | if(p == null || p.length == 0) { 28 | return null; 29 | } 30 | return new BigInteger(p); 31 | } 32 | 33 | /* (non-Javadoc) 34 | * @see com.aegisql.conveyor.persistence.core.ObjectConverter#conversionHint() 35 | */ 36 | @Override 37 | public String conversionHint() { 38 | return "BigInteger:byte[]"; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /conveyor-core/src/test/java/com/aegisql/conveyor/poc/aggregator/model/Item.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.poc.aggregator.model; 2 | 3 | public class Item { 4 | 5 | String name; 6 | double unitPrice; 7 | int numberOfItems; 8 | 9 | public String getName() { 10 | return name; 11 | } 12 | 13 | public void setName(String name) { 14 | this.name = name; 15 | } 16 | 17 | public double getUnitPrice() { 18 | return unitPrice; 19 | } 20 | 21 | public double getTotalPrice() { 22 | return unitPrice * numberOfItems; 23 | } 24 | 25 | public void setUnitPrice(double unitPrice) { 26 | this.unitPrice = unitPrice; 27 | } 28 | 29 | public int getNumberOfItems() { 30 | return numberOfItems; 31 | } 32 | 33 | public void setNumberOfItems(int numberOfItems) { 34 | this.numberOfItems = numberOfItems; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | final StringBuilder sb = new StringBuilder("Item{"); 40 | sb.append(name); 41 | sb.append(", unitPrice=").append(unitPrice); 42 | sb.append(", numberOfItems=").append(numberOfItems); 43 | sb.append('}'); 44 | return sb.toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /conveyor-core/src/main/java/com/aegisql/conveyor/utils/collection/CollectionConveyor.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.utils.collection; 2 | 3 | import com.aegisql.conveyor.AssemblingConveyor; 4 | import com.aegisql.conveyor.Conveyor; 5 | import com.aegisql.conveyor.SmartLabel; 6 | import com.aegisql.conveyor.loaders.PartLoader; 7 | 8 | import java.util.Collection; 9 | 10 | // TODO: Auto-generated Javadoc 11 | /** 12 | * The Class CollectionConveyor. 13 | * 14 | * @param the key type 15 | * @param the value type 16 | */ 17 | public class CollectionConveyor extends AssemblingConveyor>, Collection> { 18 | 19 | /** 20 | * Instantiates a new collection conveyor. 21 | */ 22 | public CollectionConveyor() { 23 | super(); 24 | this.setName("CollectionConveyor"); 25 | this.setReadinessEvaluator(Conveyor.getTesterFor(this).accepted(COMPLETE)); 26 | } 27 | 28 | public final SmartLabel> ITEM = SmartLabel.of((b,v)-> CollectionBuilder.add(b, (V)v)); 29 | 30 | public final SmartLabel> COMPLETE = SmartLabel.of(()->{}); 31 | 32 | @Override 33 | public PartLoader>> part() { 34 | return super.part().label(ITEM); 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/arrays/sql/SqlDatesToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters.arrays.sql; 2 | 3 | import com.aegisql.conveyor.persistence.converters.arrays.ObjectArrayToByteArrayConverter; 4 | 5 | import java.nio.ByteBuffer; 6 | import java.sql.Date; 7 | 8 | public class SqlDatesToBytesConverter implements ObjectArrayToByteArrayConverter { 9 | 10 | @Override 11 | public byte[] toPersistence(Date[] obj) { 12 | if(obj == null) { 13 | return null; 14 | } 15 | byte[] res = new byte[8*obj.length]; 16 | 17 | ByteBuffer bb = ByteBuffer.wrap(res); 18 | 19 | for(int i = 0; i < obj.length; i++) { 20 | bb.putLong(8*i, obj[i].getTime()); 21 | } 22 | 23 | return res; 24 | } 25 | 26 | @Override 27 | public Date[] fromPersistence(byte[] p) { 28 | if(p == null) { 29 | return null; 30 | } 31 | Date[] res = new Date[p.length/8]; 32 | ByteBuffer bb = ByteBuffer.wrap(p); 33 | 34 | for(int i = 0; i < res.length; i++) { 35 | res[i] = new Date(bb.getLong(8*i)); 36 | } 37 | 38 | return res; 39 | } 40 | 41 | @Override 42 | public String conversionHint() { 43 | return "java.sql.Date[]:byte[]"; 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /conveyor-persistence/conveyor-persistence-core/src/main/java/com/aegisql/conveyor/persistence/converters/arrays/sql/SqlTimesToBytesConverter.java: -------------------------------------------------------------------------------- 1 | package com.aegisql.conveyor.persistence.converters.arrays.sql; 2 | 3 | import com.aegisql.conveyor.persistence.converters.arrays.ObjectArrayToByteArrayConverter; 4 | 5 | import java.nio.ByteBuffer; 6 | import java.sql.Time; 7 | 8 | public class SqlTimesToBytesConverter implements ObjectArrayToByteArrayConverter