├── .gitignore ├── Dockerfile ├── Jenkinsfile ├── LICENSE.TXT ├── jasdb-cluster ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── cluster │ │ │ ├── BootstrapClusterProcess.java │ │ │ ├── ClusterBuilder.java │ │ │ ├── ClusterConfiguration.java │ │ │ ├── ClusterManagerImpl.java │ │ │ ├── JasDBNodeStarter.java │ │ │ ├── JoinClusterProcess.java │ │ │ ├── JoinProcess.java │ │ │ ├── PartitionConfig.java │ │ │ ├── api │ │ │ ├── ClusterClient.java │ │ │ ├── ClusterManager.java │ │ │ ├── ClusterNode.java │ │ │ ├── DistributedLock.java │ │ │ └── DistributedMap.java │ │ │ ├── copycat │ │ │ ├── CopyCatClusterClient.java │ │ │ ├── CopyCatClusterNode.java │ │ │ ├── CopyCatStateMachine.java │ │ │ ├── lock │ │ │ │ ├── LockClientImpl.java │ │ │ │ ├── LockCommand.java │ │ │ │ ├── LockStateMachine.java │ │ │ │ └── UnlockCommand.java │ │ │ └── map │ │ │ │ ├── GetCommand.java │ │ │ │ ├── GetSizeCommand.java │ │ │ │ ├── GetValuesCommand.java │ │ │ │ ├── MapClientImpl.java │ │ │ │ ├── MapStateMachine.java │ │ │ │ ├── PutCommand.java │ │ │ │ └── RemoveCommand.java │ │ │ ├── model │ │ │ ├── HexRange.java │ │ │ ├── Partition.java │ │ │ ├── PartitionStatus.java │ │ │ └── PartitionType.java │ │ │ └── test │ │ │ ├── BootstrapNode.java │ │ │ └── ReplicaNode.java │ └── resources │ │ ├── jasdb-cluster.xml │ │ ├── jasdb-shard1.xml │ │ └── logback.xml │ └── test │ └── java │ └── com │ └── oberasoftware │ └── jasdb │ └── cluster │ └── HexRangeTest.java ├── jasdb-engine ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── engine │ │ ├── BagOperationUtil.java │ │ ├── DBInstanceFactoryImpl.java │ │ ├── DBInstanceImpl.java │ │ ├── EngineConfiguation.java │ │ ├── HomeLocatorUtil.java │ │ ├── IdGenerator.java │ │ ├── JasDBConfigurationLoader.java │ │ ├── LocalStorageServiceFactoryImpl.java │ │ ├── LocalStorageServiceImpl.java │ │ ├── MachineGuidGenerator.java │ │ ├── RecordWriterFactoryLoader.java │ │ ├── StorageFlushThread.java │ │ ├── StorageService.java │ │ ├── StorageServiceFactory.java │ │ ├── indexing │ │ ├── IndexItemIterator.java │ │ ├── IndexManagerFactoryImpl.java │ │ ├── IndexManagerImpl.java │ │ ├── IndexScanAndRecovery.java │ │ └── IndexTypes.java │ │ ├── metadata │ │ ├── BagMeta.java │ │ ├── Constants.java │ │ ├── InstanceMeta.java │ │ ├── JasDBMetadataStore.java │ │ └── MetaWrapper.java │ │ ├── operations │ │ ├── BagInsertOperation.java │ │ ├── BagPersistOperation.java │ │ ├── BagRemoveOperation.java │ │ ├── BagUpdateOperation.java │ │ └── DataOperation.java │ │ ├── query │ │ ├── BuilderTransformer.java │ │ ├── EntityQueryResult.java │ │ ├── StorageRecordIterator.java │ │ └── operators │ │ │ ├── AbstractBlock.java │ │ │ ├── AndBlock.java │ │ │ ├── BlockMerger.java │ │ │ ├── BlockOperation.java │ │ │ ├── DistinctCollectionUtil.java │ │ │ ├── OrBlock.java │ │ │ └── mergers │ │ │ ├── AndBlockMerger.java │ │ │ └── OrBlockMerger.java │ │ └── search │ │ ├── EntityRetrievalOperation.java │ │ ├── PropertyKeyMapper.java │ │ ├── QueryResultIteratorImpl.java │ │ ├── QuerySearchOperation.java │ │ └── TableScanOperation.java │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── engine │ │ ├── DBInstanceFactoryImplTest.java │ │ ├── DBInstanceImplTest.java │ │ ├── JasDBMetadataStoreTest.java │ │ ├── LocalStorageServiceFactoryImplTest.java │ │ ├── StorageFlushThreadTest.java │ │ ├── ThroughputTest.java │ │ └── indexing │ │ └── IndexManagementTest.java │ └── resources │ └── logback.xml ├── jasdb-service ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── service │ │ │ ├── EngineManagerImpl.java │ │ │ ├── JasDBMain.java │ │ │ ├── KernelShutdown.java │ │ │ ├── KernelShutdownMBean.java │ │ │ ├── RemoteServiceManagerImpl.java │ │ │ ├── ServiceConfiguration.java │ │ │ └── local │ │ │ ├── ApplicationContextProvider.java │ │ │ ├── EntityBagImpl.java │ │ │ ├── LocalDBSession.java │ │ │ ├── LocalDBSessionFactory.java │ │ │ ├── LocalUserAdministration.java │ │ │ └── QueryExecutorImpl.java │ └── resources │ │ ├── META-INF │ │ └── spring │ │ │ ├── app-context.xml │ │ │ └── jasdb-core.xml │ │ └── application.properties │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── service │ │ ├── ConcurrencyTest.java │ │ ├── IndexRebuildTest.java │ │ └── local │ │ └── LocalDBSessionFactoryTest.java │ └── resources │ ├── jasdb.xml │ └── logback.xml ├── jasdb_acl ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── acl │ │ │ ├── AuthorizationServiceWrapper.java │ │ │ ├── BasicCredentials.java │ │ │ ├── EncryptedGrants.java │ │ │ ├── GrantMeta.java │ │ │ ├── GrantMetadataProvider.java │ │ │ ├── GrantObjectMeta.java │ │ │ ├── ImmutableGrantObject.java │ │ │ ├── LocalCredentialsProvider.java │ │ │ ├── SecureUserSession.java │ │ │ ├── SessionManagerImpl.java │ │ │ ├── UserManagerImpl.java │ │ │ ├── UserMeta.java │ │ │ └── UserMetadataProvider.java │ └── resources │ │ └── META-INF │ │ ├── services │ │ └── com.oberasoftware.jasdb.api.engine.MetadataProvider │ │ └── spring │ │ └── jasdb-security.xml │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── acl │ │ ├── AbstractAuthorizationTest.java │ │ ├── AuthorizationOperation.java │ │ ├── EntityGetOperationTest.java │ │ ├── EntityInsertAuthorizationTest.java │ │ ├── EntityRemoveOperationTest.java │ │ ├── EntityUpdateOperationTest.java │ │ └── MockLocalStorageFactory.java │ └── resources │ ├── jasdb-security-test.xml │ ├── jasdb.xml │ └── logback.xml ├── jasdb_api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── oberasoftware │ └── jasdb │ └── api │ ├── caching │ ├── Bucket.java │ ├── CachableItem.java │ ├── CacheEntry.java │ ├── CacheRegion.java │ └── MemoryAware.java │ ├── concurrency │ └── ReadWriteLock.java │ ├── engine │ ├── Configuration.java │ ├── ConfigurationLoader.java │ ├── DBInstanceFactory.java │ ├── EngineManager.java │ ├── IndexManager.java │ ├── IndexManagerFactory.java │ ├── MetadataProvider.java │ ├── MetadataStore.java │ ├── RemoteService.java │ └── RemoteServiceManager.java │ ├── entitymapper │ ├── EntityManager.java │ ├── EntityMapper.java │ ├── EntityMetadata.java │ ├── MapResult.java │ ├── PropertyMetadata.java │ ├── TypeMapper.java │ └── annotations │ │ ├── Id.java │ │ ├── JasDBEntity.java │ │ └── JasDBProperty.java │ ├── exceptions │ ├── ConfigurationException.java │ ├── ConfigurationNotFoundException.java │ ├── CoreConfigException.java │ ├── DatastoreException.java │ ├── FileException.java │ ├── JasDBException.java │ ├── JasDBSecurityException.java │ ├── JasDBStorageException.java │ ├── LockingException.java │ ├── MetadataParseException.java │ ├── RecordNotFoundException.java │ ├── RecordStoreInUseException.java │ ├── ReflectionException.java │ ├── RestException.java │ ├── RuntimeJasDBException.java │ └── SyntaxException.java │ ├── index │ ├── CompositeIndexField.java │ ├── Index.java │ ├── IndexField.java │ ├── IndexHeader.java │ ├── IndexIterator.java │ ├── IndexScanReport.java │ ├── IndexState.java │ ├── MemoryConstants.java │ ├── ScanIntent.java │ ├── keys │ │ ├── ComparableKey.java │ │ ├── CompareMethod.java │ │ ├── CompareResult.java │ │ ├── Key.java │ │ ├── KeyFactory.java │ │ ├── KeyInfo.java │ │ ├── KeyLoadResult.java │ │ ├── KeyNameMapper.java │ │ └── KeyType.java │ └── query │ │ ├── IndexSearchResultIterator.java │ │ ├── IndexSearchResultIteratorCollection.java │ │ ├── SearchCondition.java │ │ └── SearchLimit.java │ ├── model │ ├── Bag.java │ ├── CacheConfig.java │ ├── Grant.java │ ├── GrantObject.java │ ├── IndexDefinition.java │ ├── Instance.java │ ├── NodeInformation.java │ ├── ServiceInformation.java │ └── User.java │ ├── security │ ├── AccessMode.java │ ├── Credentials.java │ ├── CredentialsProvider.java │ ├── CryptoEngine.java │ ├── SessionManager.java │ ├── UserManager.java │ └── UserSession.java │ ├── session │ ├── DBInstance.java │ ├── DBSession.java │ ├── DBSessionFactory.java │ ├── Entity.java │ ├── EntityBag.java │ ├── IndexableItem.java │ ├── Property.java │ ├── UserAdministration.java │ ├── Value.java │ └── query │ │ ├── BlockType.java │ │ ├── CompositeQueryField.java │ │ ├── FieldBuilder.java │ │ ├── Order.java │ │ ├── QueryBuilder.java │ │ ├── QueryExecutor.java │ │ ├── QueryField.java │ │ ├── QueryFieldOperator.java │ │ ├── QueryResult.java │ │ └── SortParameter.java │ └── storage │ ├── Block.java │ ├── ClonableDataStream.java │ ├── DataBlock.java │ ├── DataBlockFactory.java │ ├── DataBlockHeader.java │ ├── DataBlockResult.java │ ├── RecordIterator.java │ ├── RecordResult.java │ ├── RecordWriter.java │ └── RecordWriterFactory.java ├── jasdb_apiconnector ├── pom.xml └── src │ └── main │ └── java │ └── nl │ └── renarj │ └── jasdb │ └── api │ ├── DBConnectorSession.java │ ├── RemoteEntityBag.java │ ├── RemoteQueryExecutor.java │ └── RemoteUserAdministration.java ├── jasdb_assembly ├── pom.xml └── src │ ├── assembly │ └── assembly.xml │ └── main │ └── resources │ ├── jasdb.xml │ ├── license.txt │ ├── logback.xml │ ├── start.bat │ ├── start.sh │ ├── stop.bat │ └── stop.sh ├── jasdb_buildtools ├── pom.xml └── src │ └── main │ └── resources │ ├── checkstyle-suppressions.xml │ └── jasdb_checkstyle.xml ├── jasdb_connector ├── pom.xml └── src │ ├── main │ └── java │ │ └── nl │ │ └── renarj │ │ └── jasdb │ │ └── remote │ │ ├── BagConnector.java │ │ ├── ConnectorLoader.java │ │ ├── EntityConnector.java │ │ ├── InstanceConnector.java │ │ ├── RemoteConnector.java │ │ ├── RemoteConnectorFactory.java │ │ ├── RemotingContext.java │ │ ├── TokenConnector.java │ │ ├── UserConnector.java │ │ ├── exceptions │ │ └── RemoteException.java │ │ └── model │ │ └── RemoteBag.java │ └── test │ ├── java │ └── nl │ │ └── renarj │ │ └── jasdb │ │ └── remote │ │ ├── MockConnector1.java │ │ ├── MockConnector2.java │ │ ├── MockConnectorLoader1.java │ │ ├── MockConnectorLoader2.java │ │ └── RemoteConnectionFactoryTest.java │ └── resources │ └── META-INF │ └── services │ └── nl.renarj.jasdb.remote.ConnectorLoader ├── jasdb_console ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── console │ │ ├── ConsoleConfiguration.java │ │ ├── DataController.java │ │ ├── IndexWebController.java │ │ ├── QueryController.java │ │ ├── WebDefaultExceptionHandler.java │ │ ├── exceptions │ │ └── WebException.java │ │ └── model │ │ ├── Bag.java │ │ ├── PageResult.java │ │ ├── SearchForm.java │ │ ├── WebEntity.java │ │ └── WebInstance.java │ └── resources │ ├── static │ ├── css │ │ └── jquery.jsonview.css │ ├── images │ │ ├── favicon.ico │ │ └── obera.png │ └── javascript │ │ ├── data.js │ │ ├── global.js │ │ ├── jquery.jsonview.js │ │ └── query.js │ └── templates │ ├── data │ ├── index.html │ └── query.html │ ├── error.html │ └── includes │ └── header.html ├── jasdb_core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── core │ │ │ ├── EmbeddedEntity.java │ │ │ ├── SimpleEntity.java │ │ │ ├── caching │ │ │ ├── CacheBucket.java │ │ │ ├── CacheElement.java │ │ │ ├── CacheManager.java │ │ │ ├── CacheMonitorThread.java │ │ │ ├── DummyBucket.java │ │ │ ├── GlobalCachingMemoryManager.java │ │ │ └── LRURegion.java │ │ │ ├── collections │ │ │ ├── KeyOrderedTree.java │ │ │ ├── OrderedBalancedTree.java │ │ │ └── TreeNode.java │ │ │ ├── concurrency │ │ │ └── ResourceLockManager.java │ │ │ ├── context │ │ │ └── RequestContext.java │ │ │ ├── crypto │ │ │ ├── BasicCryptoEngine.java │ │ │ ├── CryptoFactory.java │ │ │ └── StrongCryptoEngine.java │ │ │ ├── index │ │ │ ├── IndexRebuildUtil.java │ │ │ ├── IndexScanReportImpl.java │ │ │ ├── IndexScanner.java │ │ │ ├── keys │ │ │ │ ├── AbstractKey.java │ │ │ │ ├── AnyKey.java │ │ │ │ ├── CompositeKey.java │ │ │ │ ├── DataKey.java │ │ │ │ ├── KeyUtil.java │ │ │ │ ├── LongKey.java │ │ │ │ ├── StringKey.java │ │ │ │ ├── UUIDKey.java │ │ │ │ ├── factory │ │ │ │ │ ├── AbstractKeyFactory.java │ │ │ │ │ ├── CompositeKeyFactory.java │ │ │ │ │ ├── DataKeyFactory.java │ │ │ │ │ ├── KeyFactoryManager.java │ │ │ │ │ ├── LongKeyFactory.java │ │ │ │ │ ├── StringKeyFactory.java │ │ │ │ │ ├── UUIDKeyFactory.java │ │ │ │ │ └── WrappedValueKeyFactory.java │ │ │ │ ├── keyinfo │ │ │ │ │ ├── KeyInfoImpl.java │ │ │ │ │ ├── KeyLoadResultImpl.java │ │ │ │ │ ├── KeyNameMapperImpl.java │ │ │ │ │ ├── MultiKeyLoaderImpl.java │ │ │ │ │ └── MultiKeyloader.java │ │ │ │ └── types │ │ │ │ │ ├── ComplexKeyType.java │ │ │ │ │ ├── DataKeyType.java │ │ │ │ │ ├── LongKeyType.java │ │ │ │ │ ├── StringKeyType.java │ │ │ │ │ └── UUIDKeyType.java │ │ │ └── query │ │ │ │ ├── EqualsCondition.java │ │ │ │ ├── IndexSearchResultIteratorImpl.java │ │ │ │ ├── NotEqualsCondition.java │ │ │ │ ├── RangeCondition.java │ │ │ │ ├── SimpleCompositeIndexField.java │ │ │ │ └── SimpleIndexField.java │ │ │ ├── locator │ │ │ └── GridLocatorUtil.java │ │ │ ├── properties │ │ │ ├── BooleanValue.java │ │ │ ├── EntityValue.java │ │ │ ├── IntegerValue.java │ │ │ ├── LongValue.java │ │ │ ├── MultivalueProperty.java │ │ │ └── StringValue.java │ │ │ ├── security │ │ │ └── UserSessionImpl.java │ │ │ ├── serializer │ │ │ ├── EntityDeserializer.java │ │ │ ├── EntitySerializer.java │ │ │ └── json │ │ │ │ ├── JsonEntityDeserializer.java │ │ │ │ └── JsonEntitySerializer.java │ │ │ ├── statistics │ │ │ ├── AggregationResult.java │ │ │ ├── Aggregator.java │ │ │ ├── AverageAggregator.java │ │ │ ├── DummyStatRecord.java │ │ │ ├── NanoTimeTimeProvider.java │ │ │ ├── StatRecord.java │ │ │ ├── StatTimeProvider.java │ │ │ └── StatisticsMonitor.java │ │ │ ├── storage │ │ │ ├── BlockDataInputStream.java │ │ │ ├── BlockEntry.java │ │ │ ├── ClonableByteArrayInputStream.java │ │ │ ├── DataBlockFactoryImpl.java │ │ │ ├── DataBlockHeaderImpl.java │ │ │ ├── DataBlockImpl.java │ │ │ └── DataBlockResultImpl.java │ │ │ └── utils │ │ │ ├── AnnotationUtils.java │ │ │ ├── FileUtils.java │ │ │ ├── RecordStreamUtil.java │ │ │ ├── ReflectionLoader.java │ │ │ ├── ResourceUtil.java │ │ │ ├── StringUtils.java │ │ │ ├── XMLReader.java │ │ │ ├── configuration │ │ │ ├── ConfigurationProperty.java │ │ │ ├── ManualConfiguration.java │ │ │ └── XMLConfiguration.java │ │ │ └── conversion │ │ │ ├── LongUtils.java │ │ │ ├── MemoryTypeConverter.java │ │ │ ├── TimeTypeConverter.java │ │ │ ├── ValueConverterType.java │ │ │ └── ValueConverterUtil.java │ └── resources │ │ ├── db_keyfactories.xml │ │ └── default-jasdb.xml │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── core │ │ ├── SimpleEntityTest.java │ │ ├── caching │ │ ├── CacheBucketTest.java │ │ ├── CacheItemWrapper.java │ │ ├── GlobalCachingMemoryManagerTest.java │ │ └── LRURegionTest.java │ │ ├── collections │ │ ├── KeyOrderedTreeTest.java │ │ ├── OrderedBalanceHashTreeTest.java │ │ └── OrderedBalanceTreeTest.java │ │ ├── concurrency │ │ └── ResourceLockManagerTest.java │ │ ├── crypto │ │ ├── BasicCryptoEngineTest.java │ │ └── CryptoEngineTest.java │ │ ├── index │ │ ├── CompositeKeyTest.java │ │ ├── KeyFactoryManagerTest.java │ │ ├── KeyInfoImplTest.java │ │ ├── StringKeyTest.java │ │ └── keys │ │ │ └── factory │ │ │ └── CompositeKeyFactoryTest.java │ │ ├── storage │ │ ├── DataBlockHeaderImplTest.java │ │ └── DataBlockTest.java │ │ └── utils │ │ ├── ReflectionLoaderTest.java │ │ ├── configuration │ │ └── ConfigurationReaderTest.java │ │ └── conversion │ │ ├── LongUtilsTest.java │ │ └── ValueConverterTest.java │ └── resources │ ├── cache_config.xml │ ├── data │ └── P1000003.png │ ├── logback.xml │ └── some_config.xml ├── jasdb_entity ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── entitymapper │ │ ├── AnnotationEntityMapper.java │ │ ├── EntityManagerImpl.java │ │ ├── EntityMetadataImpl.java │ │ ├── EntityUtils.java │ │ ├── MapResultImpl.java │ │ ├── PropertyMetadataImpl.java │ │ └── types │ │ ├── BooleanTypeMapper.java │ │ ├── EmbeddedObjectTypeMapper.java │ │ ├── EnumTypeMapper.java │ │ ├── IntegerTypeMapper.java │ │ ├── ListEntityMapper.java │ │ ├── LongTypeMapper.java │ │ ├── MapEntityMapper.java │ │ ├── SetEntityMapper.java │ │ ├── StringTypeMapper.java │ │ └── TypeMapperFactory.java │ └── test │ └── java │ └── com │ └── oberasoftware │ └── jasdb │ └── entitymapper │ ├── BaseEntity.java │ ├── BasicEntity.java │ ├── ComplexEntity.java │ ├── EntityMapperTest.java │ ├── LocFunction.java │ └── Locomotive.java ├── jasdb_index_btreeplus ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── core │ │ └── index │ │ └── btreeplus │ │ ├── BTreeIndex.java │ │ ├── BlockPersister.java │ │ ├── BtreeIndexHeader.java │ │ ├── FullIndexIterator.java │ │ ├── IndexBlock.java │ │ ├── LeaveBlock.java │ │ ├── LeaveBlockImpl.java │ │ ├── LeaveBlockProperties.java │ │ ├── RootBlock.java │ │ ├── TreeBlock.java │ │ ├── TreeNode.java │ │ ├── caching │ │ ├── AbstractMemoryBlock.java │ │ ├── CachingConfig.java │ │ └── IndexBlockEntry.java │ │ ├── locking │ │ ├── LOCK_TYPE.java │ │ ├── LockEntry.java │ │ ├── LockIntent.java │ │ ├── LockIntentType.java │ │ ├── LockManager.java │ │ ├── OptimisticLeaveLockIntent.java │ │ ├── ReadIntent.java │ │ ├── UpdateIntent.java │ │ └── WriteIntentExclusive.java │ │ ├── persistence │ │ ├── BlockFactory.java │ │ ├── BlockTypes.java │ │ ├── BtreePlusBlockPersister.java │ │ ├── LeaveBlockFactory.java │ │ ├── NodeBlockFactory.java │ │ └── RootBlockFactory.java │ │ └── search │ │ ├── EqualsSearchOperation.java │ │ ├── NotEqualsSearchOperation.java │ │ ├── RangeSearchOperation.java │ │ └── SearchOperation.java │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── core │ │ └── index │ │ └── btreeplus │ │ ├── AnyKeyTest.java │ │ ├── BTreeIndexTest.java │ │ ├── BigBtreeIndexTest.java │ │ ├── BtreeCloseOpenTest.java │ │ ├── BtreeIndexRemoveTest.java │ │ ├── BtreeKeyTypesTest.java │ │ ├── IndexBaseTest.java │ │ ├── IndexScanRebuildTest.java │ │ ├── InvertedIndexTest.java │ │ ├── LeaveBlockFactoryTest.java │ │ ├── LeaveBlockImplTest.java │ │ ├── MockIndexableItem.java │ │ └── NodeBlockFactoryTest.java │ └── resources │ ├── categories.txt │ └── logback.xml ├── jasdb_memorywriter ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── writer │ │ └── btree │ │ ├── BTreeRecordWriterFactory.java │ │ ├── BtreeIndexRecordWriter.java │ │ ├── BtreeRecordIteratorImpl.java │ │ ├── BtreeRecordResult.java │ │ ├── CachableRecord.java │ │ └── CachedRecordWriter.java │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── writer │ │ └── btree │ │ ├── BaseRecordWriterTest.java │ │ ├── BaseTest.java │ │ ├── BtreeIndexRecordWriterTest.java │ │ └── CachedRecordWriterTest.java │ └── resources │ ├── datasets │ └── htmlpage.data │ └── logback.xml ├── jasdb_transwriter ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── writer │ │ │ └── transactional │ │ │ ├── FSWriter.java │ │ │ ├── RECORD_FLAG.java │ │ │ ├── RecordIteratorImpl.java │ │ │ ├── RecordResultImpl.java │ │ │ ├── TransactionalRecordWriter.java │ │ │ ├── TransactionalRecordWriterFactory.java │ │ │ └── Writer.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── com.oberasoftware.jasdb.api.storage.RecordWriterFactory │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── writer │ │ └── transactional │ │ ├── BaseRecordWriterTest.java │ │ ├── BaseTest.java │ │ └── FSRecordWriterTest.java │ └── resources │ ├── datasets │ └── htmlpage.data │ └── logback.xml ├── pom.xml ├── readme.md ├── rest ├── jasdb-restclient │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── oberasoftware │ │ │ │ └── jasdb │ │ │ │ └── rest │ │ │ │ └── client │ │ │ │ ├── BagRestConnector.java │ │ │ │ ├── ClientResponse.java │ │ │ │ ├── EntityRestConnector.java │ │ │ │ ├── InstanceRestConnector.java │ │ │ │ ├── OAuthConnector.java │ │ │ │ ├── RemoteRestConnector.java │ │ │ │ ├── ResourceNotFoundException.java │ │ │ │ ├── RestConnectionBuilder.java │ │ │ │ ├── RestConnectorLoader.java │ │ │ │ ├── RestDBSession.java │ │ │ │ ├── RestDBSessionFactory.java │ │ │ │ ├── RestQueryGenerator.java │ │ │ │ └── UserRestConnector.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── nl.renarj.jasdb.remote.ConnectorLoader │ │ └── test │ │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── rest │ │ └── client │ │ ├── RestConnectionBuilderTest.java │ │ ├── RestDBSessionFactoryTest.java │ │ └── RestQueryGeneratorTest.java ├── jasdb_restmodel │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── rest │ │ │ └── model │ │ │ ├── BagCollection.java │ │ │ ├── CacheBucket.java │ │ │ ├── CacheBucketCollection.java │ │ │ ├── ErrorEntity.java │ │ │ ├── IndexCollection.java │ │ │ ├── IndexEntry.java │ │ │ ├── InstanceCollection.java │ │ │ ├── InstanceRest.java │ │ │ ├── Node.java │ │ │ ├── NodeServiceInformation.java │ │ │ ├── RestBag.java │ │ │ ├── RestEntity.java │ │ │ ├── RestGrant.java │ │ │ ├── RestGrantObject.java │ │ │ ├── RestGrantObjectCollection.java │ │ │ ├── RestUser.java │ │ │ ├── RestUserList.java │ │ │ ├── Statistic.java │ │ │ ├── StatisticCollection.java │ │ │ ├── mappers │ │ │ ├── GrantModelMapper.java │ │ │ ├── IndexModelMapper.java │ │ │ └── NodeInfoMapper.java │ │ │ ├── serializers │ │ │ ├── RestResponseHandler.java │ │ │ └── json │ │ │ │ ├── JsonRestHandlerFactory.java │ │ │ │ ├── JsonRestObjectMapperHandler.java │ │ │ │ ├── JsonRestResponseHandler.java │ │ │ │ └── entity │ │ │ │ ├── EntityHandler.java │ │ │ │ ├── EntityStreamCollectionHandler.java │ │ │ │ ├── StreamableQueryResult.java │ │ │ │ └── StreamingQueryMonitor.java │ │ │ └── streaming │ │ │ ├── OauthToken.java │ │ │ ├── StreamableEntityCollection.java │ │ │ └── StreamedEntity.java │ │ └── test │ │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── rest │ │ └── model │ │ └── serializers │ │ └── json │ │ ├── EntityStreamCollectionHandlerTest.java │ │ └── JsonDataSerializerTest.java └── jasdb_restservice │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── oberasoftware │ │ │ └── jasdb │ │ │ └── rest │ │ │ └── service │ │ │ ├── CorsFilter.java │ │ │ ├── DefaultExceptionHandler.java │ │ │ ├── RestConfiguration.java │ │ │ ├── RestConfigurationLoader.java │ │ │ ├── RestService.java │ │ │ ├── SSLDetails.java │ │ │ ├── controllers │ │ │ ├── BagController.java │ │ │ ├── CacheController.java │ │ │ ├── ControllerUtil.java │ │ │ ├── EntityController.java │ │ │ ├── GrantController.java │ │ │ ├── IndexController.java │ │ │ ├── InstanceController.java │ │ │ ├── OutputHandler.java │ │ │ ├── StatisticsController.java │ │ │ └── UserModelLoader.java │ │ │ ├── input │ │ │ ├── InputElement.java │ │ │ ├── InputParser.java │ │ │ ├── InputScanner.java │ │ │ ├── Operator.java │ │ │ ├── OrderParam.java │ │ │ ├── OrderParameterParsing.java │ │ │ ├── PathParser.java │ │ │ ├── TokenType.java │ │ │ └── conditions │ │ │ │ ├── AndBlockOperation.java │ │ │ │ ├── BlockOperation.java │ │ │ │ ├── FieldCondition.java │ │ │ │ ├── InputCondition.java │ │ │ │ └── OrBlockOperation.java │ │ │ └── security │ │ │ ├── OAuthTokenEndpoint.java │ │ │ └── OAuthTokenFilter.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── controllers.PathModelLoader │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── rest │ │ └── service │ │ └── input │ │ ├── InputScannerTest.java │ │ ├── OrderParameterParsingTest.java │ │ ├── PathParserTest.java │ │ └── model │ │ └── EntityModelTest.java │ └── resources │ ├── jasdb.xml │ └── logback.xml └── testing ├── jasdb-integration-test ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── integration │ │ └── LocalNodeStarter.java │ └── test │ ├── java │ └── com │ │ └── oberasoftware │ │ └── jasdb │ │ └── integration │ │ ├── LocalDBSessionTest.java │ │ ├── LocalEntityBagTest.java │ │ ├── LocalEntityManagerTest.java │ │ ├── LocalQueryTest.java │ │ ├── LocalSortAndLimitQueryTest.java │ │ ├── LocalTableScanQueryTest.java │ │ ├── OverrideSecureSessionFactory.java │ │ ├── SecureLocalDBSessionTest.java │ │ └── rest │ │ ├── RestDBSessionTest.java │ │ ├── RestEntityBagTest.java │ │ ├── RestEntityManagerTest.java │ │ ├── RestQueryTest.java │ │ ├── RestSortAndLimitQueryTest.java │ │ ├── RestTableScanQueryTest.java │ │ └── TestRestDBSessionFactory.java │ └── resources │ ├── jasdb-local-withsecurity.xml │ ├── jasdb-rest.xml │ ├── jasdb.xml │ └── logback.xml ├── jasdb_ent_integration ├── pom.xml └── src │ ├── main │ ├── java │ │ └── nl │ │ │ └── renarj │ │ │ └── jasdb │ │ │ └── rest │ │ │ ├── DataPrepare.java │ │ │ └── NodeTestStarter.java │ └── resources │ │ ├── jasdb.xml │ │ └── logback.xml │ └── test │ ├── java │ ├── com │ │ └── obera │ │ │ └── jasdb │ │ │ ├── UserAdministrationTest.java │ │ │ ├── local │ │ │ ├── LocalUserAdministrationTest.java │ │ │ ├── SecureLocalEntityBagTest.java │ │ │ └── SecureLocalQueryTest.java │ │ │ └── rest │ │ │ ├── OAuthDBSessionTest.java │ │ │ ├── OAuthEntityBagTest.java │ │ │ ├── OAuthQueryTest.java │ │ │ └── RestUserAdministrationTest.java │ └── nl │ │ └── renarj │ │ └── jasdb │ │ └── rest │ │ ├── BagModelLoaderTest.java │ │ ├── EntityRetrievalTest.java │ │ ├── IndexModelLoaderTest.java │ │ └── RestBaseTest.java │ └── resources │ ├── jasdb-local-withsecurity.xml │ ├── jasdb-local.xml │ ├── jasdb-rest-withsecurity.xml │ ├── jasdb-rest.xml │ ├── jasdb.xml │ ├── keystore.ks │ └── logback.xml └── jasdb_testframework ├── pom.xml └── src └── main ├── java └── com │ └── oberasoftware │ └── jasdb │ └── test │ ├── DBSessionTest.java │ ├── EntityBagTest.java │ ├── EntityManagerTest.java │ ├── EntityQueryTest.java │ ├── QueryBaseTest.java │ ├── SimpleBaseTest.java │ ├── SortAndLimitQueryTest.java │ ├── TableScanQueryTest.java │ └── TestEntity.java └── resources └── datasets └── htmlpage.data /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | target/ 3 | .idea/ 4 | *.iml -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eclipse-temurin:21-jre-jammy 2 | 3 | RUN apt-get update && apt-get install -y unzip 4 | 5 | COPY jasdb_assembly/target/*.zip / 6 | RUN unzip jasdb*.zip 7 | RUN rm *.zip 8 | RUN mv jasdb* /jasdb 9 | RUN chmod +x /jasdb/*.sh 10 | 11 | ARG JAR_FILE=target/command-svc*.jar 12 | ENV JASDB_HOME /jasdb-data 13 | ENV JAVA_HOME=/opt/java/openjdk 14 | 15 | WORKDIR '/jasdb' 16 | CMD bash -C '/jasdb/start.sh' 17 | 18 | VOLUME /jasdb-data 19 | 20 | EXPOSE 7050 21 | MAINTAINER Renze de Vries -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | tools { 5 | maven "MVN3" 6 | } 7 | environment { 8 | DOCKERHUB_CREDENTIALS = credentials('dockerhub') 9 | } 10 | 11 | stages { 12 | stage('Build') { 13 | steps { 14 | git 'git@github.com:oberasoftware/jasdb.git' 15 | 16 | sh "mvn clean install -Dmaven.test.skip=true" 17 | } 18 | 19 | post { 20 | success { 21 | archiveArtifacts '**/target/*.jar' 22 | } 23 | } 24 | } 25 | stage('login to dockerhub') { 26 | steps { 27 | sh 'echo $DOCKERHUB_CREDENTIALS_PSW | docker login -u $DOCKERHUB_CREDENTIALS_USR --password-stdin' 28 | } 29 | } 30 | stage("Docker") { 31 | steps { 32 | sh "docker build . -t renarj/jasdb:latest" 33 | sh "docker push renarj/jasdb:latest" 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/JoinProcess.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster; 2 | 3 | import com.oberasoftware.jasdb.cluster.api.ClusterClient; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface JoinProcess { 9 | boolean shouldRun(ClusterClient client); 10 | 11 | boolean run(ClusterClient client); 12 | } 13 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/api/ClusterClient.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.api; 2 | 3 | public interface ClusterClient { 4 | DistributedMap getMap(String mapName); 5 | 6 | DistributedLock getLock(String lockName); 7 | } 8 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/api/ClusterManager.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.api; 2 | 3 | import com.oberasoftware.jasdb.cluster.model.Partition; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public interface ClusterManager { 11 | boolean join(); 12 | 13 | List getPartitions(String instanceId, String bag); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/api/ClusterNode.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.api; 2 | 3 | public interface ClusterNode { 4 | ClusterClient getClusterClient(); 5 | } 6 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/api/DistributedLock.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.api; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface DistributedLock { 7 | void lock(); 8 | 9 | void unlock(); 10 | } 11 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/api/DistributedMap.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.api; 2 | 3 | import java.util.Collection; 4 | 5 | public interface DistributedMap { 6 | void put(K k, V v); 7 | 8 | void remove(K k); 9 | 10 | Collection values(); 11 | 12 | V get(K k); 13 | 14 | boolean isEmpty(); 15 | 16 | int size(); 17 | } 18 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/CopyCatClusterClient.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat; 2 | 3 | import com.oberasoftware.jasdb.cluster.api.ClusterClient; 4 | import com.oberasoftware.jasdb.cluster.api.DistributedLock; 5 | import com.oberasoftware.jasdb.cluster.api.DistributedMap; 6 | import com.oberasoftware.jasdb.cluster.copycat.lock.LockClientImpl; 7 | import com.oberasoftware.jasdb.cluster.copycat.map.MapClientImpl; 8 | import io.atomix.copycat.client.CopycatClient; 9 | 10 | public class CopyCatClusterClient implements ClusterClient { 11 | private CopycatClient copycatClient; 12 | 13 | public CopyCatClusterClient(CopycatClient copycatClient) { 14 | this.copycatClient = copycatClient; 15 | } 16 | 17 | @Override 18 | public DistributedMap getMap(String mapName) { 19 | return new MapClientImpl<>(mapName, copycatClient); 20 | } 21 | 22 | @Override 23 | public DistributedLock getLock(String lockName) { 24 | return new LockClientImpl(lockName, copycatClient); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/CopyCatClusterNode.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat; 2 | 3 | import com.oberasoftware.jasdb.cluster.api.ClusterClient; 4 | import com.oberasoftware.jasdb.cluster.api.ClusterNode; 5 | import io.atomix.copycat.client.CopycatClient; 6 | import io.atomix.copycat.server.CopycatServer; 7 | 8 | public class CopyCatClusterNode implements ClusterNode { 9 | private CopycatServer copycatServer; 10 | private CopycatClient copycatClient; 11 | 12 | public CopyCatClusterNode(CopycatServer copycatServer, CopycatClient copycatClient) { 13 | this.copycatServer = copycatServer; 14 | this.copycatClient = copycatClient; 15 | } 16 | 17 | @Override 18 | public ClusterClient getClusterClient() { 19 | return new CopyCatClusterClient(copycatClient); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/lock/LockClientImpl.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.lock; 2 | 3 | import com.oberasoftware.jasdb.cluster.api.DistributedLock; 4 | import io.atomix.copycat.client.CopycatClient; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class LockClientImpl implements DistributedLock { 10 | private String lockName; 11 | private CopycatClient copycatClient; 12 | 13 | public LockClientImpl(String lockName, CopycatClient copycatClient) { 14 | this.lockName = lockName; 15 | this.copycatClient = copycatClient; 16 | } 17 | 18 | @Override 19 | public void lock() { 20 | copycatClient.submit(new LockCommand(lockName)).join(); 21 | } 22 | 23 | @Override 24 | public void unlock() { 25 | copycatClient.submit(new UnlockCommand(lockName)).join(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/lock/LockCommand.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.lock; 2 | 3 | import io.atomix.copycat.Command; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class LockCommand implements Command { 9 | private String name; 10 | 11 | public LockCommand(String name) { 12 | this.name = name; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/lock/UnlockCommand.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.lock; 2 | 3 | import io.atomix.copycat.Command; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class UnlockCommand implements Command { 9 | private String name; 10 | 11 | public UnlockCommand(String name) { 12 | this.name = name; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/map/GetCommand.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.map; 2 | 3 | import io.atomix.copycat.Query; 4 | 5 | public class GetCommand implements Query { 6 | private String map; 7 | private Object key; 8 | 9 | public GetCommand(String map, Object key) { 10 | this.map = map; 11 | this.key = key; 12 | } 13 | 14 | public String getMap() { 15 | return map; 16 | } 17 | 18 | public void setMap(String map) { 19 | this.map = map; 20 | } 21 | 22 | public void setKey(Object key) { 23 | this.key = key; 24 | } 25 | 26 | public Object getKey() { 27 | return key; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "GetCommand{" + 33 | "map='" + map + '\'' + 34 | ", key='" + key + '\'' + 35 | '}'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/map/GetSizeCommand.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.map; 2 | 3 | import io.atomix.copycat.Query; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class GetSizeCommand implements Query { 9 | private String mapName; 10 | 11 | public GetSizeCommand(String mapName) { 12 | this.mapName = mapName; 13 | } 14 | 15 | public String getMapName() { 16 | return mapName; 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return "GetSizeCommand{" + 22 | "mapName='" + mapName + '\'' + 23 | '}'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/map/GetValuesCommand.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.map; 2 | 3 | import io.atomix.copycat.Query; 4 | 5 | import java.util.Collection; 6 | 7 | public class GetValuesCommand implements Query> { 8 | private String map; 9 | 10 | public GetValuesCommand(String map) { 11 | this.map = map; 12 | } 13 | 14 | public String getMap() { 15 | return map; 16 | } 17 | 18 | public void setMap(String map) { 19 | this.map = map; 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | return "GetValuesCommand{" + 25 | "map='" + map + '\'' + 26 | '}'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/copycat/map/RemoveCommand.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.copycat.map; 2 | 3 | import io.atomix.copycat.Command; 4 | 5 | public class RemoveCommand implements Command { 6 | private String map; 7 | private Object key; 8 | 9 | public RemoveCommand(String map, Object key) { 10 | this.map = map; 11 | this.key = key; 12 | } 13 | 14 | public String getMap() { 15 | return map; 16 | } 17 | 18 | public void setMap(String map) { 19 | this.map = map; 20 | } 21 | 22 | public Object getKey() { 23 | return key; 24 | } 25 | 26 | public void setKey(Object key) { 27 | this.key = key; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "RemoveCommand{" + 33 | "map='" + map + '\'' + 34 | ", key=" + key + 35 | '}'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/model/PartitionStatus.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.model; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum PartitionStatus { 7 | ACTIVE, 8 | INITIALIZING, 9 | REALLOCATING 10 | } 11 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/java/com/oberasoftware/jasdb/cluster/model/PartitionType.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.cluster.model; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum PartitionType { 7 | PRIMARY, 8 | SHADOW 9 | } 10 | -------------------------------------------------------------------------------- /jasdb-cluster/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /jasdb-engine/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | jasdb 7 | com.oberasoftware 8 | 2.0-SNAPSHOT 9 | ../pom.xml 10 | 11 | 4.0.0 12 | 13 | jasdb-engine 14 | 15 | 16 | 17 | com.oberasoftware 18 | jasdb_api 19 | 20 | 21 | com.oberasoftware 22 | jasdb_transwriter 23 | 24 | 25 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/EngineConfiguation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.engine; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | @Configuration 10 | @ComponentScan 11 | public class EngineConfiguation { 12 | } 13 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/IdGenerator.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | /** 6 | * User: renarj 7 | * Date: 2/10/12 8 | * Time: 10:43 AM 9 | */ 10 | public interface IdGenerator { 11 | public String generateNewId() throws JasDBStorageException; 12 | } 13 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/StorageServiceFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | /** 6 | * Main factory interface for creating storage services that allow operations on bag data 7 | * inside an instance. 8 | */ 9 | public interface StorageServiceFactory { 10 | StorageService getStorageService(String instanceId, String bagName) throws JasDBStorageException; 11 | 12 | StorageService getOrCreateStorageService(String instanceId, String bagName) throws JasDBStorageException; 13 | 14 | void removeStorageService(String instanceId, String bagName) throws JasDBStorageException; 15 | 16 | void removeAllStorageService(String instanceId) throws JasDBStorageException; 17 | 18 | void shutdownServiceFactory() throws JasDBStorageException; 19 | } 20 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/indexing/IndexTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.engine.indexing; 9 | 10 | public enum IndexTypes { 11 | INVALID(-1, "invalid"), 12 | BTREE(2, "btree"), 13 | INVERTED(1, "inverted"); 14 | 15 | private int type; 16 | private String name; 17 | 18 | IndexTypes(int type, String name) { 19 | this.type = type; 20 | this.name = name; 21 | } 22 | 23 | public int getType() { 24 | return this.type; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public static IndexTypes getTypeFor(int type) { 32 | for(IndexTypes indexType : values()) { 33 | if(indexType.type == type) { 34 | return indexType; 35 | } 36 | } 37 | return INVALID; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/metadata/MetaWrapper.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.engine.metadata; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class MetaWrapper { 7 | private T metadataObject; 8 | private long recordPointer; 9 | 10 | public MetaWrapper(T metadataObject, long recordPointer) { 11 | this.metadataObject = metadataObject; 12 | this.recordPointer = recordPointer; 13 | } 14 | 15 | public T getMetadataObject() { 16 | return metadataObject; 17 | } 18 | 19 | public void setMetadataObject(T metadataObject) { 20 | this.metadataObject = metadataObject; 21 | } 22 | 23 | public long getRecordPointer() { 24 | return recordPointer; 25 | } 26 | 27 | public void setRecordPointer(long recordPointer) { 28 | this.recordPointer = recordPointer; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/operations/DataOperation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.engine.operations; 2 | 3 | import com.oberasoftware.jasdb.api.session.Entity; 4 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 5 | 6 | public interface DataOperation { 7 | void doDataOperation(String instanceId, String bag, Entity entity) throws JasDBStorageException; 8 | } 9 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/query/operators/AndBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.engine.query.operators; 9 | 10 | import com.oberasoftware.jasdb.engine.query.operators.mergers.AndBlockMerger; 11 | 12 | public class AndBlock extends AbstractBlock { 13 | public AndBlock() { 14 | 15 | } 16 | 17 | @Override 18 | public BlockMerger getMerger() { 19 | return new AndBlockMerger(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/query/operators/BlockMerger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.engine.query.operators; 9 | 10 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 11 | import com.oberasoftware.jasdb.api.index.query.IndexSearchResultIteratorCollection; 12 | 13 | public interface BlockMerger { 14 | public IndexSearchResultIteratorCollection mergeIterators(IndexSearchResultIteratorCollection mergeInto, IndexSearchResultIteratorCollection... results) throws JasDBStorageException; 15 | 16 | public boolean includeResult(boolean leftResultFound, boolean rightResultFound); 17 | 18 | public boolean continueEvaluation(boolean currentState); 19 | } 20 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/query/operators/BlockOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.engine.query.operators; 9 | 10 | import com.oberasoftware.jasdb.api.index.keys.KeyNameMapper; 11 | import com.oberasoftware.jasdb.api.index.query.SearchCondition; 12 | 13 | import java.util.List; 14 | import java.util.Map; 15 | import java.util.Set; 16 | 17 | public interface BlockOperation extends SearchCondition { 18 | BlockMerger getMerger(); 19 | 20 | boolean isEmpty(); 21 | 22 | void addCondition(String field, SearchCondition condition); 23 | void addChildBlock(BlockOperation operation); 24 | Map> getConditions(); 25 | Set getFields(); 26 | boolean hasConditions(String field); 27 | Set getConditions(KeyNameMapper mapper, List fields); 28 | Set getConditions(String field); 29 | 30 | Set getChildBlocks(); 31 | } 32 | -------------------------------------------------------------------------------- /jasdb-engine/src/main/java/com/oberasoftware/jasdb/engine/query/operators/OrBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.engine.query.operators; 9 | 10 | import com.oberasoftware.jasdb.engine.query.operators.mergers.OrBlockMerger; 11 | 12 | public class OrBlock extends AbstractBlock { 13 | public OrBlock() { 14 | 15 | } 16 | 17 | @Override 18 | public BlockMerger getMerger() { 19 | return new OrBlockMerger(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /jasdb-engine/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /jasdb-service/src/main/java/com/oberasoftware/jasdb/service/KernelShutdown.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.service; 2 | 3 | import org.slf4j.Logger; 4 | 5 | import static org.slf4j.LoggerFactory.getLogger; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public class KernelShutdown implements Runnable, KernelShutdownMBean { 11 | private static final Logger LOG = getLogger(KernelShutdown.class); 12 | 13 | @Override 14 | public void doKernelShutdown() { 15 | run(); 16 | } 17 | 18 | @Override 19 | public void run() { 20 | LOG.info("Running kernel shutdown"); 21 | JasDBMain.shutdown(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jasdb-service/src/main/java/com/oberasoftware/jasdb/service/KernelShutdownMBean.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.service; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface KernelShutdownMBean { 7 | void doKernelShutdown(); 8 | } 9 | -------------------------------------------------------------------------------- /jasdb-service/src/main/java/com/oberasoftware/jasdb/service/ServiceConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.service; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | @Configuration 10 | @ComponentScan 11 | public class ServiceConfiguration { 12 | } 13 | -------------------------------------------------------------------------------- /jasdb-service/src/main/java/com/oberasoftware/jasdb/service/local/ApplicationContextProvider.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.service.local; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.ApplicationContextAware; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | @Component 12 | public class ApplicationContextProvider implements ApplicationContextAware { 13 | private static ApplicationContext CONTEXT; 14 | 15 | public static ApplicationContext getApplicationContext() { 16 | return CONTEXT; 17 | } 18 | 19 | @Override 20 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 21 | CONTEXT = applicationContext; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jasdb-service/src/main/resources/META-INF/spring/app-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /jasdb-service/src/main/resources/META-INF/spring/jasdb-core.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /jasdb-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=7050 2 | spring.mvc.throw-exception-if-no-handler-found=true 3 | spring.resources.add-mappings=false 4 | server.error.path=/error 5 | spring.thymeleaf.cache=false 6 | spring.template.cache=false 7 | -------------------------------------------------------------------------------- /jasdb-service/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /jasdb_acl/src/main/java/com/oberasoftware/jasdb/acl/BasicCredentials.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.acl; 2 | 3 | import com.oberasoftware.jasdb.api.security.Credentials; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class BasicCredentials implements Credentials { 9 | private String username; 10 | private String sourceHost; 11 | private String password; 12 | 13 | public BasicCredentials(String username, String sourceHost, String password) { 14 | this.username = username; 15 | this.sourceHost = sourceHost; 16 | this.password = password; 17 | } 18 | 19 | public BasicCredentials(String username, String password) { 20 | this.username = username; 21 | this.password = password; 22 | } 23 | 24 | @Override 25 | public String getSourceHost() { 26 | return sourceHost; 27 | } 28 | 29 | @Override 30 | public String getUsername() { 31 | return username; 32 | } 33 | 34 | @Override 35 | public String getPassword() { 36 | return password; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /jasdb_acl/src/main/java/com/oberasoftware/jasdb/acl/GrantMeta.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.acl; 2 | 3 | import com.oberasoftware.jasdb.api.security.AccessMode; 4 | import com.oberasoftware.jasdb.api.model.Grant; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class GrantMeta implements Grant { 10 | private String userName; 11 | private AccessMode accessMode; 12 | 13 | public GrantMeta(String userName, AccessMode accessMode) { 14 | this.userName = userName; 15 | this.accessMode = accessMode; 16 | } 17 | 18 | @Override 19 | public AccessMode getAccessMode() { 20 | return accessMode; 21 | } 22 | 23 | @Override 24 | public String getGrantedUsername() { 25 | return userName; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "GrantMeta{" + 31 | "userName='" + userName + '\'' + 32 | ", accessMode=" + accessMode + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /jasdb_acl/src/main/resources/META-INF/services/com.oberasoftware.jasdb.api.engine.MetadataProvider: -------------------------------------------------------------------------------- 1 | com.oberasoftware.jasdb.acl.UserMetadataProvider 2 | com.oberasoftware.jasdb.acl.GrantMetadataProvider -------------------------------------------------------------------------------- /jasdb_acl/src/main/resources/META-INF/spring/jasdb-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /jasdb_acl/src/test/java/com/oberasoftware/jasdb/acl/AuthorizationOperation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.acl; 2 | 3 | import com.oberasoftware.jasdb.engine.StorageService; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface AuthorizationOperation { 9 | void doOperation(StorageService wrappedService, 10 | String user, 11 | String password) throws Exception; 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_acl/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /jasdb_api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | 8 | 4.0.0 9 | 10 | jasdb_api 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | com.fasterxml.jackson.core 19 | jackson-core 20 | 21 | 22 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/caching/Bucket.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.caching; 2 | 3 | import com.oberasoftware.jasdb.api.model.CacheConfig; 4 | import com.oberasoftware.jasdb.api.caching.CachableItem; 5 | import com.oberasoftware.jasdb.api.exceptions.CoreConfigException; 6 | 7 | /** 8 | * 9 | * @author Renze de Vries 10 | * 11 | */ 12 | public interface Bucket { 13 | String getName(); 14 | 15 | void configure(CacheConfig config) throws CoreConfigException; 16 | 17 | void put(String key, CachableItem cacheItem); 18 | 19 | void remove(String key); 20 | 21 | boolean containsItem(String key); 22 | 23 | CachableItem getItem(String key); 24 | 25 | long getMemSize(); 26 | 27 | int getCachedItems(); 28 | 29 | void closeBucket(); 30 | 31 | } -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/caching/CachableItem.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.caching; 2 | 3 | public interface CachableItem { 4 | public long getObjectSize(); 5 | } 6 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/caching/CacheEntry.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.caching; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface CacheEntry { 9 | boolean isInUse(); 10 | 11 | long memorySize(); 12 | 13 | X getValue(); 14 | 15 | void release() throws JasDBStorageException; 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/caching/CacheRegion.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.caching; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface CacheRegion, X extends CacheEntry> { 9 | String name(); 10 | 11 | long lastRegionAccess(); 12 | 13 | long memorySize(); 14 | 15 | long reduceBy(long reduceSize); 16 | 17 | X putEntry(T key, X entry); 18 | 19 | boolean contains(T key); 20 | 21 | X getEntry(T key); 22 | 23 | Collection values(); 24 | 25 | int size(); 26 | 27 | boolean removeEntry(T key); 28 | 29 | void clear(); 30 | } 31 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/caching/MemoryAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.caching; 9 | 10 | public interface MemoryAware { 11 | long getTotalMemoryUsage(); 12 | long getCachedBlocks(); 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/engine/Configuration.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.engine; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface Configuration { 9 | String getAttribute(String attributeName); 10 | 11 | String getAttribute(String attributeName, String defaultValue); 12 | 13 | int getAttribute(String attributeName, int defaultValue); 14 | 15 | boolean getAttribute(String attributeName, boolean defaultValue); 16 | 17 | boolean hasAttribute(String attributeName); 18 | 19 | String getName(); 20 | 21 | Configuration getChildConfiguration(String configurationPath); 22 | 23 | List getChildConfigurations(String configurationPath); 24 | 25 | List getChildren(); 26 | } 27 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/engine/ConfigurationLoader.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.ConfigurationException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface ConfigurationLoader { 9 | Configuration getConfiguration() throws ConfigurationException; 10 | } 11 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/engine/EngineManager.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBException; 4 | import com.oberasoftware.jasdb.api.model.NodeInformation; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface EngineManager { 10 | NodeInformation startEngine() throws JasDBException; 11 | 12 | void stopEngine() throws JasDBException; 13 | 14 | String getEngineVersion(); 15 | 16 | NodeInformation getNodeInformation(); 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/engine/IndexManagerFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface IndexManagerFactory { 9 | IndexManager getIndexManager(String instanceId) throws JasDBStorageException; 10 | 11 | void shutdownIndexes() throws JasDBStorageException; 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/engine/MetadataProvider.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.session.Entity; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface MetadataProvider { 10 | void setMetadataStore(MetadataStore metadataStore); 11 | 12 | String getMetadataType(); 13 | 14 | void registerMetadataEntity(Entity entity, long recordPointer) throws JasDBStorageException; 15 | } 16 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/engine/RemoteServiceManager.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.engine; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBException; 4 | import com.oberasoftware.jasdb.api.model.ServiceInformation; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface RemoteServiceManager { 12 | void startRemoteServices() throws JasDBException; 13 | 14 | void stopRemoteServices() throws JasDBException; 15 | 16 | List getServiceInformation(); 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/EntityMapper.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.session.Entity; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface EntityMapper { 10 | EntityMetadata getEntityMetadata(Class type) throws JasDBStorageException; 11 | 12 | Object updateId(String id, Object mappableObject) throws JasDBStorageException; 13 | 14 | MapResult mapTo(Object mappableObject) throws JasDBStorageException; 15 | 16 | T mapFrom(Class targetType, Entity entity) throws JasDBStorageException; 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/EntityMetadata.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper; 2 | 3 | import java.util.Map; 4 | import java.util.Optional; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface EntityMetadata { 10 | Class getRawType(); 11 | 12 | String getBagName(); 13 | 14 | Optional getKeyProperty(); 15 | 16 | Map getProperties(); 17 | 18 | PropertyMetadata getProperty(String name); 19 | } 20 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/MapResult.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper; 2 | 3 | import com.oberasoftware.jasdb.api.session.Entity; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface MapResult { 9 | EntityMetadata getMetadata(); 10 | 11 | Entity getJasDBEntity(); 12 | 13 | Object getOriginal(); 14 | 15 | String getBagName(); 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/PropertyMetadata.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface PropertyMetadata { 9 | TypeMapper getTypeMapper(); 10 | 11 | String getPropertyName(); 12 | 13 | Method getReadMethod(); 14 | 15 | Method getWriteMethod(); 16 | 17 | boolean isNullable(); 18 | 19 | boolean isKey(); 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/TypeMapper.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper; 2 | 3 | import com.oberasoftware.jasdb.api.session.Property; 4 | import com.oberasoftware.jasdb.api.session.Value; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface TypeMapper { 10 | boolean isSupportedType(Class type); 11 | 12 | Object mapToEmptyValue(); 13 | 14 | T mapToRawType(Class targetClass, Object value); 15 | 16 | Value mapToValue(Object value); 17 | 18 | Property mapToProperty(String propertyName, Object value); 19 | 20 | Object mapFromProperty(PropertyMetadata propertyMetadata, Property property); 21 | } 22 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/annotations/Id.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.METHOD) 13 | public @interface Id { 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/annotations/JasDBEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.TYPE) 13 | public @interface JasDBEntity { 14 | String bagName(); 15 | } 16 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/entitymapper/annotations/JasDBProperty.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.entitymapper.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.METHOD) 13 | public @interface JasDBProperty { 14 | String name() default ""; 15 | 16 | boolean nullable() default true; 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * This exception is thrown when an issue is found in the provided 5 | * configuration file 6 | * 7 | * @author Renze de Vries 8 | */ 9 | public class ConfigurationException extends JasDBStorageException { 10 | private static final long serialVersionUID = -15232595283101969L; 11 | 12 | public ConfigurationException(String exceptionMessage, Throwable embeddedException) { 13 | super(exceptionMessage, embeddedException); 14 | } 15 | 16 | public ConfigurationException(String exceptionMessage){ 17 | super(exceptionMessage); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/ConfigurationNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * When the configuation file could not be found this exception is thrown 5 | * 6 | * @author Renze de Vries 7 | */ 8 | public class ConfigurationNotFoundException extends CoreConfigException { 9 | public ConfigurationNotFoundException(String message, Throwable e) { 10 | super(message, e); 11 | } 12 | 13 | public ConfigurationNotFoundException(String message) { 14 | super(message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/CoreConfigException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * This exception is thrown when an issue is found in the provided 5 | * configuration file 6 | * 7 | * @author Renze de Vries 8 | */ 9 | public class CoreConfigException extends Exception { 10 | private static final long serialVersionUID = -15232595283101969L; 11 | 12 | public CoreConfigException(String exceptionMessage, Throwable embeddedException) { 13 | super(exceptionMessage, embeddedException); 14 | } 15 | 16 | public CoreConfigException(String exceptionMessage){ 17 | super(exceptionMessage); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/DatastoreException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.exceptions; 9 | 10 | public class DatastoreException extends JasDBStorageException { 11 | private static final long serialVersionUID = 3773070907437415917L; 12 | 13 | public DatastoreException(String message, Throwable e) { 14 | super(message, e); 15 | } 16 | 17 | public DatastoreException(String message) { 18 | super(message); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/FileException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | public class FileException extends Exception { 4 | private static final long serialVersionUID = -15232595283101969L; 5 | 6 | public FileException(String exceptionMessage, Throwable embeddedException) { 7 | super(exceptionMessage, embeddedException); 8 | } 9 | 10 | public FileException(String exceptionMessage){ 11 | super(exceptionMessage); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/JasDBException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.exceptions; 9 | 10 | /** 11 | * User: renarj 12 | * Date: 1/16/12 13 | * Time: 9:52 PM 14 | */ 15 | public class JasDBException extends Exception { 16 | public JasDBException(String message, Throwable e) { 17 | super(message, e); 18 | } 19 | 20 | public JasDBException(String message) { 21 | super(message); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/JasDBSecurityException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class JasDBSecurityException extends JasDBStorageException { 7 | public JasDBSecurityException(String message) { 8 | super(message); 9 | } 10 | 11 | public JasDBSecurityException(String message, Throwable e) { 12 | super(message, e); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/JasDBStorageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.exceptions; 9 | 10 | public class JasDBStorageException extends JasDBException { 11 | private static final long serialVersionUID = 3773070907437415917L; 12 | 13 | public JasDBStorageException(String message, Throwable e) { 14 | super(message, e); 15 | } 16 | 17 | public JasDBStorageException(String message) { 18 | super(message); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/LockingException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class LockingException extends RuntimeException { 7 | public LockingException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/MetadataParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.exceptions; 9 | 10 | /** 11 | * User: Renze de Vries 12 | * Date: 1/8/12 13 | * Time: 2:20 PM 14 | */ 15 | public class MetadataParseException extends JasDBStorageException { 16 | 17 | public MetadataParseException(String message, Throwable e) { 18 | super(message, e); 19 | } 20 | 21 | public MetadataParseException(String message) { 22 | super(message); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/RecordNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.RuntimeJasDBException; 4 | 5 | /** 6 | * Thrown when a record is not found during retrieval operation 7 | * 8 | * @author Renze de Vries 9 | */ 10 | public class RecordNotFoundException extends RuntimeJasDBException { 11 | public RecordNotFoundException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/RecordStoreInUseException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class RecordStoreInUseException extends DatastoreException { 7 | public RecordStoreInUseException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/ReflectionException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | public class ReflectionException extends Exception { 4 | private static final long serialVersionUID = -6228300250989286224L; 5 | 6 | public ReflectionException(String exceptionMessage, Throwable embeddedException) { 7 | super(exceptionMessage, embeddedException); 8 | } 9 | 10 | public ReflectionException(String exceptionMessage){ 11 | super(exceptionMessage); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/RestException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | public class RestException extends JasDBException { 4 | private static final long serialVersionUID = -6620518589377934129L; 5 | 6 | public RestException(String message) { 7 | super(message); 8 | } 9 | 10 | public RestException(String message, Throwable e) { 11 | super(message, e); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/RuntimeJasDBException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class RuntimeJasDBException extends RuntimeException { 7 | public RuntimeJasDBException(String message, Throwable e) { 8 | super(message, e); 9 | } 10 | 11 | public RuntimeJasDBException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/exceptions/SyntaxException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.exceptions; 2 | 3 | public class SyntaxException extends RestException { 4 | private static final long serialVersionUID = 1935231255078020632L; 5 | 6 | public SyntaxException(String message) { 7 | super(message); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/CompositeIndexField.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface CompositeIndexField { 9 | List getIndexFields(); 10 | } 11 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/IndexField.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | import com.oberasoftware.jasdb.api.index.keys.KeyType; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface IndexField { 9 | /** 10 | * Gets the field that needs to be indexed 11 | * @return The field name to be index 12 | */ 13 | String getField(); 14 | 15 | /** 16 | * Gets the key type 17 | * @return The key type 18 | */ 19 | KeyType getKeyType(); 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/IndexHeader.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | import com.oberasoftware.jasdb.api.index.keys.KeyInfo; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface IndexHeader { 9 | int getPageSize(); 10 | 11 | KeyInfo getKeyInfo(); 12 | 13 | int getIndexVersion(); 14 | 15 | int getHeaderSize(); 16 | 17 | long count(); 18 | } 19 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/IndexIterator.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | import com.oberasoftware.jasdb.api.index.keys.Key; 4 | 5 | import java.util.Iterator; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public interface IndexIterator extends Iterator, Iterable { 11 | void close(); 12 | 13 | void reset(); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/IndexScanReport.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface IndexScanReport { 7 | IndexState getState(); 8 | 9 | long getLastScan(); 10 | 11 | int getCompleteness(); 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/IndexState.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum IndexState { 7 | NOT_INITIALIZED, 8 | OK, 9 | REBUILDING, 10 | INVALID, 11 | CLOSED 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/MemoryConstants.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface MemoryConstants { 7 | int LONG_BYTE_SIZE = Long.SIZE / Byte.SIZE; 8 | 9 | int OBJECT_BYTE_SIZE = 16; 10 | 11 | int ARRAY_BYTE_SIZE = 12; 12 | int INTEGER_BYTE_SIZE = Integer.SIZE / Byte.SIZE; 13 | 14 | int TWO_LONG_BYTES = LONG_BYTE_SIZE + LONG_BYTE_SIZE; 15 | int OBJECT_REF = 8; 16 | int OBJECT_SIZE = 16; 17 | int ARRAY_SIZE = 12; 18 | } 19 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/ScanIntent.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum ScanIntent { 7 | REPORT, 8 | RESCAN, 9 | DETECT_INCOMPLETE 10 | } 11 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/keys/ComparableKey.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index.keys; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface ComparableKey extends Comparable { 7 | CompareResult compare(T otherKey, CompareMethod method); 8 | } 9 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/keys/CompareMethod.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index.keys; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum CompareMethod { 7 | BEFORE, 8 | STARTS, 9 | ENDS, 10 | LIKE, 11 | EQUALS, 12 | NOT_EQUALS, 13 | RANGE 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/keys/CompareResult.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index.keys; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class CompareResult { 7 | private int compare; 8 | 9 | public CompareResult(int compare) { 10 | this.compare = compare; 11 | } 12 | 13 | public int getCompare() { 14 | return compare; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/keys/KeyLoadResult.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.index.keys; 2 | 3 | import com.oberasoftware.jasdb.api.storage.DataBlock; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface KeyLoadResult { 9 | Key getLoadedKey(); 10 | 11 | DataBlock getEndBlock(); 12 | 13 | int getNextOffset(); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/keys/KeyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.index.keys; 9 | 10 | /** 11 | * This represents the key types available for indexing. All indexable 12 | * keys are of a type, by default there are the following keys available: 13 | * 14 | */ 15 | public interface KeyType { 16 | /** 17 | * An id representing the type of key 18 | * @return The id of the key type 19 | */ 20 | String getKeyId(); 21 | 22 | /** 23 | * The arguments needed to create the key factory 24 | * @return The arguments needed for the key factory 25 | */ 26 | String[] getKeyArguments(); 27 | } 28 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/query/IndexSearchResultIteratorCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.index.query; 9 | 10 | import com.oberasoftware.jasdb.api.index.keys.Key; 11 | 12 | import java.util.List; 13 | 14 | public interface IndexSearchResultIteratorCollection extends IndexSearchResultIterator { 15 | /** 16 | * Gets a list of keys contained in the iterator 17 | * @return THe list of keys in the iterator 18 | */ 19 | List getKeys(); 20 | 21 | /** 22 | * Gets a subset of the collection of keys in the iterator 23 | * @param start THe start of the subset 24 | * @param limit The maximum amount to put in the subset 25 | * @return The subset as list, empty list if nothing in iterator 26 | */ 27 | List subset(int start, int limit); 28 | } 29 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/index/query/SearchCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.index.query; 9 | 10 | import com.oberasoftware.jasdb.api.index.keys.Key; 11 | import com.oberasoftware.jasdb.api.index.keys.KeyNameMapper; 12 | 13 | public interface SearchCondition { 14 | boolean keyQualifies(Key key); 15 | 16 | SearchCondition mergeCondition(KeyNameMapper nameMapper, String sourceField, String mergeField, SearchCondition condition); 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/Bag.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface Bag { 9 | String getName(); 10 | 11 | String getInstanceId(); 12 | 13 | List getIndexDefinitions(); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/CacheConfig.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | public class CacheConfig { 4 | private boolean enabled; 5 | private long maxMemSize; 6 | private int maxSize; 7 | 8 | public CacheConfig(boolean enabled, long maxMemSize, int maxSize) { 9 | this.enabled = enabled; 10 | this.maxMemSize = maxMemSize; 11 | this.maxSize = maxSize; 12 | } 13 | 14 | public boolean isEnabled() { 15 | return enabled; 16 | } 17 | 18 | public long getMaxMemSize() { 19 | return maxMemSize; 20 | } 21 | 22 | public int getMaxSize() { 23 | return maxSize; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/Grant.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | import com.oberasoftware.jasdb.api.security.AccessMode; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface Grant { 9 | AccessMode getAccessMode(); 10 | 11 | String getGrantedUsername(); 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/GrantObject.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | import com.oberasoftware.jasdb.api.security.AccessMode; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public interface GrantObject { 11 | String getObjectName(); 12 | 13 | void addGrant(Grant grant); 14 | 15 | boolean isGranted(String userName, AccessMode mode); 16 | 17 | Grant getGrant(String userName); 18 | 19 | List getGrants(); 20 | 21 | void removeGrant(String userName); 22 | } 23 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/Instance.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | /** 4 | * This represents an Instance in Jasdb, every JasDB can have multiple instances. Each instance is a unit which can 5 | * contain bags which can have indexes and stored data entities. 6 | * 7 | * @author Renze de Vries 8 | */ 9 | public interface Instance { 10 | /** 11 | * Gets the identifier of this instance 12 | * @return The identifier of this instance 13 | */ 14 | String getInstanceId(); 15 | 16 | /** 17 | * The storage path used for this instance 18 | * @return The storage path used for this instance 19 | */ 20 | String getPath(); 21 | } 22 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/ServiceInformation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | import java.io.Serializable; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class ServiceInformation implements Serializable { 10 | private Map nodeProperties; 11 | private String serviceType; 12 | 13 | public ServiceInformation(String serviceType, Map nodeProperties) { 14 | this.serviceType = serviceType; 15 | this.nodeProperties = nodeProperties; 16 | } 17 | 18 | public Map getNodeProperties() { 19 | return nodeProperties; 20 | } 21 | 22 | public String getServiceType() { 23 | return serviceType; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/model/User.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.model; 2 | 3 | public interface User { 4 | String getUsername(); 5 | 6 | String getHost(); 7 | 8 | String getEncryptionEngine(); 9 | 10 | String getEncryptedContentKey(); 11 | 12 | String getPasswordSalt(); 13 | 14 | String getPasswordHash(); 15 | } 16 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/security/AccessMode.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.security; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum AccessMode { 7 | NONE("NONE", 0), 8 | CONNECT("CONNECT", 1), 9 | READ("r", 2), 10 | WRITE("rw", 3), 11 | UPDATE("rwu", 4), 12 | DELETE("rwud", 5), 13 | ADMIN("ALL", 6); 14 | 15 | 16 | private String mode; 17 | private int rank; 18 | 19 | AccessMode(String mode, int rank) { 20 | this.mode = mode; 21 | this.rank = rank; 22 | } 23 | 24 | public String getMode() { 25 | return mode; 26 | } 27 | 28 | public int getRank() { 29 | return rank; 30 | } 31 | 32 | public static AccessMode fromMode(String mode) { 33 | for(AccessMode accessMode : values()) { 34 | if(accessMode.getMode().equals(mode)) { 35 | return accessMode; 36 | } 37 | } 38 | return NONE; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/security/Credentials.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.security; 2 | 3 | /** 4 | * User: renarj 5 | * Date: 1/22/12 6 | * Time: 3:24 PM 7 | */ 8 | public interface Credentials { 9 | String getUsername(); 10 | 11 | String getSourceHost(); 12 | 13 | String getPassword(); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/security/CredentialsProvider.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.security; 2 | 3 | import com.oberasoftware.jasdb.api.model.User; 4 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface CredentialsProvider { 12 | User getUser(String userName, String sourceHost, String password) throws JasDBStorageException; 13 | 14 | List getUsers() throws JasDBStorageException; 15 | 16 | User addUser(String userName, String allowedHost, String contentKey, String password) throws JasDBStorageException; 17 | 18 | void deleteUser(String userName) throws JasDBStorageException; 19 | } 20 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/security/CryptoEngine.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.security; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBSecurityException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface CryptoEngine { 9 | String getDescriptor(); 10 | 11 | String encrypt(String salt, String password, String text) throws JasDBSecurityException; 12 | 13 | String decrypt(String salt, String password, String encrypted) throws JasDBSecurityException; 14 | 15 | String generateSalt() throws JasDBSecurityException; 16 | 17 | String hash(String salt, String password) throws JasDBSecurityException; 18 | } 19 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/security/SessionManager.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.security; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public interface SessionManager { 11 | UserSession startSession(Credentials credentials) throws JasDBStorageException; 12 | 13 | boolean sessionValid(String sessionId) throws JasDBStorageException; 14 | 15 | List getActiveSessions() throws JasDBStorageException; 16 | 17 | void endSession(String sessionId) throws JasDBStorageException; 18 | 19 | UserSession getSession(String sessionId) throws JasDBStorageException; 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/security/UserSession.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.security; 2 | 3 | import com.oberasoftware.jasdb.api.model.User; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface UserSession { 9 | String getSessionId(); 10 | 11 | String getAccessToken(); 12 | 13 | String getEncryptedContentKey(); 14 | 15 | User getUser(); 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/Value.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.session; 2 | 3 | /** 4 | * User: renarj 5 | * Date: 2/10/12 6 | * Time: 12:31 PM 7 | */ 8 | public interface Value { 9 | String toString(); 10 | 11 | Object getValue(); 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/BlockType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | public enum BlockType { 11 | AND, 12 | OR 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/CompositeQueryField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | public final class CompositeQueryField { 14 | private List fields; 15 | 16 | public CompositeQueryField(QueryField... fields) { 17 | this.fields = Arrays.asList(fields); 18 | } 19 | 20 | public List getFields() { 21 | return fields; 22 | } 23 | } -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/Order.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | public enum Order { 11 | ASCENDING, 12 | DESCENDING 13 | } -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/QueryExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 11 | 12 | public interface QueryExecutor { 13 | QueryExecutor limit(int limit); 14 | QueryExecutor paging(int start, int max); 15 | 16 | QueryResult execute() throws JasDBStorageException; 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/QueryFieldOperator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | public enum QueryFieldOperator { 11 | LARGER_THAN, 12 | LARGER_THAN_OR_EQUALS, 13 | SMALLER_THAN, 14 | SMALLER_THAN_OR_EQUALS, 15 | EQUALS, 16 | NOT_EQUALS 17 | } -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/QueryResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | import com.oberasoftware.jasdb.api.session.Entity; 11 | 12 | import java.io.Closeable; 13 | import java.util.Iterator; 14 | 15 | public interface QueryResult extends Iterator, Iterable, Closeable { 16 | long size(); 17 | 18 | boolean isClosed(); 19 | 20 | @Override 21 | void close(); 22 | } 23 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/session/query/SortParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.session.query; 9 | 10 | public final class SortParameter { 11 | private String field; 12 | private Order order; 13 | 14 | public SortParameter(String field, Order order) { 15 | this.field = field; 16 | this.order = order; 17 | } 18 | 19 | public String getField() { 20 | return field; 21 | } 22 | 23 | public Order getOrder() { 24 | return order; 25 | } 26 | } -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/Block.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.storage; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface Block { 9 | long getPosition(); 10 | 11 | void close() throws JasDBStorageException; 12 | } 13 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/ClonableDataStream.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.storage; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public abstract class ClonableDataStream extends InputStream { 9 | /** 10 | * This creates a cloned data stream that allows multiple threads to read 11 | * the resource in question. 12 | * @return A cloned reusable data stream 13 | */ 14 | public abstract ClonableDataStream clone() throws CloneNotSupportedException; 15 | } 16 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/DataBlockFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.storage; 2 | 3 | import com.oberasoftware.jasdb.api.caching.MemoryAware; 4 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface DataBlockFactory extends MemoryAware { 10 | void open() throws JasDBStorageException; 11 | 12 | int getBlockSize(); 13 | 14 | DataBlock getHeaderBlock() throws JasDBStorageException; 15 | 16 | DataBlock loadBlock(long position) throws JasDBStorageException; 17 | 18 | DataBlock loadBlockForDataPosition(long dataPosition) throws JasDBStorageException; 19 | 20 | DataBlock getBlockWithSpace(boolean allowFragmented) throws JasDBStorageException; 21 | 22 | void releaseBlock(long position) throws JasDBStorageException; 23 | 24 | void flush() throws JasDBStorageException; 25 | 26 | void close() throws JasDBStorageException; 27 | } 28 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/DataBlockHeader.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.storage; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public interface DataBlockHeader { 9 | static final int HEADER_SIZE = 100; 10 | 11 | long getNext(); 12 | 13 | long getPrevious(); 14 | 15 | void setNext(long next); 16 | 17 | void setPrevious(long previous); 18 | 19 | int marker(); 20 | 21 | int markerWithHeader(); 22 | 23 | void incrementMarker(int amount); 24 | 25 | void resetMarker(); 26 | 27 | void putLong(int offset, long value) throws JasDBStorageException; 28 | 29 | void putInt(int offset, int value) throws JasDBStorageException; 30 | 31 | long getLong(int offset) throws JasDBStorageException; 32 | 33 | int getInt(int offset) throws JasDBStorageException; 34 | 35 | void setNextStream(long nextStreamLocation); 36 | 37 | long getNextStream(); 38 | } 39 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/DataBlockResult.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.storage; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface DataBlockResult { 7 | int getNextOffset(); 8 | 9 | long getDataLength(); 10 | 11 | DataBlock getEndBlock(); 12 | 13 | T getValue(); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/RecordIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.storage; 9 | 10 | import java.util.Iterator; 11 | 12 | /** 13 | * Simple iterator that goes through all the matching record results 14 | */ 15 | public interface RecordIterator extends Iterable, Iterator { 16 | void reset(); 17 | 18 | void close(); 19 | } -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/RecordResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.api.storage; 9 | 10 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 11 | 12 | /** 13 | * This contains a single record result from storage. 14 | */ 15 | public interface RecordResult { 16 | /** 17 | * Gets an inputstream allowing reading of the record entity 18 | * @return The record stream 19 | * @throws JasDBStorageException If unable to stream the record 20 | */ 21 | ClonableDataStream getStream() throws JasDBStorageException; 22 | 23 | /** 24 | * The size of the record 25 | * @return The size of the record 26 | */ 27 | long getRecordSize(); 28 | 29 | /** 30 | * Returns whether a record is found 31 | * @return True if a record is found, False if not 32 | */ 33 | boolean isRecordFound(); 34 | } 35 | -------------------------------------------------------------------------------- /jasdb_api/src/main/java/com/oberasoftware/jasdb/api/storage/RecordWriterFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.api.storage; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * This factory is responsible for creating the record storage writer and opening for 9 | * persistence 10 | * 11 | * @author Renze de Vries 12 | */ 13 | public interface RecordWriterFactory { 14 | /** 15 | * Provides the provides name for this factory 16 | * @return The name of the provider 17 | */ 18 | String providerName(); 19 | 20 | /** 21 | * Creates a record writer for the given file location 22 | * @param file The file on which to create a record writer 23 | * @return The record writer 24 | * @throws JasDBStorageException If unable to create a record writer 25 | */ 26 | RecordWriter createWriter(File file) throws JasDBStorageException; 27 | } 28 | -------------------------------------------------------------------------------- /jasdb_apiconnector/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | ../pom.xml 8 | 9 | 4.0.0 10 | 11 | jasdb_apiconnector 12 | 13 | 14 | 15 | com.oberasoftware 16 | jasdb_connector 17 | ${project.version} 18 | 19 | 20 | -------------------------------------------------------------------------------- /jasdb_assembly/src/main/resources/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Obera Software 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), 4 | to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 5 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 11 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /jasdb_assembly/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /jasdb_assembly/src/main/resources/start.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL enabledelayedexpansion 3 | set DBCLASSPATH= 4 | for /R ./lib %%a in (*.jar) do ( 5 | set DBCLASSPATH=%%a;!DBCLASSPATH! 6 | ) 7 | 8 | if not defined JAVA_HOME ( 9 | echo Unable to start JASDB, JAVA_HOME must be set 10 | GOTO :END 11 | ) else ( 12 | GOTO :START 13 | ) 14 | 15 | :START 16 | set DBCLASSPATH=%DBCLASSPATH%;./configuration/ 17 | 18 | "%JAVA_HOME%/bin/java" -cp %DBCLASSPATH% -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xmx1024m nl.renarj.jasdb.JasDBMain 19 | 20 | :END 21 | -------------------------------------------------------------------------------- /jasdb_assembly/src/main/resources/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -e "${JAVA_HOME}" ]; then 4 | echo "Unable to start JASDB, JAVA_HOME must be set" 5 | exit 1 6 | fi 7 | 8 | for i in `ls /jasdb/lib/*.jar` 9 | do 10 | DB_CLASSPATH=${DB_CLASSPATH}:${i} 11 | done 12 | 13 | DB_CLASSPATH=${DB_CLASSPATH}:/jasdb/configuration/ 14 | echo "$DB_CLASSPATH" 15 | 16 | ${JAVA_HOME}/bin/java -cp ".:${DB_CLASSPATH}" -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xmx1024m com.oberasoftware.jasdb.service.JasDBMain 17 | 18 | -------------------------------------------------------------------------------- /jasdb_assembly/src/main/resources/stop.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL enabledelayedexpansion 3 | set DBCLASSPATH= 4 | for /R ./lib %%a in (*.jar) do ( 5 | set DBCLASSPATH=%%a;!DBCLASSPATH! 6 | ) 7 | 8 | if not defined JAVA_HOME ( 9 | echo Unable to start JASDB, JAVA_HOME must be set 10 | GOTO :END 11 | ) else ( 12 | GOTO :START 13 | ) 14 | 15 | :START 16 | set DBCLASSPATH=%DBCLASSPATH%;./configuration/ 17 | 18 | "%JAVA_HOME%/bin/java" -cp %DBCLASSPATH% nl.renarj.jasdb.JasDBMain --stop 19 | 20 | :END 21 | -------------------------------------------------------------------------------- /jasdb_assembly/src/main/resources/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -e "${JAVA_HOME}" ]; then 4 | echo "Unable to stop JASDB, JAVA_HOME must be set" 5 | exit 1 6 | fi 7 | 8 | for i in `ls ./lib/*.jar` 9 | do 10 | DB_CLASSPATH=${DB_CLASSPATH}:${i} 11 | done 12 | 13 | DB_CLASSPATH=${DB_CLASSPATH}:./configuration/ 14 | 15 | ${JAVA_HOME}/bin/java -cp ".:${DB_CLASSPATH}" -Xmx1024m nl.renarj.jasdb.JasDBMain --stop 16 | 17 | -------------------------------------------------------------------------------- /jasdb_buildtools/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | jasdb 7 | com.oberasoftware 8 | 2.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | jasdb_buildtools 13 | 14 | 15 | 16 | 17 | org.apache.maven.plugins 18 | maven-checkstyle-plugin 19 | false 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /jasdb_buildtools/src/main/resources/checkstyle-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /jasdb_connector/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | ../pom.xml 8 | 9 | 4.0.0 10 | 11 | jasdb_connector 12 | 13 | 14 | 15 | com.oberasoftware 16 | jasdb_api 17 | 18 | 19 | com.oberasoftware 20 | jasdb-engine 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/ConnectorLoader.java: -------------------------------------------------------------------------------- 1 | package nl.renarj.jasdb.remote; 2 | 3 | import com.oberasoftware.jasdb.api.model.NodeInformation; 4 | import nl.renarj.jasdb.remote.exceptions.RemoteException; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface ConnectorLoader { 10 | String getConnectorType(); 11 | 12 | T createConnector(NodeInformation nodeInformation, Class operationType) throws RemoteException; 13 | 14 | int priority(); 15 | 16 | boolean isReusable(); 17 | 18 | String getCachingKey(NodeInformation nodeInformation, Class operationType); 19 | 20 | void shutdown(); 21 | } 22 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/InstanceConnector.java: -------------------------------------------------------------------------------- 1 | package nl.renarj.jasdb.remote; 2 | 3 | import com.oberasoftware.jasdb.api.model.Instance; 4 | import nl.renarj.jasdb.remote.exceptions.RemoteException; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface InstanceConnector extends RemoteConnector { 12 | Instance getInstance(RemotingContext context, String instanceId) throws RemoteException; 13 | 14 | List getInstances(RemotingContext context) throws RemoteException; 15 | 16 | Instance addInstance(RemotingContext context, String instanceId) throws RemoteException; 17 | 18 | void removeInstance(RemotingContext context, String instanceId) throws RemoteException; 19 | } 20 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/RemoteConnector.java: -------------------------------------------------------------------------------- 1 | package nl.renarj.jasdb.remote; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public interface RemoteConnector { 7 | void close(); 8 | } 9 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/RemotingContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package nl.renarj.jasdb.remote; 9 | 10 | import com.oberasoftware.jasdb.core.context.RequestContext; 11 | 12 | /** 13 | * @author Renze de Vries 14 | */ 15 | public class RemotingContext extends RequestContext { 16 | private static final boolean DEFAULT_SECURE = false; 17 | 18 | public RemotingContext() { 19 | super(true, DEFAULT_SECURE); 20 | } 21 | 22 | public RemotingContext(boolean isClient) { 23 | super(isClient, DEFAULT_SECURE); 24 | } 25 | 26 | public RemotingContext(boolean isClient, boolean isSecure) { 27 | super(isClient, isSecure); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/TokenConnector.java: -------------------------------------------------------------------------------- 1 | package nl.renarj.jasdb.remote; 2 | 3 | import com.oberasoftware.jasdb.api.security.UserSession; 4 | import nl.renarj.jasdb.remote.exceptions.RemoteException; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface TokenConnector extends RemoteConnector { 10 | UserSession loadSession(String userName, String password) throws RemoteException; 11 | } 12 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/UserConnector.java: -------------------------------------------------------------------------------- 1 | package nl.renarj.jasdb.remote; 2 | 3 | import com.oberasoftware.jasdb.api.security.AccessMode; 4 | import nl.renarj.jasdb.remote.exceptions.RemoteException; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface UserConnector extends RemoteConnector { 12 | void addUser(RemotingContext context, String username, String host, String password) throws RemoteException; 13 | 14 | void deleteUser(RemotingContext context, String username) throws RemoteException; 15 | 16 | List getUsers(RemotingContext context) throws RemoteException; 17 | 18 | void grant(RemotingContext context, String object, String user, AccessMode mode) throws RemoteException; 19 | 20 | void revoke(RemotingContext context, String object, String user) throws RemoteException; 21 | } 22 | -------------------------------------------------------------------------------- /jasdb_connector/src/main/java/nl/renarj/jasdb/remote/exceptions/RemoteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package nl.renarj.jasdb.remote.exceptions; 9 | 10 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 11 | 12 | /** 13 | * User: renarj 14 | * Date: 1/22/12 15 | * Time: 3:26 PM 16 | */ 17 | public class RemoteException extends JasDBStorageException { 18 | public RemoteException(String message, Throwable e) { 19 | super(message, e); 20 | } 21 | 22 | public RemoteException(String message) { 23 | super(message); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jasdb_connector/src/test/java/nl/renarj/jasdb/remote/MockConnector1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package nl.renarj.jasdb.remote; 9 | 10 | /** 11 | * User: renarj 12 | * Date: 1/26/12 13 | * Time: 9:32 PM 14 | */ 15 | public class MockConnector1 implements RemoteConnector { 16 | @Override 17 | public void close() { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_connector/src/test/java/nl/renarj/jasdb/remote/MockConnector2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package nl.renarj.jasdb.remote; 9 | 10 | /** 11 | * User: renarj 12 | * Date: 1/26/12 13 | * Time: 9:32 PM 14 | */ 15 | public class MockConnector2 implements RemoteConnector { 16 | @Override 17 | public void close() { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_connector/src/test/resources/META-INF/services/nl.renarj.jasdb.remote.ConnectorLoader: -------------------------------------------------------------------------------- 1 | nl.renarj.jasdb.remote.MockConnectorLoader1 2 | nl.renarj.jasdb.remote.MockConnectorLoader2 -------------------------------------------------------------------------------- /jasdb_console/src/main/java/com/oberasoftware/jasdb/console/IndexWebController.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.console; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | 11 | @Controller 12 | public class IndexWebController { 13 | 14 | @RequestMapping(value = "/", method = RequestMethod.GET) 15 | public String indexRedirect() { 16 | return "redirect:/console"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jasdb_console/src/main/java/com/oberasoftware/jasdb/console/exceptions/WebException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.console.exceptions; 2 | 3 | 4 | import com.oberasoftware.jasdb.api.exceptions.JasDBException; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class WebException extends JasDBException { 10 | public WebException(String message) { 11 | super(message); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_console/src/main/java/com/oberasoftware/jasdb/console/model/Bag.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.console.model; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class Bag { 7 | private String name; 8 | 9 | public String getName() { 10 | return name; 11 | } 12 | 13 | public void setName(String name) { 14 | this.name = name; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_console/src/main/java/com/oberasoftware/jasdb/console/model/SearchForm.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.console.model; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class SearchForm { 7 | private String field; 8 | private String value; 9 | 10 | public String getField() { 11 | return field; 12 | } 13 | 14 | public void setField(String field) { 15 | this.field = field; 16 | } 17 | 18 | public String getValue() { 19 | return value; 20 | } 21 | 22 | public void setValue(String value) { 23 | this.value = value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jasdb_console/src/main/java/com/oberasoftware/jasdb/console/model/WebEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.console.model; 2 | 3 | import javax.validation.constraints.NotNull; 4 | import javax.validation.constraints.Size; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class WebEntity { 10 | @NotNull 11 | @Size(min=1) 12 | private String bag; 13 | 14 | @NotNull 15 | @Size(min=2) 16 | private String data; 17 | 18 | private String id; 19 | 20 | public String getBag() { 21 | return bag; 22 | } 23 | 24 | public void setBag(String bag) { 25 | this.bag = bag; 26 | } 27 | 28 | public String getData() { 29 | return data; 30 | } 31 | 32 | public void setData(String data) { 33 | this.data = data; 34 | } 35 | 36 | public String getId() { 37 | return id; 38 | } 39 | 40 | public void setId(String id) { 41 | this.id = id; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /jasdb_console/src/main/java/com/oberasoftware/jasdb/console/model/WebInstance.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.console.model; 2 | 3 | import javax.validation.constraints.NotNull; 4 | import javax.validation.constraints.Size; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class WebInstance { 10 | @NotNull 11 | @Size(min = 1) 12 | private String name; 13 | 14 | @NotNull 15 | @Size(min = 1) 16 | private String path; 17 | 18 | public String getName() { 19 | return name; 20 | } 21 | 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | 26 | public String getPath() { 27 | return path; 28 | } 29 | 30 | public void setPath(String path) { 31 | this.path = path; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jasdb_console/src/main/resources/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oberasoftware/jasdb/74f9364373b178fe2897b75e90d2d6fd08380191/jasdb_console/src/main/resources/static/images/favicon.ico -------------------------------------------------------------------------------- /jasdb_console/src/main/resources/static/images/obera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oberasoftware/jasdb/74f9364373b178fe2897b75e90d2d6fd08380191/jasdb_console/src/main/resources/static/images/obera.png -------------------------------------------------------------------------------- /jasdb_console/src/main/resources/static/javascript/global.js: -------------------------------------------------------------------------------- 1 | function renderTemplate(templateName, data) { 2 | let templateSource = $('#' + templateName).html(); 3 | let template = Handlebars.compile(templateSource); 4 | 5 | return template(data); 6 | } 7 | 8 | function renderAndAppend(templateName, data, elementId) { 9 | $("#" + elementId).append(renderTemplate(templateName, data)); 10 | } 11 | 12 | function isEmpty(str) { 13 | return (!str || 0 === str.length); 14 | } 15 | -------------------------------------------------------------------------------- /jasdb_console/src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Page title 5 | JasDB Admin Console 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |
17 |
18 |

Check the logs for details.

19 |
20 | 21 |
22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /jasdb_core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | 8 | 4.0.0 9 | 10 | jasdb_core 11 | 12 | 13 | 14 | com.google.guava 15 | guava 16 | 17 | 18 | org.springframework.security 19 | spring-security-core 20 | 21 | 22 | com.oberasoftware 23 | jasdb_api 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/EmbeddedEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class EmbeddedEntity extends SimpleEntity { 7 | 8 | 9 | @Override 10 | public String getInternalId() { 11 | return null; 12 | } 13 | 14 | @Override 15 | public void setInternalId(String internalId) { 16 | //not implemented 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/caching/CacheElement.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.caching; 2 | 3 | import com.oberasoftware.jasdb.api.caching.CachableItem; 4 | 5 | public class CacheElement { 6 | private String cachingKey; 7 | private CachableItem cachedItem; 8 | private long entryId; 9 | 10 | protected CacheElement(String cachingKey, CachableItem cachedItem) { 11 | this.cachedItem = cachedItem; 12 | this.cachingKey = cachingKey; 13 | this.entryId = System.currentTimeMillis(); 14 | } 15 | 16 | @Override 17 | public boolean equals(Object obj) { 18 | if(obj instanceof CacheElement) { 19 | return ((CacheElement)obj).cachingKey.equals(cachingKey); 20 | } else { 21 | return false; 22 | } 23 | } 24 | 25 | public long getEntryId() { 26 | return this.entryId; 27 | } 28 | 29 | public void setEntryId(long entryId) { 30 | this.entryId = entryId; 31 | } 32 | 33 | public CachableItem getCachedItem() { 34 | return this.cachedItem; 35 | } 36 | 37 | public String getKey() { 38 | return this.cachingKey; 39 | } 40 | 41 | @Override 42 | public int hashCode() { 43 | return cachingKey.hashCode(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/IndexScanReportImpl.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index; 2 | 3 | import com.oberasoftware.jasdb.api.index.IndexScanReport; 4 | import com.oberasoftware.jasdb.api.index.IndexState; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class IndexScanReportImpl implements IndexScanReport { 10 | private IndexState state; 11 | private long lastScan; 12 | private int completeness; 13 | 14 | public IndexScanReportImpl(IndexState state, long lastScan, int completeness) { 15 | this.state = state; 16 | this.lastScan = lastScan; 17 | this.completeness = completeness; 18 | } 19 | 20 | @Override 21 | public IndexState getState() { 22 | return state; 23 | } 24 | 25 | @Override 26 | public long getLastScan() { 27 | return lastScan; 28 | } 29 | 30 | @Override 31 | public int getCompleteness() { 32 | return completeness; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/keys/AnyKey.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.keys; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.RuntimeJasDBException; 4 | import com.oberasoftware.jasdb.core.index.keys.AbstractKey; 5 | import com.oberasoftware.jasdb.api.index.keys.CompareMethod; 6 | import com.oberasoftware.jasdb.api.index.keys.CompareResult; 7 | import com.oberasoftware.jasdb.api.index.keys.Key; 8 | 9 | /** 10 | * @author Renze de Vries 11 | */ 12 | public class AnyKey extends AbstractKey { 13 | 14 | private static final int ALWAYS_EQUALS = 0; 15 | 16 | @Override 17 | public Key cloneKey() { 18 | throw new RuntimeJasDBException("Not implemented"); 19 | } 20 | 21 | @Override 22 | public Key cloneKey(boolean includeChildren) { 23 | throw new RuntimeJasDBException("Not implemented"); 24 | } 25 | 26 | @Override 27 | public Object getValue() { 28 | throw new RuntimeJasDBException("Not implemented"); 29 | } 30 | 31 | @Override 32 | public CompareResult compare(Key otherKey, CompareMethod method) { 33 | return new CompareResult(ALWAYS_EQUALS); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/keys/types/ComplexKeyType.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.keys.types; 2 | 3 | import com.oberasoftware.jasdb.api.index.keys.KeyType; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class ComplexKeyType implements KeyType { 9 | public static final String KEY_ID = "complexType"; 10 | 11 | @Override 12 | public String getKeyId() { 13 | return KEY_ID; 14 | } 15 | 16 | @Override 17 | public String[] getKeyArguments() { 18 | return new String[0]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/keys/types/DataKeyType.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.keys.types; 2 | 3 | import com.oberasoftware.jasdb.api.index.keys.KeyType; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class DataKeyType implements KeyType { 9 | public static final String KEY_ID = "dataType"; 10 | 11 | @Override 12 | public String getKeyId() { 13 | return KEY_ID; 14 | } 15 | 16 | @Override 17 | public String[] getKeyArguments() { 18 | return new String[] {}; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/keys/types/LongKeyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.core.index.keys.types; 9 | 10 | import com.oberasoftware.jasdb.api.index.keys.KeyType; 11 | 12 | public class LongKeyType implements KeyType { 13 | public static final String KEY_ID = "longType"; 14 | 15 | public LongKeyType() { 16 | } 17 | 18 | @Override 19 | public String getKeyId() { 20 | return KEY_ID; 21 | } 22 | 23 | @Override 24 | public String[] getKeyArguments() { 25 | return new String[] { }; 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/keys/types/StringKeyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.core.index.keys.types; 9 | 10 | import com.oberasoftware.jasdb.api.index.keys.KeyType; 11 | 12 | public class StringKeyType implements KeyType { 13 | public static final String KEY_ID = "stringType"; 14 | public static final int DEFAULT_MAX_SIZE = 1024; 15 | 16 | private int maxSize; 17 | 18 | public StringKeyType() { 19 | this.maxSize = DEFAULT_MAX_SIZE; 20 | } 21 | 22 | public StringKeyType(int maxSize) { 23 | this.maxSize = maxSize; 24 | } 25 | 26 | public int getMaxSize() { 27 | return maxSize; 28 | } 29 | 30 | @Override 31 | public String getKeyId() { 32 | return KEY_ID; 33 | } 34 | 35 | @Override 36 | public String[] getKeyArguments() { 37 | return new String[] { String.valueOf(maxSize) }; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/index/keys/types/UUIDKeyType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.core.index.keys.types; 9 | 10 | 11 | import com.oberasoftware.jasdb.api.index.keys.KeyType; 12 | 13 | public class UUIDKeyType implements KeyType { 14 | public static final String KEY_ID = "uuidType"; 15 | 16 | public UUIDKeyType() { 17 | 18 | } 19 | 20 | @Override 21 | public String getKeyId() { 22 | return KEY_ID; 23 | } 24 | 25 | @Override 26 | public String[] getKeyArguments() { 27 | return new String[] {}; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/properties/BooleanValue.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.properties; 2 | 3 | import com.oberasoftware.jasdb.api.session.Value; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class BooleanValue implements Value { 9 | 10 | private boolean booleanValue; 11 | 12 | public BooleanValue(boolean booleanValue) { 13 | this.booleanValue = booleanValue; 14 | } 15 | 16 | @Override 17 | public Object getValue() { 18 | return booleanValue; 19 | } 20 | 21 | public boolean toBoolean() { 22 | return booleanValue; 23 | } 24 | 25 | @Override 26 | public boolean equals(Object o) { 27 | if (this == o) return true; 28 | if (o == null || getClass() != o.getClass()) return false; 29 | 30 | BooleanValue that = (BooleanValue) o; 31 | 32 | if (booleanValue != that.booleanValue) return false; 33 | 34 | return true; 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return (booleanValue ? 1 : 0); 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return Boolean.toString(booleanValue); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/serializer/EntityDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.serializer; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.MetadataParseException; 4 | import com.oberasoftware.jasdb.api.session.Entity; 5 | 6 | import java.io.InputStream; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface EntityDeserializer { 12 | Entity deserializeEntity(String entity) throws MetadataParseException; 13 | 14 | Entity deserializeEntity(InputStream stream) throws MetadataParseException; 15 | } 16 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/serializer/EntitySerializer.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.serializer; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.MetadataParseException; 4 | import com.oberasoftware.jasdb.api.session.Entity; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public interface EntitySerializer { 10 | String serializeEntity(Entity entity) throws MetadataParseException; 11 | } 12 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/statistics/Aggregator.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.statistics; 2 | 3 | public interface Aggregator extends Runnable { 4 | void start(); 5 | void stop(); 6 | } 7 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/statistics/DummyStatRecord.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.statistics; 2 | 3 | public class DummyStatRecord extends StatRecord { 4 | protected DummyStatRecord(StatTimeProvider timeProvider, String statName) { 5 | super(timeProvider, statName); 6 | } 7 | 8 | @Override 9 | public void start() { 10 | 11 | } 12 | 13 | @Override 14 | public void stop() { 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/statistics/NanoTimeTimeProvider.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.statistics; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | public class NanoTimeTimeProvider implements StatTimeProvider { 6 | 7 | @Override 8 | public long getCurrentTime() { 9 | return System.nanoTime(); 10 | } 11 | 12 | @Override 13 | public long formatTime(long timeDifference, TimeUnit unit) { 14 | return unit.convert(timeDifference, TimeUnit.NANOSECONDS); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/statistics/StatRecord.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.statistics; 2 | 3 | public class StatRecord { 4 | private long start; 5 | private long end; 6 | private String name; 7 | 8 | private boolean finalized = false; 9 | 10 | private StatTimeProvider timeProvider; 11 | 12 | protected StatRecord(StatTimeProvider timeProvider, String statName) { 13 | this.name = statName; 14 | this.timeProvider = timeProvider; 15 | } 16 | 17 | public void start() { 18 | this.start = this.timeProvider.getCurrentTime(); 19 | } 20 | 21 | public void stop() { 22 | this.end = this.timeProvider.getCurrentTime(); 23 | this.finalized = true; 24 | } 25 | 26 | public boolean isFinalized() { 27 | return this.finalized; 28 | } 29 | 30 | public long interval() { 31 | return this.end - start; 32 | } 33 | 34 | public String getName() { 35 | return this.name; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/statistics/StatTimeProvider.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.statistics; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | public interface StatTimeProvider { 6 | public long getCurrentTime(); 7 | 8 | public long formatTime(long timeDifference, TimeUnit unit); 9 | } 10 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils; 2 | 3 | public class StringUtils { 4 | public static boolean stringNotEmpty(String string) { 5 | return !stringEmpty(string); 6 | } 7 | 8 | public static boolean stringEmpty(String string) { 9 | return string == null || string.isEmpty(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/utils/configuration/ConfigurationProperty.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.configuration; 2 | 3 | import java.util.HashMap; 4 | 5 | public class ConfigurationProperty extends ManualConfiguration { 6 | public ConfigurationProperty(String propertyName, String value) { 7 | super("Property", new HashMap()); 8 | this.addAttribute("Name", propertyName); 9 | this.addAttribute("Value", value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/utils/conversion/LongUtils.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.conversion; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public final class LongUtils { 7 | 8 | private static final int BITMASK = 0xff; 9 | private static final int LONG_SIZE = 8; 10 | 11 | private static final int SHIFT_SIZE = 8; 12 | 13 | private LongUtils() {} 14 | 15 | public static long bytesToLong(byte[] bytes) { 16 | long v = 0; 17 | 18 | if(bytes != null && bytes.length == LONG_SIZE) { 19 | for (int i = LONG_SIZE - 1; i >= 0; i--) { 20 | v |= (long) bytes[i] & BITMASK; 21 | if (i != 0) { 22 | v <<= SHIFT_SIZE; 23 | } 24 | } 25 | } 26 | 27 | return v; 28 | } 29 | 30 | public static byte[] longToBytes(long value) { 31 | byte[] buffer = new byte[LONG_SIZE]; 32 | for(int i=0; i< LONG_SIZE; i++) { 33 | buffer[i] = (byte) value; 34 | value = value >> SHIFT_SIZE; 35 | } 36 | 37 | return buffer; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/utils/conversion/MemoryTypeConverter.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.conversion; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.CoreConfigException; 4 | 5 | public class MemoryTypeConverter implements ValueConverterType { 6 | 7 | @Override 8 | public long convertToLong(final char type, final long value) throws CoreConfigException { 9 | long unit = value; 10 | switch(type) { 11 | case 'g': 12 | unit = unit * 1024; 13 | case 'm': 14 | unit = unit * 1024; 15 | case 'k': 16 | unit = unit * 1024; 17 | return unit; 18 | default : 19 | if(Character.isDigit(type)) { 20 | return unit * 1024 * 1024; 21 | } else { 22 | throw new CoreConfigException("Unrecognized quanitifier on memory spec: " + type); 23 | } 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/utils/conversion/TimeTypeConverter.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.conversion; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.CoreConfigException; 4 | 5 | public class TimeTypeConverter implements ValueConverterType { 6 | 7 | @Override 8 | public long convertToLong(final char type, final long value) throws CoreConfigException { 9 | long unit = value; 10 | switch(type) { 11 | case 'd': 12 | unit = unit * 24; 13 | case 'h': 14 | unit = unit * 60; 15 | case 'm': 16 | unit = unit * 60; 17 | case 's': 18 | unit = unit * 1000; 19 | return unit; 20 | default : 21 | if(Character.isDigit(type)) { 22 | return unit * 1000 * 60; 23 | } else { 24 | throw new CoreConfigException("Unrecognized quanitifier on time unit: " + type); 25 | } 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /jasdb_core/src/main/java/com/oberasoftware/jasdb/core/utils/conversion/ValueConverterType.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.conversion; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.CoreConfigException; 4 | 5 | public interface ValueConverterType { 6 | long convertToLong(char type, long value) throws CoreConfigException; 7 | } 8 | -------------------------------------------------------------------------------- /jasdb_core/src/main/resources/db_keyfactories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /jasdb_core/src/main/resources/default-jasdb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /jasdb_core/src/test/java/com/oberasoftware/jasdb/core/caching/CacheItemWrapper.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.caching; 2 | 3 | import com.oberasoftware.jasdb.api.caching.CachableItem; 4 | 5 | public class CacheItemWrapper implements CachableItem { 6 | private long objectSize; 7 | private Object value; 8 | 9 | public CacheItemWrapper(Object value, long objectSize) { 10 | this.value = value; 11 | this.objectSize = objectSize; 12 | } 13 | 14 | public Object getValue() { 15 | return value; 16 | } 17 | 18 | public void setObjectSize(long objectSize) { 19 | this.objectSize = objectSize; 20 | } 21 | 22 | @Override 23 | public long getObjectSize() { 24 | return this.objectSize; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jasdb_core/src/test/java/com/oberasoftware/jasdb/core/collections/OrderedBalanceHashTreeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.core.collections; 9 | 10 | 11 | /** 12 | * User: renarj 13 | * Date: 3/2/12 14 | * Time: 4:08 PM 15 | */ 16 | public class OrderedBalanceHashTreeTest extends OrderedBalanceTreeTest { 17 | // protected OrderedBalancedTree createTree() { 18 | // return new OrderedBalancedHashTree(); 19 | // } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_core/src/test/java/com/oberasoftware/jasdb/core/utils/configuration/ConfigurationReaderTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.configuration; 2 | 3 | import com.oberasoftware.jasdb.api.engine.Configuration; 4 | import org.junit.Test; 5 | 6 | import java.util.List; 7 | 8 | import static org.junit.Assert.assertEquals; 9 | import static org.junit.Assert.assertNotNull; 10 | 11 | public class ConfigurationReaderTest { 12 | @Test 13 | public void testReadConfiguration() throws Exception { 14 | Configuration config = XMLConfiguration.loadConfiguration("some_config.xml"); 15 | assertNotNull(config); 16 | 17 | List configs = config.getChildConfigurations("/pojodb/datastore/subchild[@myattr='test']"); 18 | assertNotNull(configs); 19 | assertEquals("There should only be one config element found", 1, configs.size()); 20 | 21 | Configuration foundConfig = config.getChildConfiguration("/pojodb/datastore/subchild[@myattr='test']"); 22 | assertNotNull(foundConfig); 23 | 24 | String attr = foundConfig.getAttribute("myattr"); 25 | assertEquals("Attribute value should be 'test'", "test", attr); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /jasdb_core/src/test/java/com/oberasoftware/jasdb/core/utils/conversion/LongUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.utils.conversion; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.hamcrest.CoreMatchers.is; 6 | import static org.junit.Assert.assertThat; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public class LongUtilsTest { 12 | @Test 13 | public void testConvertAndBack() { 14 | long original = System.currentTimeMillis(); 15 | 16 | byte[] converted = LongUtils.longToBytes(original); 17 | 18 | assertThat(LongUtils.bytesToLong(converted), is(original)); 19 | } 20 | 21 | @Test 22 | public void testEmptyArray() { 23 | long result = LongUtils.bytesToLong(new byte[0]); 24 | assertThat(result, is(0l)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jasdb_core/src/test/resources/cache_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /jasdb_core/src/test/resources/data/P1000003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oberasoftware/jasdb/74f9364373b178fe2897b75e90d2d6fd08380191/jasdb_core/src/test/resources/data/P1000003.png -------------------------------------------------------------------------------- /jasdb_core/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /jasdb_core/src/test/resources/some_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /jasdb_entity/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | jasdb 7 | com.oberasoftware 8 | 2.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | jasdb_entity 13 | jar 14 | 15 | 16 | 17 | com.oberasoftware 18 | jasdb_core 19 | 20 | 21 | -------------------------------------------------------------------------------- /jasdb_entity/src/main/java/com/oberasoftware/jasdb/entitymapper/MapResultImpl.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.entitymapper; 2 | 3 | import com.oberasoftware.jasdb.api.entitymapper.EntityMetadata; 4 | import com.oberasoftware.jasdb.api.entitymapper.MapResult; 5 | import com.oberasoftware.jasdb.api.session.Entity; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public class MapResultImpl implements MapResult { 11 | 12 | private final EntityMetadata metadata; 13 | private final Entity entity; 14 | private final Object original; 15 | private final String bagName; 16 | 17 | public MapResultImpl(EntityMetadata metadata, Entity entity, Object original, String bagName) { 18 | this.metadata = metadata; 19 | this.entity = entity; 20 | this.original = original; 21 | this.bagName = bagName; 22 | } 23 | 24 | @Override 25 | public EntityMetadata getMetadata() { 26 | return metadata; 27 | } 28 | 29 | @Override 30 | public Entity getJasDBEntity() { 31 | return entity; 32 | } 33 | 34 | @Override 35 | public Object getOriginal() { 36 | return original; 37 | } 38 | 39 | @Override 40 | public String getBagName() { 41 | return bagName; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /jasdb_entity/src/test/java/com/oberasoftware/jasdb/entitymapper/BaseEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.entitymapper; 2 | 3 | import com.oberasoftware.jasdb.api.entitymapper.annotations.JasDBProperty; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class BaseEntity { 9 | private String emailAddress; 10 | 11 | public BaseEntity(String emailAddress) { 12 | this.emailAddress = emailAddress; 13 | } 14 | 15 | public BaseEntity() { 16 | } 17 | 18 | @JasDBProperty 19 | public String getEmailAddress() { 20 | return emailAddress; 21 | } 22 | 23 | public void setEmailAddress(String emailAddress) { 24 | this.emailAddress = emailAddress; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /jasdb_entity/src/test/java/com/oberasoftware/jasdb/entitymapper/LocFunction.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.entitymapper; 2 | 3 | import com.oberasoftware.jasdb.api.entitymapper.annotations.JasDBEntity; 4 | import com.oberasoftware.jasdb.api.entitymapper.annotations.JasDBProperty; 5 | 6 | @JasDBEntity(bagName = "locFunction") 7 | public class LocFunction { 8 | enum FUNCTION_TYPES { 9 | LIGHT, 10 | FRONT_REAR_LIGHT, 11 | CABIN_LIGHT 12 | } 13 | 14 | private int functionNumber; 15 | 16 | private FUNCTION_TYPES functionType; 17 | 18 | public LocFunction(int functionNumber, FUNCTION_TYPES functionType) { 19 | this.functionNumber = functionNumber; 20 | this.functionType = functionType; 21 | } 22 | 23 | @JasDBProperty 24 | public int getFunctionNumber() { 25 | return functionNumber; 26 | } 27 | 28 | public void setFunctionNumber(int functionNumber) { 29 | this.functionNumber = functionNumber; 30 | } 31 | 32 | @JasDBProperty 33 | public FUNCTION_TYPES getFunctionType() { 34 | return functionType; 35 | } 36 | 37 | public void setFunctionType(FUNCTION_TYPES functionType) { 38 | this.functionType = functionType; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | 8 | 4.0.0 9 | 10 | jasdb_index_btreeplus 11 | 12 | 13 | 14 | com.oberasoftware 15 | jasdb_core 16 | 17 | 18 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/IndexBlock.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.Block; 5 | import com.oberasoftware.jasdb.api.storage.DataBlock; 6 | import com.oberasoftware.jasdb.api.concurrency.ReadWriteLock; 7 | import com.oberasoftware.jasdb.core.index.btreeplus.locking.LockIntentType; 8 | import com.oberasoftware.jasdb.core.index.btreeplus.persistence.BlockTypes; 9 | import com.oberasoftware.jasdb.api.index.keys.Key; 10 | 11 | /** 12 | * @author Renze de Vries 13 | */ 14 | public interface IndexBlock extends Block { 15 | DataBlock getDataBlock(); 16 | 17 | void reset(); 18 | 19 | Key getFirst(); 20 | Key getLast(); 21 | int size(); 22 | 23 | long memorySize(); 24 | 25 | boolean isModified(); 26 | 27 | BlockTypes getType(); 28 | 29 | long getParentPointer(); 30 | void setParentPointer(long blockPointer); 31 | 32 | LeaveBlock findFirstLeaveBlock(LockIntentType intent) throws JasDBStorageException; 33 | LeaveBlock findLeaveBlock(LockIntentType intent, Key key) throws JasDBStorageException; 34 | 35 | ReadWriteLock getLockManager(); 36 | } 37 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/LeaveBlock.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.index.keys.Key; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface LeaveBlock extends IndexBlock { 12 | void insertKey(Key key) throws JasDBStorageException; 13 | 14 | void updateKey(Key key) throws JasDBStorageException; 15 | 16 | void removeKey(Key key) throws JasDBStorageException; 17 | 18 | boolean contains(Key key); 19 | 20 | int size(); 21 | 22 | Key getKey(Key key); 23 | 24 | List getKeyRange(Key start, boolean includeStart, Key end, boolean includeEnd); 25 | 26 | List getValues(); 27 | 28 | LeaveBlockProperties getProperties(); 29 | } 30 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/LOCK_TYPE.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | /** 4 | * @author Renze de Vries 5 | * Date: 6-6-12 6 | * Time: 20:30 7 | */ 8 | public enum LOCK_TYPE { 9 | WRITE, 10 | READ 11 | } 12 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/LockEntry.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class LockEntry { 9 | private IndexBlock block; 10 | private LOCK_TYPE type; 11 | 12 | public LockEntry(IndexBlock block, LOCK_TYPE type) { 13 | this.block = block; 14 | this.type = type; 15 | } 16 | 17 | public IndexBlock getBlock() { 18 | return block; 19 | } 20 | 21 | public LOCK_TYPE getType() { 22 | return type; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/LockIntent.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | import com.oberasoftware.jasdb.core.index.btreeplus.BlockPersister; 4 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 5 | 6 | /** 7 | * @author Renze de Vries 8 | * Date: 6-6-12 9 | * Time: 20:30 10 | */ 11 | public interface LockIntent { 12 | public boolean requiresWriteLock(BlockPersister persister, IndexBlock block); 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/LockIntentType.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | /** 4 | * @author Renze de Vries 5 | * Date: 6-6-12 6 | * Time: 21:50 7 | */ 8 | public enum LockIntentType { 9 | READ(new ReadIntent()), 10 | WRITE_EXCLUSIVE(new WriteIntentExclusive()), 11 | UPDATE(new UpdateIntent()), 12 | LEAVELOCK_OPTIMISTIC(new OptimisticLeaveLockIntent()); 13 | 14 | private LockIntent intent; 15 | 16 | LockIntentType(LockIntent intent) { 17 | this.intent = intent; 18 | } 19 | 20 | public LockIntent getIntent() { 21 | return this.intent; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/OptimisticLeaveLockIntent.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | import com.oberasoftware.jasdb.core.index.btreeplus.BlockPersister; 4 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 5 | import com.oberasoftware.jasdb.core.index.btreeplus.LeaveBlock; 6 | import com.oberasoftware.jasdb.core.index.btreeplus.RootBlock; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public class OptimisticLeaveLockIntent implements LockIntent { 12 | @Override 13 | public boolean requiresWriteLock(BlockPersister persister, IndexBlock block) { 14 | if(block instanceof RootBlock) { 15 | return ((RootBlock)block).isLeave(); 16 | } else { 17 | return block instanceof LeaveBlock; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/ReadIntent.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | import com.oberasoftware.jasdb.core.index.btreeplus.BlockPersister; 4 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 5 | 6 | /** 7 | * @author Renze de Vries 8 | * Date: 6-6-12 9 | * Time: 21:36 10 | */ 11 | public class ReadIntent implements LockIntent { 12 | @Override 13 | public boolean requiresWriteLock(BlockPersister persister, IndexBlock block) { 14 | return false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/UpdateIntent.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | import com.oberasoftware.jasdb.core.index.btreeplus.BlockPersister; 4 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 5 | import com.oberasoftware.jasdb.core.index.btreeplus.LeaveBlock; 6 | import com.oberasoftware.jasdb.core.index.btreeplus.RootBlock; 7 | 8 | /** 9 | * @author Renze de Vries 10 | * Date: 6-6-12 11 | * Time: 21:43 12 | */ 13 | public class UpdateIntent implements LockIntent { 14 | @Override 15 | public boolean requiresWriteLock(BlockPersister persister, IndexBlock block) { 16 | if(block instanceof RootBlock) { 17 | return ((RootBlock)block).isLeave(); 18 | } else { 19 | return block instanceof LeaveBlock; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/locking/WriteIntentExclusive.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.locking; 2 | 3 | import com.oberasoftware.jasdb.core.index.btreeplus.BlockPersister; 4 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 5 | 6 | /** 7 | * @author Renze de Vries 8 | * Date: 7-6-12 9 | * Time: 22:27 10 | */ 11 | public class WriteIntentExclusive implements LockIntent { 12 | @Override 13 | public boolean requiresWriteLock(BlockPersister persister, IndexBlock block) { 14 | return true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/persistence/BlockFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.persistence; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.DataBlock; 5 | import com.oberasoftware.jasdb.core.index.btreeplus.IndexBlock; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | public interface BlockFactory { 11 | T loadBlock(DataBlock dataBlock) throws JasDBStorageException; 12 | 13 | void persistBlock(T block) throws JasDBStorageException; 14 | 15 | T createBlock(long parentBlock, DataBlock dataBlock) throws JasDBStorageException; 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/persistence/BlockTypes.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.persistence; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public enum BlockTypes { 7 | ROOTBLOCK(4), 8 | NODEBLOCK(8), 9 | LEAVEBLOCK(16), 10 | DATA(32); 11 | 12 | private int typeDef; 13 | 14 | BlockTypes(int typeDef) { 15 | this.typeDef = typeDef; 16 | } 17 | 18 | public int getTypeDef() { 19 | return typeDef; 20 | } 21 | 22 | public static BlockTypes getByTypeDef(int typeDef) { 23 | if(typeDef == 32) { 24 | //most often hit for load, so first case 25 | return DATA; 26 | } else if(typeDef == 16) { 27 | return LEAVEBLOCK; 28 | } else if(typeDef == 8) { 29 | return NODEBLOCK; 30 | } else if(typeDef == 4){ 31 | return ROOTBLOCK; 32 | } else { 33 | throw new RuntimeException("Unrecognized block type"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/main/java/com/oberasoftware/jasdb/core/index/btreeplus/search/SearchOperation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.core.index.btreeplus.search; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.index.query.IndexSearchResultIteratorCollection; 5 | import com.oberasoftware.jasdb.api.index.query.SearchLimit; 6 | import com.oberasoftware.jasdb.api.index.query.SearchCondition; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public interface SearchOperation { 12 | IndexSearchResultIteratorCollection search(SearchCondition condition, SearchLimit limit) throws JasDBStorageException; 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_index_btreeplus/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /jasdb_memorywriter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | jasdb 6 | com.oberasoftware 7 | 2.0-SNAPSHOT 8 | 9 | jasdb_memorywriter 10 | jasdb_memorywriter 11 | 12 | 13 | com.oberasoftware 14 | jasdb_index_btreeplus 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /jasdb_memorywriter/src/main/java/com/oberasoftware/jasdb/writer/btree/BTreeRecordWriterFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.btree; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.RecordWriter; 5 | import com.oberasoftware.jasdb.api.storage.RecordWriterFactory; 6 | import com.oberasoftware.jasdb.core.index.keys.UUIDKey; 7 | 8 | import java.io.File; 9 | 10 | /** 11 | * @author Renze de Vries 12 | */ 13 | public class BTreeRecordWriterFactory implements RecordWriterFactory { 14 | @Override 15 | public String providerName() { 16 | return "inmemory"; 17 | } 18 | 19 | @Override 20 | public RecordWriter createWriter(File file) throws JasDBStorageException { 21 | return new BtreeIndexRecordWriter(file); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jasdb_memorywriter/src/main/java/com/oberasoftware/jasdb/writer/btree/BtreeRecordResult.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.btree; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.RecordResult; 5 | import com.oberasoftware.jasdb.api.storage.ClonableDataStream; 6 | import com.oberasoftware.jasdb.core.index.keys.DataKey; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public class BtreeRecordResult implements RecordResult { 12 | private DataKey dataKey; 13 | 14 | public BtreeRecordResult(DataKey dataKey) { 15 | this.dataKey = dataKey; 16 | } 17 | 18 | public BtreeRecordResult() { 19 | 20 | } 21 | 22 | @Override 23 | public ClonableDataStream getStream() throws JasDBStorageException { 24 | return dataKey.getStream(); 25 | } 26 | 27 | @Override 28 | public long getRecordSize() { 29 | return dataKey.size(); 30 | } 31 | 32 | @Override 33 | public boolean isRecordFound() { 34 | return dataKey != null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /jasdb_memorywriter/src/main/java/com/oberasoftware/jasdb/writer/btree/CachableRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.writer.btree; 9 | 10 | import com.oberasoftware.jasdb.api.caching.CachableItem; 11 | import com.oberasoftware.jasdb.api.storage.RecordResult; 12 | 13 | public class CachableRecord implements CachableItem { 14 | private RecordResult result; 15 | 16 | public CachableRecord(RecordResult result) { 17 | this.result = result; 18 | } 19 | 20 | public RecordResult getResult() { 21 | return this.result; 22 | } 23 | 24 | @Override 25 | public long getObjectSize() { 26 | return result.getRecordSize(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /jasdb_memorywriter/src/test/java/com/oberasoftware/jasdb/writer/btree/BaseTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.btree; 2 | 3 | 4 | import org.junit.Assert; 5 | 6 | import java.io.File; 7 | 8 | public abstract class BaseTest { 9 | protected static File tmpDir = new File(System.getProperty("java.io.tmpdir")); 10 | 11 | protected static void assertDelete(File deleteFile) { 12 | if(deleteFile.exists()) { 13 | Assert.assertTrue(deleteFile.delete()); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_memorywriter/src/test/java/com/oberasoftware/jasdb/writer/btree/BtreeIndexRecordWriterTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.btree; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.RecordWriter; 5 | 6 | import java.io.File; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public class BtreeIndexRecordWriterTest extends BaseRecordWriterTest { 12 | @Override 13 | protected RecordWriter createRecordWriter(File recordFile) throws JasDBStorageException { 14 | return new BtreeIndexRecordWriter(recordFile); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_memorywriter/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /jasdb_transwriter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | jasdb 6 | com.oberasoftware 7 | 2.0-SNAPSHOT 8 | 9 | jasdb_transwriter 10 | jasdb_transwriter 11 | 12 | 13 | com.oberasoftware 14 | jasdb_index_btreeplus 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /jasdb_transwriter/src/main/java/com/oberasoftware/jasdb/writer/transactional/RECORD_FLAG.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2011 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2011 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.writer.transactional; 9 | 10 | public enum RECORD_FLAG { 11 | ACTIVE(0), 12 | DELETED(1), 13 | EMPTY(2), 14 | UPDATED(3); 15 | 16 | private int flag; 17 | 18 | RECORD_FLAG(int flag) { 19 | this.flag = flag; 20 | } 21 | 22 | public int getFlag() { 23 | return this.flag; 24 | } 25 | 26 | static RECORD_FLAG getRecordFlag(int flag) { 27 | for(RECORD_FLAG recordFlag : values()) { 28 | if(recordFlag.getFlag() == flag) { 29 | return recordFlag; 30 | } 31 | } 32 | 33 | return ACTIVE; 34 | } 35 | } -------------------------------------------------------------------------------- /jasdb_transwriter/src/main/java/com/oberasoftware/jasdb/writer/transactional/TransactionalRecordWriterFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.transactional; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.RecordWriter; 5 | import com.oberasoftware.jasdb.api.storage.RecordWriterFactory; 6 | import com.oberasoftware.jasdb.core.index.keys.UUIDKey; 7 | 8 | import java.io.File; 9 | 10 | /** 11 | * @author Renze de Vries 12 | */ 13 | public class TransactionalRecordWriterFactory implements RecordWriterFactory { 14 | @Override 15 | public String providerName() { 16 | return "transactional"; 17 | } 18 | 19 | @Override 20 | public RecordWriter createWriter(File file) throws JasDBStorageException { 21 | return new TransactionalRecordWriter(file); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /jasdb_transwriter/src/main/resources/META-INF/services/com.oberasoftware.jasdb.api.storage.RecordWriterFactory: -------------------------------------------------------------------------------- 1 | com.oberasoftware.jasdb.writer.transactional.TransactionalRecordWriterFactory -------------------------------------------------------------------------------- /jasdb_transwriter/src/test/java/com/oberasoftware/jasdb/writer/transactional/BaseTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.transactional; 2 | 3 | 4 | import org.junit.Assert; 5 | 6 | import java.io.File; 7 | 8 | public abstract class BaseTest { 9 | protected static File tmpDir = new File(System.getProperty("java.io.tmpdir")); 10 | 11 | protected static void assertDelete(File deleteFile) { 12 | if(deleteFile.exists()) { 13 | Assert.assertTrue(deleteFile.delete()); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jasdb_transwriter/src/test/java/com/oberasoftware/jasdb/writer/transactional/FSRecordWriterTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.writer.transactional; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import com.oberasoftware.jasdb.api.storage.RecordWriter; 5 | 6 | import java.io.File; 7 | 8 | public class FSRecordWriterTest extends BaseRecordWriterTest { 9 | @Override 10 | protected RecordWriter createRecordWriter(File recordFile) throws JasDBStorageException { 11 | return new TransactionalRecordWriter(recordFile); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jasdb_transwriter/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /rest/jasdb-restclient/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | ../../pom.xml 8 | 9 | 10 | 4.0.0 11 | 12 | jasdb-restclient 13 | 14 | 15 | 16 | com.oberasoftware 17 | jasdb_apiconnector 18 | 19 | 20 | com.oberasoftware 21 | jasdb_restmodel 22 | 23 | 24 | com.oberasoftware 25 | jasdb_entity 26 | 27 | 28 | -------------------------------------------------------------------------------- /rest/jasdb-restclient/src/main/java/com/oberasoftware/jasdb/rest/client/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.client; 2 | 3 | import nl.renarj.jasdb.remote.exceptions.RemoteException; 4 | 5 | /** 6 | * @author Renze de Vries 7 | * Date: 8-6-12 8 | * Time: 19:05 9 | */ 10 | public class ResourceNotFoundException extends RemoteException { 11 | public ResourceNotFoundException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rest/jasdb-restclient/src/main/resources/META-INF/services/nl.renarj.jasdb.remote.ConnectorLoader: -------------------------------------------------------------------------------- 1 | com.oberasoftware.jasdb.rest.client.RestConnectorLoader -------------------------------------------------------------------------------- /rest/jasdb-restclient/src/test/java/com/oberasoftware/jasdb/rest/client/RestDBSessionFactoryTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.client; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.JasDBStorageException; 4 | import org.junit.Test; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class RestDBSessionFactoryTest { 10 | @Test 11 | public void testWithPropertiesSet() throws JasDBStorageException { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jasdb 5 | com.oberasoftware 6 | 2.0-SNAPSHOT 7 | ../../pom.xml 8 | 9 | 4.0.0 10 | 11 | jasdb_restmodel 12 | 13 | 14 | com.oberasoftware 15 | jasdb_core 16 | 17 | 18 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/BagCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | public class BagCollection implements RestEntity { 6 | private List bags; 7 | 8 | public BagCollection(List bags) { 9 | this.bags = bags; 10 | } 11 | 12 | public BagCollection() { 13 | 14 | } 15 | 16 | public List getBags() { 17 | return bags; 18 | } 19 | 20 | public void setBags(List bags) { 21 | this.bags = bags; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/CacheBucket.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | public class CacheBucket implements RestEntity { 4 | private String name; 5 | private int size; 6 | private long memSize; 7 | 8 | public CacheBucket(String name, int size, long memSize) { 9 | this.name = name; 10 | this.size = size; 11 | this.memSize = memSize; 12 | } 13 | 14 | public String getName() { 15 | return this.name; 16 | } 17 | 18 | public int getSize() { 19 | return this.size; 20 | } 21 | 22 | public long getMemSize() { 23 | return this.memSize; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/CacheBucketCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | public class CacheBucketCollection implements RestEntity { 6 | private List buckets; 7 | 8 | public CacheBucketCollection(List buckets) { 9 | this.buckets = buckets; 10 | } 11 | 12 | public List getBuckets() { 13 | return buckets; 14 | } 15 | 16 | public void setBuckets(List buckets) { 17 | this.buckets = buckets; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/ErrorEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | /** 4 | * @author Renze de Vries 5 | * Date: 8-6-12 6 | * Time: 18:18 7 | */ 8 | public class ErrorEntity implements RestEntity { 9 | private int statusCode; 10 | private String message; 11 | 12 | public ErrorEntity(int statusCode, String message) { 13 | this.statusCode = statusCode; 14 | this.message = message; 15 | } 16 | 17 | public ErrorEntity() { 18 | 19 | } 20 | 21 | public int getStatusCode() { 22 | return statusCode; 23 | } 24 | 25 | public void setStatusCode(int statusCode) { 26 | this.statusCode = statusCode; 27 | } 28 | 29 | public String getMessage() { 30 | return message; 31 | } 32 | 33 | public void setMessage(String message) { 34 | this.message = message; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/IndexCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | * Date: 3-6-12 8 | * Time: 16:43 9 | */ 10 | public class IndexCollection implements RestEntity { 11 | private List indexEntryList; 12 | 13 | public IndexCollection() { 14 | 15 | } 16 | 17 | public IndexCollection(List indexEntryList) { 18 | this.indexEntryList = indexEntryList; 19 | } 20 | 21 | public List getIndexEntryList() { 22 | return indexEntryList; 23 | } 24 | 25 | public void setIndexEntryList(List indexEntryList) { 26 | this.indexEntryList = indexEntryList; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/InstanceCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class InstanceCollection implements RestEntity { 9 | private List instances; 10 | 11 | public InstanceCollection(List instances) { 12 | this.instances = instances; 13 | } 14 | 15 | public InstanceCollection() { 16 | 17 | } 18 | 19 | public List getInstances() { 20 | return instances; 21 | } 22 | 23 | public void setInstances(List instances) { 24 | this.instances = instances; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/InstanceRest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | 4 | import com.oberasoftware.jasdb.api.model.Instance; 5 | 6 | public class InstanceRest implements RestEntity, Instance { 7 | private String path; 8 | private String version; 9 | private String instanceId; 10 | private String status; 11 | 12 | public InstanceRest(String path, String status, String version, String instanceId) { 13 | this.path = path; 14 | this.version = version; 15 | this.instanceId = instanceId; 16 | this.status = status; 17 | } 18 | 19 | public InstanceRest() { 20 | 21 | } 22 | 23 | public String getStatus() { 24 | return this.status; 25 | } 26 | 27 | public String getVersion() { 28 | return this.version; 29 | } 30 | 31 | @Override 32 | public String getInstanceId() { 33 | return this.instanceId; 34 | } 35 | 36 | @Override 37 | public String getPath() { 38 | return this.path; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/NodeServiceInformation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class NodeServiceInformation { 9 | private Map properties; 10 | private String serviceType; 11 | 12 | public NodeServiceInformation() { 13 | 14 | } 15 | 16 | public String getServiceType() { 17 | return serviceType; 18 | } 19 | 20 | public void setServiceType(String serviceType) { 21 | this.serviceType = serviceType; 22 | } 23 | 24 | public Map getProperties() { 25 | return properties; 26 | } 27 | 28 | public void setProperties(Map properties) { 29 | this.properties = properties; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestBag.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | public class RestBag implements RestEntity { 4 | private String instanceId; 5 | private String name; 6 | private long size; 7 | private long diskSize; 8 | 9 | public RestBag(String instanceId, String name, long size, long diskSize) { 10 | this.instanceId = instanceId; 11 | this.name = name; 12 | this.size = size; 13 | this.diskSize = diskSize; 14 | } 15 | 16 | public RestBag() { 17 | 18 | } 19 | 20 | public String getInstanceId() { 21 | return this.instanceId; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public long getSize() { 29 | return size; 30 | } 31 | 32 | public long getDiskSize() { 33 | return diskSize; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | 4 | public interface RestEntity { 5 | } 6 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestGrant.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | 4 | import com.oberasoftware.jasdb.api.security.AccessMode; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class RestGrant implements RestEntity { 10 | private String username; 11 | private String objectName; 12 | private AccessMode mode; 13 | 14 | public RestGrant(String username, String object, AccessMode mode) { 15 | this.username = username; 16 | this.objectName = object; 17 | this.mode = mode; 18 | } 19 | 20 | public RestGrant() { 21 | 22 | } 23 | 24 | public String getObjectName() { 25 | return objectName; 26 | } 27 | 28 | public void setObjectName(String objectName) { 29 | this.objectName = objectName; 30 | } 31 | 32 | public String getUsername() { 33 | return username; 34 | } 35 | 36 | public void setUsername(String username) { 37 | this.username = username; 38 | } 39 | 40 | public AccessMode getMode() { 41 | return mode; 42 | } 43 | 44 | public void setMode(AccessMode mode) { 45 | this.mode = mode; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestGrantObject.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class RestGrantObject implements RestEntity { 9 | private List grants; 10 | private String objectName; 11 | 12 | public RestGrantObject(String objectName, List grants) { 13 | this.grants = grants; 14 | this.objectName = objectName; 15 | } 16 | 17 | public RestGrantObject() { 18 | 19 | } 20 | 21 | public List getGrants() { 22 | return grants; 23 | } 24 | 25 | public void setGrants(List grants) { 26 | this.grants = grants; 27 | } 28 | 29 | public String getObjectName() { 30 | return objectName; 31 | } 32 | 33 | public void setObjectName(String objectName) { 34 | this.objectName = objectName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestGrantObjectCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class RestGrantObjectCollection implements RestEntity { 9 | private List grantList; 10 | 11 | public RestGrantObjectCollection(List grantList) { 12 | this.grantList = grantList; 13 | } 14 | 15 | public RestGrantObjectCollection() { 16 | 17 | } 18 | 19 | public List getGrantList() { 20 | return grantList; 21 | } 22 | 23 | public void setGrantList(List grantList) { 24 | this.grantList = grantList; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestUser.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class RestUser implements RestEntity { 7 | private String username; 8 | private String allowedHost; 9 | private String password; 10 | 11 | public RestUser(String username, String allowedHost, String password) { 12 | this.username = username; 13 | this.allowedHost = allowedHost; 14 | this.password = password; 15 | } 16 | 17 | public RestUser() { 18 | 19 | } 20 | 21 | public String getAllowedHost() { 22 | return allowedHost; 23 | } 24 | 25 | public void setAllowedHost(String allowedHost) { 26 | this.allowedHost = allowedHost; 27 | } 28 | 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | public void setUsername(String username) { 34 | this.username = username; 35 | } 36 | 37 | public String getPassword() { 38 | return password; 39 | } 40 | 41 | public void setPassword(String password) { 42 | this.password = password; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/RestUserList.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class RestUserList implements RestEntity { 10 | private List users; 11 | 12 | public RestUserList() { 13 | 14 | } 15 | 16 | public RestUserList(List userList) { 17 | users = new ArrayList<>(userList.size()); 18 | for(String user: userList) { 19 | users.add(new RestUser(user, null, null)); 20 | } 21 | } 22 | 23 | public List getUsers() { 24 | return users; 25 | } 26 | 27 | public void setUsers(List users) { 28 | this.users = users; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/StatisticCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author Renze de Vries 7 | * Date: 1-5-12 8 | * Time: 21:45 9 | */ 10 | public class StatisticCollection implements RestEntity { 11 | private List stats; 12 | public StatisticCollection(List stats) { 13 | this.stats = stats; 14 | } 15 | 16 | public List getStats() { 17 | return stats; 18 | } 19 | 20 | public void setStats(List stats) { 21 | this.stats = stats; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/mappers/GrantModelMapper.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model.mappers; 2 | 3 | import com.oberasoftware.jasdb.api.model.Grant; 4 | import com.oberasoftware.jasdb.api.model.GrantObject; 5 | import com.oberasoftware.jasdb.rest.model.RestGrant; 6 | import com.oberasoftware.jasdb.rest.model.RestGrantObject; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Renze de Vries 13 | */ 14 | public class GrantModelMapper { 15 | public static RestGrantObject map(GrantObject grantObject) { 16 | grantObject.getGrants(); 17 | 18 | List mappedGrants = new ArrayList<>(); 19 | for(Grant grant : grantObject.getGrants()) { 20 | mappedGrants.add(map(grantObject.getObjectName(), grant)); 21 | } 22 | 23 | return new RestGrantObject(grantObject.getObjectName(), mappedGrants); 24 | } 25 | 26 | public static RestGrant map(String objectName, Grant grant) { 27 | return new RestGrant(grant.getGrantedUsername(), objectName, grant.getAccessMode()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/mappers/IndexModelMapper.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model.mappers; 2 | 3 | import com.oberasoftware.jasdb.api.model.IndexDefinition; 4 | import com.oberasoftware.jasdb.rest.model.IndexEntry; 5 | 6 | /** 7 | * @author Renze de Vries 8 | * Date: 8-6-12 9 | * Time: 14:51 10 | */ 11 | public class IndexModelMapper { 12 | private IndexModelMapper() { 13 | 14 | } 15 | 16 | public static IndexEntry map(IndexDefinition definition, boolean isUnique) { 17 | return new IndexEntry(definition.getIndexName(), definition.getHeaderDescriptor(), definition.getValueDescriptor(), isUnique, definition.getIndexType()); 18 | } 19 | 20 | public static IndexDefinition map(IndexEntry entry) { 21 | return new IndexDefinition(entry.getName(), entry.getKeyHeader(), entry.getValueHeader(), entry.getIndexType()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/serializers/RestResponseHandler.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model.serializers; 2 | 3 | import com.oberasoftware.jasdb.api.exceptions.RestException; 4 | import com.oberasoftware.jasdb.rest.model.RestEntity; 5 | 6 | import java.io.InputStream; 7 | import java.io.OutputStream; 8 | 9 | public interface RestResponseHandler { 10 | T deserialize(Class dataType, InputStream inputStream) throws RestException; 11 | T deserialize(Class dataType, String data) throws RestException; 12 | 13 | void serialize(RestEntity entity, OutputStream outputStream) throws RestException; 14 | 15 | String getMediaType(); 16 | } 17 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/streaming/StreamableEntityCollection.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model.streaming; 2 | 3 | import com.oberasoftware.jasdb.api.session.query.QueryResult; 4 | import com.oberasoftware.jasdb.rest.model.RestEntity; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class StreamableEntityCollection implements RestEntity { 10 | private QueryResult result; 11 | private long size; 12 | private long timeMilliseconds; 13 | 14 | public StreamableEntityCollection(QueryResult result) { 15 | this.result = result; 16 | this.size = result.size(); 17 | } 18 | 19 | public void setTimeMilliseconds(long timeMilliseconds) { 20 | this.timeMilliseconds = timeMilliseconds; 21 | } 22 | 23 | public QueryResult getResult() { 24 | return result; 25 | } 26 | 27 | public long getSize() { 28 | return size; 29 | } 30 | 31 | public long getTimeMilliseconds() { 32 | return timeMilliseconds; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /rest/jasdb_restmodel/src/main/java/com/oberasoftware/jasdb/rest/model/streaming/StreamedEntity.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.model.streaming; 2 | 3 | import com.oberasoftware.jasdb.api.session.Entity; 4 | import com.oberasoftware.jasdb.rest.model.RestEntity; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class StreamedEntity implements RestEntity { 10 | private Entity entity; 11 | 12 | public StreamedEntity(Entity entity) { 13 | this.entity = entity; 14 | } 15 | 16 | public Entity getEntity() { 17 | return entity; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/CorsFilter.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service; 2 | 3 | import jakarta.servlet.*; 4 | import jakarta.servlet.http.HttpServletResponse; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.io.IOException; 8 | 9 | @Component 10 | public class CorsFilter implements Filter { 11 | @Override 12 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { 13 | HttpServletResponse response = (HttpServletResponse) res; 14 | response.setHeader("Access-Control-Allow-Origin", "*"); 15 | response.setHeader("Access-Control-Max-Age", "3600"); 16 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with"); 17 | chain.doFilter(req, res); 18 | } 19 | 20 | public void init(FilterConfig filterConfig) {} 21 | 22 | public void destroy() {} 23 | } 24 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/RestConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.springframework.context.annotation.*; 5 | import org.springframework.core.type.AnnotatedTypeMetadata; 6 | 7 | import static org.slf4j.LoggerFactory.getLogger; 8 | 9 | @Configuration 10 | @Conditional(RestConfiguration.Condition.class) 11 | @ComponentScan 12 | public class RestConfiguration { 13 | static class Condition implements ConfigurationCondition { 14 | 15 | @Override 16 | public ConfigurationPhase getConfigurationPhase() { 17 | return ConfigurationPhase.PARSE_CONFIGURATION; 18 | } 19 | 20 | @Override 21 | public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { 22 | return RestConfigurationLoader.isEnabled(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/SSLDetails.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service; 2 | 3 | /** 4 | * @author Renze de Vries 5 | */ 6 | public class SSLDetails { 7 | private int sslPort; 8 | private String keystore; 9 | private String keystorePass; 10 | 11 | public SSLDetails(int sslPort, String keystore, String keystorePass) { 12 | this.sslPort = sslPort; 13 | this.keystore = keystore; 14 | this.keystorePass = keystorePass; 15 | } 16 | 17 | public int getSslPort() { 18 | return sslPort; 19 | } 20 | 21 | public String getKeystore() { 22 | return keystore; 23 | } 24 | 25 | public String getKeystorePass() { 26 | return keystorePass; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "SSLDetails{" + 32 | "sslPort=" + sslPort + 33 | ", keystore='" + keystore + '\'' + 34 | '}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/InputScanner.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class InputScanner { 10 | private static final Logger LOG = LoggerFactory.getLogger(InputScanner.class); 11 | 12 | private static final Pattern tokenPattern = Pattern.compile("'['\\p{L}.\\p{N}- _=:]+'|['\\p{L}.\\p{N}- _]+|[!|=|>|<\\|,()]"); 13 | private Matcher matcher; 14 | 15 | public InputScanner(String scanText) { 16 | this.matcher = tokenPattern.matcher(scanText); 17 | } 18 | 19 | public String nextToken() { 20 | if(matcher.find()) { 21 | String matchToken = matcher.group(0); 22 | 23 | LOG.debug("Input token found: {}", matchToken); 24 | return matchToken; 25 | } else { 26 | LOG.trace("End of input, no more tokens found"); 27 | return null; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/OrderParam.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input; 2 | 3 | /** 4 | * @author Renze de Vries 5 | * Date: 15-6-12 6 | * Time: 13:11 7 | */ 8 | public class OrderParam { 9 | public enum DIRECTION { 10 | ASC, 11 | DESC 12 | } 13 | 14 | private String field; 15 | private DIRECTION sortDirection; 16 | 17 | public OrderParam(String field, DIRECTION sortDirection) { 18 | this.field = field; 19 | this.sortDirection = sortDirection; 20 | } 21 | 22 | public String getField() { 23 | return field; 24 | } 25 | 26 | public DIRECTION getSortDirection() { 27 | return sortDirection; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/TokenType.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input; 2 | 3 | public enum TokenType { 4 | BLOCK_START("(", false), 5 | BLOCK_END(")", false), 6 | AND(",", false), 7 | OR("|", false), 8 | EQUALS("=", true), 9 | LARGER(">", true), 10 | SMALLER("<", true), 11 | NOT_EQUALS("!", true), 12 | LITERAL("", false); 13 | 14 | 15 | private String token; 16 | private boolean fieldOperator; 17 | 18 | TokenType(String token, boolean fieldOperator) { 19 | this.token = token; 20 | this.fieldOperator = fieldOperator; 21 | } 22 | 23 | public String getToken() { 24 | return this.token; 25 | } 26 | 27 | public static TokenType getTokenType(String token) { 28 | for(TokenType type : values()) { 29 | if(type.getToken().equals(token)) { 30 | return type; 31 | } 32 | } 33 | 34 | return TokenType.LITERAL; 35 | } 36 | 37 | public boolean isFieldOperator() { 38 | return fieldOperator; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/conditions/AndBlockOperation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input.conditions; 2 | 3 | import com.oberasoftware.jasdb.rest.service.input.TokenType; 4 | 5 | public class AndBlockOperation extends BlockOperation { 6 | public AndBlockOperation() { 7 | 8 | } 9 | 10 | @Override 11 | public TokenType getTokenType() { 12 | return TokenType.AND; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/conditions/BlockOperation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input.conditions; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public abstract class BlockOperation implements InputCondition { 7 | private List childConditions; 8 | 9 | public BlockOperation() { 10 | this.childConditions = new ArrayList<>(); 11 | } 12 | 13 | public BlockOperation addInputCondition(InputCondition condition) { 14 | this.childConditions.add(condition); 15 | return this; 16 | } 17 | 18 | public List getChildConditions() { 19 | return this.childConditions; 20 | } 21 | 22 | @Override 23 | public String toString() { 24 | StringBuilder builder = new StringBuilder(); 25 | builder.append(getTokenType()).append("("); 26 | boolean first = true; 27 | for(InputCondition condition : childConditions) { 28 | if(!first) { 29 | builder.append(", "); 30 | } 31 | builder.append("Condition[").append(condition).append("]"); 32 | first = false; 33 | } 34 | builder.append(")"); 35 | 36 | return builder.toString(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/conditions/InputCondition.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input.conditions; 2 | 3 | import com.oberasoftware.jasdb.rest.service.input.TokenType; 4 | 5 | public interface InputCondition { 6 | TokenType getTokenType(); 7 | } 8 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/java/com/oberasoftware/jasdb/rest/service/input/conditions/OrBlockOperation.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.rest.service.input.conditions; 2 | 3 | import com.oberasoftware.jasdb.rest.service.input.TokenType; 4 | 5 | public class OrBlockOperation extends BlockOperation { 6 | public OrBlockOperation() { 7 | 8 | } 9 | 10 | @Override 11 | public TokenType getTokenType() { 12 | return TokenType.OR; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/main/resources/META-INF/services/controllers.PathModelLoader: -------------------------------------------------------------------------------- 1 | controllers.InstanceModelLoader 2 | controllers.BagModelLoader 3 | controllers.EntityModelLoader 4 | controllers.CacheModelLoader 5 | controllers.StatisticsModelLoader 6 | controllers.IndexModelLoader 7 | controllers.UserModelLoader 8 | controllers.GrantModelLoader -------------------------------------------------------------------------------- /rest/jasdb_restservice/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/LocalDBSessionTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration; 2 | 3 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 4 | import com.oberasoftware.jasdb.test.DBSessionTest; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class LocalDBSessionTest extends DBSessionTest { 10 | public LocalDBSessionTest() { 11 | super(new LocalDBSessionFactory()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/LocalEntityBagTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2012 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2012 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.integration; 9 | 10 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 11 | import com.oberasoftware.jasdb.test.EntityBagTest; 12 | 13 | /** 14 | * @author Renze de Vries 15 | */ 16 | public class LocalEntityBagTest extends EntityBagTest { 17 | public LocalEntityBagTest() { 18 | super(new LocalDBSessionFactory()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/LocalEntityManagerTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration; 2 | 3 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 4 | import com.oberasoftware.jasdb.test.EntityManagerTest; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class LocalEntityManagerTest extends EntityManagerTest { 10 | public LocalEntityManagerTest() { 11 | super(new LocalDBSessionFactory()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/LocalQueryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2012 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2012 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.integration; 9 | 10 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 11 | import com.oberasoftware.jasdb.test.EntityQueryTest; 12 | 13 | /** 14 | * User: renarj 15 | * Date: 5/11/12 16 | * Time: 2:40 PM 17 | */ 18 | public class LocalQueryTest extends EntityQueryTest { 19 | public LocalQueryTest() { 20 | super(new LocalDBSessionFactory()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/LocalSortAndLimitQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration; 2 | 3 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 4 | import com.oberasoftware.jasdb.test.SortAndLimitQueryTest; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class LocalSortAndLimitQueryTest extends SortAndLimitQueryTest { 10 | public LocalSortAndLimitQueryTest() { 11 | super(new LocalDBSessionFactory()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/LocalTableScanQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration; 2 | 3 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 4 | import com.oberasoftware.jasdb.test.TableScanQueryTest; 5 | 6 | /** 7 | * @author Renze de Vries 8 | */ 9 | public class LocalTableScanQueryTest extends TableScanQueryTest { 10 | public LocalTableScanQueryTest() { 11 | super(new LocalDBSessionFactory()); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/OverrideSecureSessionFactory.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration; 2 | 3 | import com.oberasoftware.jasdb.acl.BasicCredentials; 4 | import com.oberasoftware.jasdb.api.exceptions.JasDBException; 5 | import com.oberasoftware.jasdb.api.session.DBSession; 6 | import com.oberasoftware.jasdb.service.local.LocalDBSessionFactory; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public class OverrideSecureSessionFactory extends LocalDBSessionFactory { 12 | @Override 13 | public DBSession createSession(String instance) throws JasDBException { 14 | return super.createSession(instance, new BasicCredentials("admin", "localhost", "")); 15 | } 16 | 17 | @Override 18 | public DBSession createSession() throws JasDBException { 19 | return super.createSession(new BasicCredentials("admin", "localhost", "")); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/SecureLocalDBSessionTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration; 2 | 3 | 4 | import com.oberasoftware.jasdb.test.DBSessionTest; 5 | import org.junit.Ignore; 6 | 7 | /** 8 | * @author Renze de Vries 9 | */ 10 | @Ignore 11 | public class SecureLocalDBSessionTest extends DBSessionTest { 12 | public SecureLocalDBSessionTest() { 13 | super(new OverrideSecureSessionFactory()); 14 | } 15 | 16 | @Override 17 | public void tearDown() throws Exception { 18 | System.setProperty("jasdb-config", ""); 19 | super.tearDown(); 20 | } 21 | 22 | @Override 23 | public void setUp() throws Exception { 24 | System.setProperty("jasdb-config", "jasdb-local-withsecurity.xml"); 25 | super.setUp(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/rest/RestDBSessionTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration.rest; 2 | 3 | 4 | import com.oberasoftware.jasdb.test.DBSessionTest; 5 | import org.junit.After; 6 | import org.junit.Before; 7 | 8 | /** 9 | * @author Renze de Vries 10 | */ 11 | public class RestDBSessionTest extends DBSessionTest { 12 | public RestDBSessionTest() { 13 | super(new TestRestDBSessionFactory()); 14 | } 15 | 16 | @After 17 | public void tearDown() throws Exception { 18 | super.tearDown(); 19 | System.setProperty("jasdb-config", ""); 20 | } 21 | 22 | @Before 23 | public void setUp() throws Exception { 24 | System.setProperty("jasdb-config", "jasdb-rest.xml"); 25 | super.setUp(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/rest/RestEntityBagTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2012 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2012 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.integration.rest; 9 | 10 | import com.oberasoftware.jasdb.test.EntityBagTest; 11 | 12 | /** 13 | * User: renarj 14 | * Date: 5/11/12 15 | * Time: 6:19 PM 16 | */ 17 | public class RestEntityBagTest extends EntityBagTest { 18 | public RestEntityBagTest() { 19 | super(new TestRestDBSessionFactory()); 20 | } 21 | 22 | @Override 23 | public void tearDown() throws Exception { 24 | super.tearDown(); 25 | System.setProperty("jasdb-config", ""); 26 | } 27 | 28 | @Override 29 | public void setUp() throws Exception { 30 | System.setProperty("jasdb-config", "jasdb-rest.xml"); 31 | super.setUp(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/rest/RestEntityManagerTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration.rest; 2 | 3 | import com.oberasoftware.jasdb.test.EntityManagerTest; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class RestEntityManagerTest extends EntityManagerTest { 9 | public RestEntityManagerTest() { 10 | super(new TestRestDBSessionFactory()); 11 | } 12 | 13 | @Override 14 | public void tearDown() throws Exception { 15 | super.tearDown(); 16 | System.setProperty("jasdb-config", ""); 17 | } 18 | 19 | @Override 20 | public void setUp() throws Exception { 21 | System.setProperty("jasdb-config", "jasdb-rest.xml"); 22 | 23 | super.setUp(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/rest/RestQueryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2012 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2012 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.oberasoftware.jasdb.integration.rest; 9 | 10 | import com.oberasoftware.jasdb.test.EntityQueryTest; 11 | 12 | /** 13 | * @author Renze de Vries 14 | */ 15 | public class RestQueryTest extends EntityQueryTest { 16 | public RestQueryTest() { 17 | super(new TestRestDBSessionFactory()); 18 | } 19 | 20 | @Override 21 | public void tearDown() throws Exception { 22 | super.tearDown(); 23 | System.setProperty("jasdb-config", ""); 24 | } 25 | 26 | @Override 27 | public void setUp() throws Exception { 28 | System.setProperty("jasdb-config", "jasdb-rest.xml"); 29 | 30 | super.setUp(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/rest/RestSortAndLimitQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration.rest; 2 | 3 | import com.oberasoftware.jasdb.test.SortAndLimitQueryTest; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class RestSortAndLimitQueryTest extends SortAndLimitQueryTest { 9 | public RestSortAndLimitQueryTest() { 10 | super(new TestRestDBSessionFactory()); 11 | } 12 | 13 | @Override 14 | public void tearDown() throws Exception { 15 | super.tearDown(); 16 | System.setProperty("jasdb-config", ""); 17 | } 18 | 19 | @Override 20 | public void setUp() throws Exception { 21 | System.setProperty("jasdb-config", "jasdb-rest.xml"); 22 | 23 | super.setUp(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/java/com/oberasoftware/jasdb/integration/rest/RestTableScanQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.integration.rest; 2 | 3 | import com.oberasoftware.jasdb.test.TableScanQueryTest; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class RestTableScanQueryTest extends TableScanQueryTest { 9 | public RestTableScanQueryTest() { 10 | super(new TestRestDBSessionFactory()); 11 | } 12 | 13 | @Override 14 | public void tearDown() throws Exception { 15 | super.tearDown(); 16 | System.setProperty("jasdb-config", ""); 17 | } 18 | 19 | @Override 20 | public void setUp() throws Exception { 21 | System.setProperty("jasdb-config", "jasdb-rest.xml"); 22 | super.setUp(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /testing/jasdb-integration-test/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /testing/jasdb_ent_integration/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /testing/jasdb_ent_integration/src/test/java/com/obera/jasdb/local/LocalUserAdministrationTest.java: -------------------------------------------------------------------------------- 1 | package com.obera.jasdb.local; 2 | 3 | import com.obera.jasdb.UserAdministrationTest; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class LocalUserAdministrationTest extends UserAdministrationTest { 9 | public LocalUserAdministrationTest() { 10 | super(new OverrideSecureSessionFactory()); 11 | } 12 | 13 | @Override 14 | public void tearDown() throws Exception { 15 | System.setProperty("jasdb-config", ""); 16 | super.tearDown(); 17 | } 18 | 19 | @Override 20 | public void setUp() throws Exception { 21 | System.setProperty("jasdb-config", "jasdb-local-withsecurity.xml"); 22 | super.setUp(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /testing/jasdb_ent_integration/src/test/java/com/obera/jasdb/local/SecureLocalEntityBagTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The JASDB software and code is Copyright protected 2012 and owned by Renze de Vries 3 | * 4 | * All the code and design principals in the codebase are also Copyright 2012 5 | * protected and owned Renze de Vries. Any unauthorized usage of the code or the 6 | * design and principals as in this code is prohibited. 7 | */ 8 | package com.obera.jasdb.local; 9 | 10 | import com.oberasoftware.jasdb.engine.EntityBagTest; 11 | 12 | /** 13 | * @author Renze de Vries 14 | */ 15 | public class SecureLocalEntityBagTest extends EntityBagTest { 16 | public SecureLocalEntityBagTest() { 17 | super(new OverrideSecureSessionFactory()); 18 | } 19 | 20 | @Override 21 | public void tearDown() throws Exception { 22 | System.setProperty("jasdb-config", ""); 23 | super.tearDown(); 24 | } 25 | 26 | @Override 27 | public void setUp() throws Exception { 28 | System.setProperty("jasdb-config", "jasdb-local-withsecurity.xml"); 29 | super.setUp(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /testing/jasdb_ent_integration/src/test/java/com/obera/jasdb/local/SecureLocalQueryTest.java: -------------------------------------------------------------------------------- 1 | package com.obera.jasdb.local; 2 | 3 | import com.oberasoftware.jasdb.engine.EntityQueryTest; 4 | 5 | /** 6 | * @author Renze de Vries 7 | */ 8 | public class SecureLocalQueryTest extends EntityQueryTest { 9 | public SecureLocalQueryTest() { 10 | super(new OverrideSecureSessionFactory()); 11 | } 12 | 13 | @Override 14 | public void tearDown() throws Exception { 15 | System.setProperty("jasdb-config", ""); 16 | super.tearDown(); 17 | } 18 | 19 | @Override 20 | public void setUp() throws Exception { 21 | System.setProperty("jasdb-config", "jasdb-local-withsecurity.xml"); 22 | super.setUp(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /testing/jasdb_ent_integration/src/test/resources/keystore.ks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oberasoftware/jasdb/74f9364373b178fe2897b75e90d2d6fd08380191/testing/jasdb_ent_integration/src/test/resources/keystore.ks -------------------------------------------------------------------------------- /testing/jasdb_ent_integration/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ${log.pattern} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /testing/jasdb_testframework/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | jasdb 6 | com.oberasoftware 7 | 2.0-SNAPSHOT 8 | ../../pom.xml 9 | 10 | 11 | jasdb_testframework 12 | jasdb_testframework 13 | 14 | 15 | 16 | ${project.groupId} 17 | jasdb-service 18 | 19 | 20 | junit 21 | junit 22 | compile 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /testing/jasdb_testframework/src/main/java/com/oberasoftware/jasdb/test/SimpleBaseTest.java: -------------------------------------------------------------------------------- 1 | package com.oberasoftware.jasdb.test; 2 | 3 | public class SimpleBaseTest { 4 | static final String[] possibleCities = new String[] {"Amsterdam", "Rotterdam", "Utrecht", "Groningen", "Maastricht", "Breda", "Eindhoven", "Leiden", "Den Haag", "Haarlem"}; 5 | } 6 | --------------------------------------------------------------------------------