├── .gitignore
├── README.md
├── _base
├── base-build.xml
├── ide
│ └── eclipse-formatter.xml
├── images
│ └── orient_db.png
└── lib
│ └── UmlGraph.jar
├── build.bat
├── build.number
├── build.sh
├── client
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── orientechnologies
│ │ └── orient
│ │ └── client
│ │ ├── db
│ │ └── ODatabaseHelper.java
│ │ └── remote
│ │ ├── OClusterRemote.java
│ │ ├── OEngineRemote.java
│ │ ├── ONetworkConnectionPool.java
│ │ ├── OServerAdmin.java
│ │ ├── OStorageRemote.java
│ │ ├── OStorageRemoteAsynchEventListener.java
│ │ ├── OStorageRemoteThread.java
│ │ └── OStorageRemoteThreadLocal.java
│ └── resources
│ └── META-INF
│ └── MANIFEST.MF
├── commons
├── lib
│ └── testng-5.10-jdk15.jar
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── com
│ │ └── orientechnologies
│ │ └── common
│ │ ├── collection
│ │ ├── AbstractEntryIterator.java
│ │ ├── OAlwaysGreaterKey.java
│ │ ├── OAlwaysLessKey.java
│ │ ├── OCompositeKey.java
│ │ ├── OIdentityHashSet.java
│ │ ├── OIterableObjectArray.java
│ │ ├── OLazyIterator.java
│ │ ├── OLazyIteratorListWrapper.java
│ │ ├── OMVRBTree.java
│ │ ├── OMVRBTreeEntry.java
│ │ ├── OMVRBTreeEntryMemory.java
│ │ ├── OMVRBTreeEntryPosition.java
│ │ ├── OMVRBTreeMemory.java
│ │ ├── OMVRBTreeSet.java
│ │ ├── OMultiValue.java
│ │ ├── ONavigableMap.java
│ │ ├── ONavigableSet.java
│ │ └── OSimpleImmutableEntry.java
│ │ ├── comparator
│ │ ├── OByteArrayComparator.java
│ │ ├── OComparatorFactory.java
│ │ ├── ODefaultComparator.java
│ │ └── OUnsafeByteArrayComparator.java
│ │ ├── concur
│ │ ├── ONeedRetryException.java
│ │ ├── OTimeoutException.java
│ │ ├── lock
│ │ │ ├── OLockException.java
│ │ │ ├── OLockManager.java
│ │ │ ├── OModificationLock.java
│ │ │ ├── OModificationOperationProhibitedException.java
│ │ │ └── OSharedLockEntry.java
│ │ └── resource
│ │ │ ├── OCloseable.java
│ │ │ ├── ONotSharedResource.java
│ │ │ ├── OResourcePool.java
│ │ │ ├── OResourcePoolListener.java
│ │ │ ├── OSharedContainer.java
│ │ │ ├── OSharedContainerImpl.java
│ │ │ ├── OSharedResource.java
│ │ │ ├── OSharedResourceAbstract.java
│ │ │ ├── OSharedResourceAdaptive.java
│ │ │ ├── OSharedResourceAdaptiveExternal.java
│ │ │ ├── OSharedResourceExternal.java
│ │ │ ├── OSharedResourceExternalTimeout.java
│ │ │ └── OSharedResourceTimeout.java
│ │ ├── console
│ │ ├── DefaultConsoleReader.java
│ │ ├── OConsoleApplication.java
│ │ ├── OConsoleCommandCollection.java
│ │ ├── OConsoleReader.java
│ │ ├── TTYConsoleReader.java
│ │ └── annotation
│ │ │ ├── ConsoleCommand.java
│ │ │ └── ConsoleParameter.java
│ │ ├── exception
│ │ └── OException.java
│ │ ├── factory
│ │ ├── ODynamicFactory.java
│ │ └── ODynamicFactoryInverse.java
│ │ ├── io
│ │ ├── OFileUtils.java
│ │ ├── OIOException.java
│ │ └── OIOUtils.java
│ │ ├── listener
│ │ └── OProgressListener.java
│ │ ├── log
│ │ ├── OLogFormatter.java
│ │ └── OLogManager.java
│ │ ├── parser
│ │ ├── OBaseParser.java
│ │ ├── OStringForwardReader.java
│ │ ├── OStringParser.java
│ │ ├── OSystemVariableResolver.java
│ │ ├── OVariableParser.java
│ │ └── OVariableParserListener.java
│ │ ├── profiler
│ │ ├── OProfiler.java
│ │ └── OProfilerMBean.java
│ │ ├── reflection
│ │ └── OReflectionHelper.java
│ │ ├── synch
│ │ └── OSynchEventAdapter.java
│ │ ├── thread
│ │ ├── OPollerThread.java
│ │ └── OSoftThread.java
│ │ ├── types
│ │ ├── OBinary.java
│ │ ├── OModifiableInteger.java
│ │ └── ORef.java
│ │ └── util
│ │ ├── OArrays.java
│ │ ├── OByteBufferUtils.java
│ │ ├── OCallable.java
│ │ ├── OCaseIncentiveComparator.java
│ │ ├── OClassLoaderHelper.java
│ │ ├── OCollections.java
│ │ ├── OMultiKey.java
│ │ ├── OPair.java
│ │ ├── OService.java
│ │ └── OTriple.java
│ └── test
│ └── java
│ └── com
│ └── orientechnologies
│ └── common
│ ├── collection
│ └── OCompositeKeyTest.java
│ ├── comparator
│ └── UnsafeComparatorTest.java
│ ├── test
│ ├── SpeedTest.java
│ ├── SpeedTestAbstract.java
│ ├── SpeedTestData.java
│ ├── SpeedTestGroup.java
│ ├── SpeedTestMonoThread.java
│ ├── SpeedTestMultiThreads.java
│ └── SpeedTestThread.java
│ └── util
│ └── OMultiKeyTest.java
├── core
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── orientechnologies
│ │ │ └── orient
│ │ │ └── core
│ │ │ ├── OConstants.java
│ │ │ ├── OOrientListener.java
│ │ │ ├── Orient.java
│ │ │ ├── OrientShutdownHook.java
│ │ │ ├── annotation
│ │ │ ├── OAccess.java
│ │ │ ├── OAfterDeserialization.java
│ │ │ ├── OAfterSerialization.java
│ │ │ ├── OBeforeDeserialization.java
│ │ │ ├── OBeforeSerialization.java
│ │ │ ├── ODocumentInstance.java
│ │ │ ├── OId.java
│ │ │ └── OVersion.java
│ │ │ ├── cache
│ │ │ ├── OAbstractRecordCache.java
│ │ │ ├── OCache.java
│ │ │ ├── OCacheLocator.java
│ │ │ ├── ODefaultCache.java
│ │ │ ├── OLevel1RecordCache.java
│ │ │ └── OLevel2RecordCache.java
│ │ │ ├── command
│ │ │ ├── OBasicCommandContext.java
│ │ │ ├── OCommand.java
│ │ │ ├── OCommandContext.java
│ │ │ ├── OCommandDistributedConditionalReplicateRequest.java
│ │ │ ├── OCommandDistributedReplicateRequest.java
│ │ │ ├── OCommandExecutor.java
│ │ │ ├── OCommandExecutorAbstract.java
│ │ │ ├── OCommandGenericIterator.java
│ │ │ ├── OCommandManager.java
│ │ │ ├── OCommandOutputListener.java
│ │ │ ├── OCommandPredicate.java
│ │ │ ├── OCommandProcess.java
│ │ │ ├── OCommandRequest.java
│ │ │ ├── OCommandRequestAbstract.java
│ │ │ ├── OCommandRequestAsynch.java
│ │ │ ├── OCommandRequestInternal.java
│ │ │ ├── OCommandRequestText.java
│ │ │ ├── OCommandRequestTextAbstract.java
│ │ │ ├── OCommandResultListener.java
│ │ │ ├── script
│ │ │ │ ├── OCommandScript.java
│ │ │ │ └── OCommandScriptException.java
│ │ │ └── traverse
│ │ │ │ ├── OTraverse.java
│ │ │ │ ├── OTraverseAbstractProcess.java
│ │ │ │ ├── OTraverseContext.java
│ │ │ │ ├── OTraverseFieldProcess.java
│ │ │ │ ├── OTraverseMultiValueProcess.java
│ │ │ │ ├── OTraverseRecordProcess.java
│ │ │ │ └── OTraverseRecordSetProcess.java
│ │ │ ├── config
│ │ │ ├── OAbstractStorageClusterConfiguration.java
│ │ │ ├── OConfigurationChangeCallback.java
│ │ │ ├── OContextConfiguration.java
│ │ │ ├── OGlobalConfiguration.java
│ │ │ ├── OStorageClusterConfiguration.java
│ │ │ ├── OStorageClusterHoleConfiguration.java
│ │ │ ├── OStorageConfiguration.java
│ │ │ ├── OStorageDataConfiguration.java
│ │ │ ├── OStorageDataHoleConfiguration.java
│ │ │ ├── OStorageEntryConfiguration.java
│ │ │ ├── OStorageFileConfiguration.java
│ │ │ ├── OStorageMemoryClusterConfiguration.java
│ │ │ ├── OStoragePhysicalClusterConfiguration.java
│ │ │ ├── OStorageSegmentConfiguration.java
│ │ │ └── OStorageTxConfiguration.java
│ │ │ ├── db
│ │ │ ├── ODataSegmentStrategy.java
│ │ │ ├── ODatabase.java
│ │ │ ├── ODatabaseComplex.java
│ │ │ ├── ODatabaseFactory.java
│ │ │ ├── ODatabaseLifecycleListener.java
│ │ │ ├── ODatabaseListener.java
│ │ │ ├── ODatabasePoolAbstract.java
│ │ │ ├── ODatabasePoolBase.java
│ │ │ ├── ODatabasePoolEntry.java
│ │ │ ├── ODatabasePooled.java
│ │ │ ├── ODatabaseRecordThreadLocal.java
│ │ │ ├── ODatabaseRecordWrapperAbstract.java
│ │ │ ├── ODatabaseSchemaAware.java
│ │ │ ├── ODatabaseWrapperAbstract.java
│ │ │ ├── ODefaultDataSegmentStrategy.java
│ │ │ ├── OUserObject2RecordHandler.java
│ │ │ ├── document
│ │ │ │ ├── ODatabaseDocument.java
│ │ │ │ ├── ODatabaseDocumentPool.java
│ │ │ │ ├── ODatabaseDocumentTx.java
│ │ │ │ └── ODatabaseDocumentTxPooled.java
│ │ │ ├── graph
│ │ │ │ ├── OGraphDatabase.java
│ │ │ │ ├── OGraphDatabaseMigration.java
│ │ │ │ ├── OGraphDatabasePool.java
│ │ │ │ └── OGraphDatabasePooled.java
│ │ │ ├── object
│ │ │ │ ├── ODatabaseObject.java
│ │ │ │ ├── OLazyObjectListInterface.java
│ │ │ │ ├── OLazyObjectMapInterface.java
│ │ │ │ ├── OLazyObjectMultivalueElement.java
│ │ │ │ └── OLazyObjectSetInterface.java
│ │ │ ├── raw
│ │ │ │ └── ODatabaseRaw.java
│ │ │ ├── record
│ │ │ │ ├── ODatabaseBinary.java
│ │ │ │ ├── ODatabaseFlat.java
│ │ │ │ ├── ODatabaseRecord.java
│ │ │ │ ├── ODatabaseRecordAbstract.java
│ │ │ │ ├── ODatabaseRecordTx.java
│ │ │ │ ├── ODetachable.java
│ │ │ │ ├── OIdentifiable.java
│ │ │ │ ├── OLazyRecordIterator.java
│ │ │ │ ├── OLazyRecordMultiIterator.java
│ │ │ │ ├── OMultiValueChangeEvent.java
│ │ │ │ ├── OMultiValueChangeListener.java
│ │ │ │ ├── OMultiValueChangeTimeLine.java
│ │ │ │ ├── OProxedResource.java
│ │ │ │ ├── ORecordElement.java
│ │ │ │ ├── ORecordLazyList.java
│ │ │ │ ├── ORecordLazyListener.java
│ │ │ │ ├── ORecordLazyMap.java
│ │ │ │ ├── ORecordLazyMultiValue.java
│ │ │ │ ├── ORecordLazySet.java
│ │ │ │ ├── ORecordMultiValueHelper.java
│ │ │ │ ├── ORecordOperation.java
│ │ │ │ ├── ORecordTrackedIterator.java
│ │ │ │ ├── ORecordTrackedList.java
│ │ │ │ ├── ORecordTrackedSet.java
│ │ │ │ ├── OTrackedList.java
│ │ │ │ ├── OTrackedMap.java
│ │ │ │ ├── OTrackedMultiValue.java
│ │ │ │ └── OTrackedSet.java
│ │ │ └── tool
│ │ │ │ ├── ODatabaseCompare.java
│ │ │ │ ├── ODatabaseExport.java
│ │ │ │ ├── ODatabaseExportException.java
│ │ │ │ ├── ODatabaseImpExpAbstract.java
│ │ │ │ ├── ODatabaseImport.java
│ │ │ │ └── ODatabaseImportException.java
│ │ │ ├── dictionary
│ │ │ └── ODictionary.java
│ │ │ ├── engine
│ │ │ ├── OEngine.java
│ │ │ ├── OEngineAbstract.java
│ │ │ ├── local
│ │ │ │ └── OEngineLocal.java
│ │ │ └── memory
│ │ │ │ └── OEngineMemory.java
│ │ │ ├── entity
│ │ │ ├── OClassDictionary.java
│ │ │ ├── OEntityManager.java
│ │ │ ├── OEntityManagerClassHandler.java
│ │ │ └── OEntityManagerInternal.java
│ │ │ ├── exception
│ │ │ ├── OCommandExecutionException.java
│ │ │ ├── OConcurrentModificationException.java
│ │ │ ├── OConfigurationException.java
│ │ │ ├── ODatabaseException.java
│ │ │ ├── OFetchException.java
│ │ │ ├── OGraphException.java
│ │ │ ├── OMemoryLockException.java
│ │ │ ├── OQueryParsingException.java
│ │ │ ├── ORecordNotFoundException.java
│ │ │ ├── OSchemaException.java
│ │ │ ├── OSecurityAccessException.java
│ │ │ ├── OSecurityException.java
│ │ │ ├── OSerializationException.java
│ │ │ ├── OStorageException.java
│ │ │ ├── OTransactionAbortedException.java
│ │ │ ├── OTransactionBlockedException.java
│ │ │ ├── OTransactionException.java
│ │ │ └── OValidationException.java
│ │ │ ├── fetch
│ │ │ ├── OFetchContext.java
│ │ │ ├── OFetchHelper.java
│ │ │ ├── OFetchListener.java
│ │ │ ├── json
│ │ │ │ ├── OJSONFetchContext.java
│ │ │ │ └── OJSONFetchListener.java
│ │ │ └── remote
│ │ │ │ ├── ORemoteFetchContext.java
│ │ │ │ └── ORemoteFetchListener.java
│ │ │ ├── hook
│ │ │ ├── ODocumentHookAbstract.java
│ │ │ ├── OHookThreadLocal.java
│ │ │ ├── ORecordHook.java
│ │ │ └── ORecordHookAbstract.java
│ │ │ ├── id
│ │ │ ├── ORID.java
│ │ │ └── ORecordId.java
│ │ │ ├── index
│ │ │ ├── OAbstractIndexDefinitionMultiValue.java
│ │ │ ├── OClassIndexManager.java
│ │ │ ├── OCompositeIndexDefinition.java
│ │ │ ├── ODocumentFieldsHashSet.java
│ │ │ ├── OIndex.java
│ │ │ ├── OIndexAbstractDelegate.java
│ │ │ ├── OIndexCallback.java
│ │ │ ├── OIndexDefinition.java
│ │ │ ├── OIndexDefinitionFactory.java
│ │ │ ├── OIndexDefinitionMultiValue.java
│ │ │ ├── OIndexDictionary.java
│ │ │ ├── OIndexException.java
│ │ │ ├── OIndexFactory.java
│ │ │ ├── OIndexFullText.java
│ │ │ ├── OIndexInternal.java
│ │ │ ├── OIndexMVRBTreeAbstract.java
│ │ │ ├── OIndexManager.java
│ │ │ ├── OIndexManagerAbstract.java
│ │ │ ├── OIndexManagerProxy.java
│ │ │ ├── OIndexManagerRemote.java
│ │ │ ├── OIndexManagerShared.java
│ │ │ ├── OIndexMultiValues.java
│ │ │ ├── OIndexNotUnique.java
│ │ │ ├── OIndexOneValue.java
│ │ │ ├── OIndexRemote.java
│ │ │ ├── OIndexRemoteMultiValue.java
│ │ │ ├── OIndexRemoteOneValue.java
│ │ │ ├── OIndexTxAware.java
│ │ │ ├── OIndexTxAwareDictionary.java
│ │ │ ├── OIndexTxAwareMultiValue.java
│ │ │ ├── OIndexTxAwareOneValue.java
│ │ │ ├── OIndexUnique.java
│ │ │ ├── OIndexes.java
│ │ │ ├── OMVRBIndexFactory.java
│ │ │ ├── OPropertyIndexDefinition.java
│ │ │ ├── OPropertyListIndexDefinition.java
│ │ │ ├── OPropertyMapIndexDefinition.java
│ │ │ ├── ORuntimeKeyIndexDefinition.java
│ │ │ └── OSimpleKeyIndexDefinition.java
│ │ │ ├── intent
│ │ │ ├── OIntent.java
│ │ │ ├── OIntentMassiveInsert.java
│ │ │ └── OIntentMassiveRead.java
│ │ │ ├── iterator
│ │ │ ├── OEmptyIterator.java
│ │ │ ├── OIdentifiableIterator.java
│ │ │ ├── OIterationException.java
│ │ │ ├── ORecordIteratorClass.java
│ │ │ ├── ORecordIteratorCluster.java
│ │ │ ├── ORecordIteratorClusters.java
│ │ │ └── object
│ │ │ │ ├── OObjectIteratorClassInterface.java
│ │ │ │ └── OObjectIteratorClusterInterface.java
│ │ │ ├── memory
│ │ │ ├── OLowMemoryException.java
│ │ │ └── OMemoryWatchDog.java
│ │ │ ├── metadata
│ │ │ ├── OMetadata.java
│ │ │ ├── schema
│ │ │ │ ├── OClass.java
│ │ │ │ ├── OClassImpl.java
│ │ │ │ ├── OProperty.java
│ │ │ │ ├── OPropertyImpl.java
│ │ │ │ ├── OSchema.java
│ │ │ │ ├── OSchemaProxy.java
│ │ │ │ ├── OSchemaShared.java
│ │ │ │ └── OType.java
│ │ │ └── security
│ │ │ │ ├── ODatabaseSecurityResources.java
│ │ │ │ ├── ORole.java
│ │ │ │ ├── OSecurity.java
│ │ │ │ ├── OSecurityNull.java
│ │ │ │ ├── OSecurityProxy.java
│ │ │ │ ├── OSecurityShared.java
│ │ │ │ ├── OUser.java
│ │ │ │ └── OUserTrigger.java
│ │ │ ├── package.html
│ │ │ ├── query
│ │ │ ├── OQuery.java
│ │ │ ├── OQueryAbstract.java
│ │ │ ├── OQueryContext.java
│ │ │ ├── OQueryHelper.java
│ │ │ ├── OQueryRuntimeValueMulti.java
│ │ │ └── nativ
│ │ │ │ ├── ONativeAsynchQuery.java
│ │ │ │ ├── ONativeQuery.java
│ │ │ │ ├── ONativeSynchQuery.java
│ │ │ │ ├── OQueryContextNative.java
│ │ │ │ └── OQueryContextNativeSchema.java
│ │ │ ├── record
│ │ │ ├── ORecord.java
│ │ │ ├── ORecordAbstract.java
│ │ │ ├── ORecordFactoryManager.java
│ │ │ ├── ORecordInternal.java
│ │ │ ├── ORecordListener.java
│ │ │ ├── ORecordPositional.java
│ │ │ ├── ORecordSchemaAware.java
│ │ │ ├── ORecordSchemaAwareAbstract.java
│ │ │ ├── ORecordStringable.java
│ │ │ └── impl
│ │ │ │ ├── ODocument.java
│ │ │ │ ├── ODocumentComparator.java
│ │ │ │ ├── ODocumentHelper.java
│ │ │ │ ├── ORecordBytes.java
│ │ │ │ ├── ORecordBytesLazy.java
│ │ │ │ └── ORecordFlat.java
│ │ │ ├── security
│ │ │ └── OSecurityManager.java
│ │ │ ├── serialization
│ │ │ ├── OBase64Utils.java
│ │ │ ├── OBinaryProtocol.java
│ │ │ ├── OMemoryInputStream.java
│ │ │ ├── OMemoryStream.java
│ │ │ ├── OSerializableStream.java
│ │ │ └── serializer
│ │ │ │ ├── OJSONReader.java
│ │ │ │ ├── OJSONWriter.java
│ │ │ │ ├── OStringSerializerHelper.java
│ │ │ │ ├── binary
│ │ │ │ ├── OBinarySerializer.java
│ │ │ │ ├── OBinarySerializerFactory.java
│ │ │ │ └── impl
│ │ │ │ │ ├── OBinaryTypeSerializer.java
│ │ │ │ │ ├── OBooleanSerializer.java
│ │ │ │ │ ├── OByteSerializer.java
│ │ │ │ │ ├── OCharSerializer.java
│ │ │ │ │ ├── ODateSerializer.java
│ │ │ │ │ ├── ODateTimeSerializer.java
│ │ │ │ │ ├── ODecimalSerializer.java
│ │ │ │ │ ├── ODoubleSerializer.java
│ │ │ │ │ ├── OFloatSerializer.java
│ │ │ │ │ ├── OIntegerSerializer.java
│ │ │ │ │ ├── OLinkSerializer.java
│ │ │ │ │ ├── OLongSerializer.java
│ │ │ │ │ ├── ONullSerializer.java
│ │ │ │ │ ├── OShortSerializer.java
│ │ │ │ │ ├── OStringSerializer.java
│ │ │ │ │ └── index
│ │ │ │ │ ├── OCompositeKeySerializer.java
│ │ │ │ │ └── OSimpleKeySerializer.java
│ │ │ │ ├── object
│ │ │ │ ├── OObjectSerializer.java
│ │ │ │ ├── OObjectSerializerHelperDocument.java
│ │ │ │ ├── OObjectSerializerHelperInterface.java
│ │ │ │ └── OObjectSerializerHelperManager.java
│ │ │ │ ├── record
│ │ │ │ ├── ORecordSerializer.java
│ │ │ │ ├── ORecordSerializerFactory.java
│ │ │ │ ├── ORecordSerializerRaw.java
│ │ │ │ ├── OSerializableRecordPositional.java
│ │ │ │ ├── OSerializationThreadLocal.java
│ │ │ │ └── string
│ │ │ │ │ ├── ORecordSerializerCSVAbstract.java
│ │ │ │ │ ├── ORecordSerializerDocument2Binary.java
│ │ │ │ │ ├── ORecordSerializerJSON.java
│ │ │ │ │ ├── ORecordSerializerSchemaAware2CSV.java
│ │ │ │ │ └── ORecordSerializerStringAbstract.java
│ │ │ │ ├── stream
│ │ │ │ ├── OStreamSerializer.java
│ │ │ │ ├── OStreamSerializerAnyRecord.java
│ │ │ │ ├── OStreamSerializerAnyRuntime.java
│ │ │ │ ├── OStreamSerializerAnyStatic.java
│ │ │ │ ├── OStreamSerializerAnyStreamable.java
│ │ │ │ ├── OStreamSerializerFactory.java
│ │ │ │ ├── OStreamSerializerHelper.java
│ │ │ │ ├── OStreamSerializerInteger.java
│ │ │ │ ├── OStreamSerializerListRID.java
│ │ │ │ ├── OStreamSerializerLiteral.java
│ │ │ │ ├── OStreamSerializerLong.java
│ │ │ │ ├── OStreamSerializerRID.java
│ │ │ │ ├── OStreamSerializerRecord.java
│ │ │ │ └── OStreamSerializerString.java
│ │ │ │ └── string
│ │ │ │ ├── OStringBuilderSerializable.java
│ │ │ │ ├── OStringSerializer.java
│ │ │ │ ├── OStringSerializerAnyRuntime.java
│ │ │ │ ├── OStringSerializerAnyStreamable.java
│ │ │ │ └── OStringSerializerEmbedded.java
│ │ │ ├── sql
│ │ │ ├── OCommandExecutorSQLAbstract.java
│ │ │ ├── OCommandExecutorSQLAlterClass.java
│ │ │ ├── OCommandExecutorSQLAlterCluster.java
│ │ │ ├── OCommandExecutorSQLAlterDatabase.java
│ │ │ ├── OCommandExecutorSQLAlterProperty.java
│ │ │ ├── OCommandExecutorSQLCreateClass.java
│ │ │ ├── OCommandExecutorSQLCreateEdge.java
│ │ │ ├── OCommandExecutorSQLCreateIndex.java
│ │ │ ├── OCommandExecutorSQLCreateLink.java
│ │ │ ├── OCommandExecutorSQLCreateProperty.java
│ │ │ ├── OCommandExecutorSQLCreateVertex.java
│ │ │ ├── OCommandExecutorSQLDelegate.java
│ │ │ ├── OCommandExecutorSQLDelete.java
│ │ │ ├── OCommandExecutorSQLDropClass.java
│ │ │ ├── OCommandExecutorSQLDropCluster.java
│ │ │ ├── OCommandExecutorSQLDropIndex.java
│ │ │ ├── OCommandExecutorSQLDropProperty.java
│ │ │ ├── OCommandExecutorSQLEarlyResultsetAbstract.java
│ │ │ ├── OCommandExecutorSQLFactory.java
│ │ │ ├── OCommandExecutorSQLFindReferences.java
│ │ │ ├── OCommandExecutorSQLGrant.java
│ │ │ ├── OCommandExecutorSQLInsert.java
│ │ │ ├── OCommandExecutorSQLPermissionAbstract.java
│ │ │ ├── OCommandExecutorSQLRebuildIndex.java
│ │ │ ├── OCommandExecutorSQLResultsetAbstract.java
│ │ │ ├── OCommandExecutorSQLResultsetDelegate.java
│ │ │ ├── OCommandExecutorSQLRevoke.java
│ │ │ ├── OCommandExecutorSQLSelect.java
│ │ │ ├── OCommandExecutorSQLSetAware.java
│ │ │ ├── OCommandExecutorSQLTraverse.java
│ │ │ ├── OCommandExecutorSQLTruncateClass.java
│ │ │ ├── OCommandExecutorSQLTruncateCluster.java
│ │ │ ├── OCommandExecutorSQLTruncateRecord.java
│ │ │ ├── OCommandExecutorSQLUpdate.java
│ │ │ ├── OCommandParameters.java
│ │ │ ├── OCommandSQL.java
│ │ │ ├── OCommandSQLParsingException.java
│ │ │ ├── OCommandSQLResultset.java
│ │ │ ├── ODefaultCommandExecutorSQLFactory.java
│ │ │ ├── ODynamicSQLElementFactory.java
│ │ │ ├── OFindReferenceHelper.java
│ │ │ ├── OIndexProxy.java
│ │ │ ├── OIndexSearchResult.java
│ │ │ ├── OSQLEngine.java
│ │ │ ├── OSQLHelper.java
│ │ │ ├── filter
│ │ │ │ ├── OSQLFilter.java
│ │ │ │ ├── OSQLFilterCondition.java
│ │ │ │ ├── OSQLFilterFieldOperator.java
│ │ │ │ ├── OSQLFilterItem.java
│ │ │ │ ├── OSQLFilterItemAbstract.java
│ │ │ │ ├── OSQLFilterItemField.java
│ │ │ │ ├── OSQLFilterItemFieldAll.java
│ │ │ │ ├── OSQLFilterItemFieldAny.java
│ │ │ │ ├── OSQLFilterItemFieldMultiAbstract.java
│ │ │ │ ├── OSQLFilterItemParameter.java
│ │ │ │ ├── OSQLFilterItemVariable.java
│ │ │ │ └── OSQLPredicate.java
│ │ │ ├── functions
│ │ │ │ ├── ODefaultSQLFunctionFactory.java
│ │ │ │ ├── OSQLFunction.java
│ │ │ │ ├── OSQLFunctionAbstract.java
│ │ │ │ ├── OSQLFunctionFactory.java
│ │ │ │ ├── OSQLFunctionRuntime.java
│ │ │ │ ├── coll
│ │ │ │ │ ├── OSQLFunctionCollAbstract.java
│ │ │ │ │ ├── OSQLFunctionDifference.java
│ │ │ │ │ ├── OSQLFunctionDistinct.java
│ │ │ │ │ ├── OSQLFunctionIntersect.java
│ │ │ │ │ └── OSQLFunctionUnion.java
│ │ │ │ ├── geo
│ │ │ │ │ └── OSQLFunctionDistance.java
│ │ │ │ ├── math
│ │ │ │ │ ├── OSQLFunctionAverage.java
│ │ │ │ │ ├── OSQLFunctionMathAbstract.java
│ │ │ │ │ ├── OSQLFunctionMax.java
│ │ │ │ │ ├── OSQLFunctionMin.java
│ │ │ │ │ └── OSQLFunctionSum.java
│ │ │ │ └── misc
│ │ │ │ │ ├── OSQLFunctionCount.java
│ │ │ │ │ ├── OSQLFunctionDate.java
│ │ │ │ │ ├── OSQLFunctionFormat.java
│ │ │ │ │ └── OSQLFunctionSysdate.java
│ │ │ ├── operator
│ │ │ │ ├── ODefaultQueryOperatorFactory.java
│ │ │ │ ├── OIndexReuseType.java
│ │ │ │ ├── OQueryOperator.java
│ │ │ │ ├── OQueryOperatorAnd.java
│ │ │ │ ├── OQueryOperatorBetween.java
│ │ │ │ ├── OQueryOperatorContains.java
│ │ │ │ ├── OQueryOperatorContainsAll.java
│ │ │ │ ├── OQueryOperatorContainsKey.java
│ │ │ │ ├── OQueryOperatorContainsText.java
│ │ │ │ ├── OQueryOperatorContainsValue.java
│ │ │ │ ├── OQueryOperatorEquality.java
│ │ │ │ ├── OQueryOperatorEqualityNotNulls.java
│ │ │ │ ├── OQueryOperatorEquals.java
│ │ │ │ ├── OQueryOperatorFactory.java
│ │ │ │ ├── OQueryOperatorIn.java
│ │ │ │ ├── OQueryOperatorInstanceof.java
│ │ │ │ ├── OQueryOperatorIs.java
│ │ │ │ ├── OQueryOperatorLike.java
│ │ │ │ ├── OQueryOperatorMajor.java
│ │ │ │ ├── OQueryOperatorMajorEquals.java
│ │ │ │ ├── OQueryOperatorMatches.java
│ │ │ │ ├── OQueryOperatorMinor.java
│ │ │ │ ├── OQueryOperatorMinorEquals.java
│ │ │ │ ├── OQueryOperatorNot.java
│ │ │ │ ├── OQueryOperatorNotEquals.java
│ │ │ │ ├── OQueryOperatorOr.java
│ │ │ │ ├── OQueryOperatorTraverse.java
│ │ │ │ ├── OQueryTargetOperator.java
│ │ │ │ └── math
│ │ │ │ │ ├── OQueryOperatorDivide.java
│ │ │ │ │ ├── OQueryOperatorMinus.java
│ │ │ │ │ ├── OQueryOperatorMod.java
│ │ │ │ │ ├── OQueryOperatorMultiply.java
│ │ │ │ │ └── OQueryOperatorPlus.java
│ │ │ └── query
│ │ │ │ ├── OSQLAsynchQuery.java
│ │ │ │ ├── OSQLQuery.java
│ │ │ │ └── OSQLSynchQuery.java
│ │ │ ├── storage
│ │ │ ├── OCluster.java
│ │ │ ├── OClusterFactory.java
│ │ │ ├── OClusterPositionIterator.java
│ │ │ ├── ODataSegment.java
│ │ │ ├── ODefaultClusterFactory.java
│ │ │ ├── OPhysicalPosition.java
│ │ │ ├── ORawBuffer.java
│ │ │ ├── ORecordCallback.java
│ │ │ ├── ORecordLockManager.java
│ │ │ ├── OStorage.java
│ │ │ ├── OStorageAbstract.java
│ │ │ ├── OStorageEmbedded.java
│ │ │ ├── OStorageProxy.java
│ │ │ ├── fs
│ │ │ │ ├── OAbstractFile.java
│ │ │ │ ├── OFile.java
│ │ │ │ ├── OFileClassic.java
│ │ │ │ ├── OFileFactory.java
│ │ │ │ ├── OFileMMap.java
│ │ │ │ ├── OMMapBufferEntry.java
│ │ │ │ ├── OMMapManager.java
│ │ │ │ ├── OMMapManagerAbstract.java
│ │ │ │ ├── OMMapManagerLocator.java
│ │ │ │ ├── OMMapManagerNew.java
│ │ │ │ └── OMMapManagerOld.java
│ │ │ ├── impl
│ │ │ │ ├── local
│ │ │ │ │ ├── OClusterLocal.java
│ │ │ │ │ ├── OClusterLocalHole.java
│ │ │ │ │ ├── ODataHoleInfo.java
│ │ │ │ │ ├── ODataLocal.java
│ │ │ │ │ ├── ODataLocalHole.java
│ │ │ │ │ ├── OMultiFileSegment.java
│ │ │ │ │ ├── OSegment.java
│ │ │ │ │ ├── OSingleFileSegment.java
│ │ │ │ │ ├── OStorageConfigurationSegment.java
│ │ │ │ │ ├── OStorageLocal.java
│ │ │ │ │ ├── OStorageLocalTxExecuter.java
│ │ │ │ │ ├── OStorageVariableParser.java
│ │ │ │ │ ├── OTxSegment.java
│ │ │ │ │ ├── TestSimulateError.java
│ │ │ │ │ └── package.html
│ │ │ │ └── memory
│ │ │ │ │ ├── OClusterMemory.java
│ │ │ │ │ ├── ODataSegmentMemory.java
│ │ │ │ │ └── OStorageMemory.java
│ │ │ └── package.html
│ │ │ ├── tx
│ │ │ ├── OTransaction.java
│ │ │ ├── OTransactionAbstract.java
│ │ │ ├── OTransactionIndexChanges.java
│ │ │ ├── OTransactionIndexChangesPerKey.java
│ │ │ ├── OTransactionNoTx.java
│ │ │ ├── OTransactionOptimistic.java
│ │ │ ├── OTransactionRealAbstract.java
│ │ │ └── OTxListener.java
│ │ │ └── type
│ │ │ ├── ODocumentWrapper.java
│ │ │ ├── ODocumentWrapperNoClass.java
│ │ │ └── tree
│ │ │ ├── OMVRBTreeDatabase.java
│ │ │ ├── OMVRBTreeDatabaseLazySave.java
│ │ │ ├── OMVRBTreeEntryPersistent.java
│ │ │ ├── OMVRBTreePersistent.java
│ │ │ ├── OMVRBTreeRID.java
│ │ │ ├── OMVRBTreeRIDSet.java
│ │ │ ├── OMVRBTreeStorage.java
│ │ │ └── provider
│ │ │ ├── OIdentityChangedListener.java
│ │ │ ├── OMVRBTreeEntryDataProvider.java
│ │ │ ├── OMVRBTreeEntryDataProviderAbstract.java
│ │ │ ├── OMVRBTreeMapEntryProvider.java
│ │ │ ├── OMVRBTreeMapProvider.java
│ │ │ ├── OMVRBTreeProvider.java
│ │ │ ├── OMVRBTreeProviderAbstract.java
│ │ │ ├── OMVRBTreeRIDEntryProvider.java
│ │ │ └── OMVRBTreeRIDProvider.java
│ └── resources
│ │ └── META-INF
│ │ ├── MANIFEST.MF
│ │ └── services
│ │ ├── com.orientechnologies.orient.core.index.OIndexFactory
│ │ ├── com.orientechnologies.orient.core.sql.OCommandExecutorSQLFactory
│ │ ├── com.orientechnologies.orient.core.sql.functions.OSQLFunctionFactory
│ │ └── com.orientechnologies.orient.core.sql.operator.OQueryOperatorFactory
│ └── test
│ └── java
│ └── com
│ └── orientechnologies
│ ├── common
│ ├── collection
│ │ ├── OMVRBTreeCompositeTest.java
│ │ └── OMVRBTreeNonCompositeTest.java
│ └── util
│ │ └── OByteBufferUtilsTest.java
│ └── orient
│ └── core
│ ├── cache
│ ├── ODefaultCacheCleanUpTest.java
│ └── ODefaultCacheTest.java
│ ├── db
│ └── record
│ │ ├── TrackedListTest.java
│ │ ├── TrackedMapTest.java
│ │ └── TrackedSetTest.java
│ ├── index
│ ├── OCompositeIndexDefinitionTest.java
│ ├── OPropertyIndexDefinitionTest.java
│ ├── OPropertyListIndexDefinitionTest.java
│ ├── OPropertyMapIndexDefinitionTest.java
│ └── OSimpleKeyIndexDefinitionTest.java
│ ├── record
│ └── impl
│ │ └── ORecordBytesTest.java
│ ├── serialization
│ └── serializer
│ │ └── binary
│ │ └── impl
│ │ ├── BinarySerializerTest.java
│ │ ├── BooleanSerializerTest.java
│ │ ├── ByteSerializerTest.java
│ │ ├── CharSerializerTest.java
│ │ ├── DateSerializerTest.java
│ │ ├── DateTimeSerializerTest.java
│ │ ├── DecimalSerializerTest.java
│ │ ├── DoubleSerializerTest.java
│ │ ├── FloatSerializerTest.java
│ │ ├── IntegerSerializerTest.java
│ │ ├── LinkSerializerTest.java
│ │ ├── LongSerializerTest.java
│ │ ├── ShortSerializerTest.java
│ │ └── StringSerializerTest.java
│ ├── sql
│ └── OOQueryOperatorTest.java
│ ├── storage
│ ├── StorageModificationLockTest.java
│ └── impl
│ │ └── local
│ │ └── OStorageLocalTest.java
│ └── type
│ └── tree
│ ├── OMVRBTreeDatabaseLazySaveCompositeTest.java
│ └── OMVRBTreeDatabaseLazySaveNonCompositeTest.java
├── distribution
├── pom.xml
└── src
│ └── main
│ └── assembly
│ └── bin.xml
├── doc
└── images
│ └── orientdb-android-logo.png
├── enterprise
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── orientechnologies
│ │ └── orient
│ │ └── enterprise
│ │ ├── channel
│ │ ├── OChannel.java
│ │ ├── binary
│ │ │ ├── OAsynchChannelServiceThread.java
│ │ │ ├── OChannelBinary.java
│ │ │ ├── OChannelBinaryAsynch.java
│ │ │ ├── OChannelBinaryClient.java
│ │ │ ├── OChannelBinaryClientSynch.java
│ │ │ ├── OChannelBinaryInputStream.java
│ │ │ ├── OChannelBinaryOutputStream.java
│ │ │ ├── OChannelBinaryProtocol.java
│ │ │ ├── OChannelBinaryServer.java
│ │ │ ├── ONetworkProtocolException.java
│ │ │ └── ORemoteServerEventListener.java
│ │ └── text
│ │ │ ├── OChannelText.java
│ │ │ └── OChannelTextServer.java
│ │ └── command
│ │ ├── OCommandExecutorScript.java
│ │ ├── OScriptDocumentDatabaseWrapper.java
│ │ ├── OScriptGraphDatabaseWrapper.java
│ │ └── script
│ │ └── OCommandScriptException.java
│ └── resources
│ └── META-INF
│ └── MANIFEST.MF
├── history.txt
├── license.txt
├── nativeos
├── lib
│ ├── jna-3.4.0.jar
│ └── platform.jar
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── orientechnologies
│ └── nio
│ ├── MemoryLocker.java
│ └── MemoryLockerLinux.java
├── object
├── .gitignore
├── lib
│ ├── hibernate-jpa-2.0-api-1.0.0.Final.jar
│ └── javassist.jar
├── pom.xml
├── script
│ ├── console.bat
│ └── console.sh
└── src
│ ├── main
│ └── java
│ │ └── com
│ │ └── orientechnologies
│ │ └── orient
│ │ └── object
│ │ ├── db
│ │ ├── OCommandSQLPojoWrapper.java
│ │ ├── ODatabaseObjectPool.java
│ │ ├── ODatabaseObjectTx.java
│ │ ├── ODatabaseObjectTxPooled.java
│ │ ├── ODatabasePojoAbstract.java
│ │ ├── OLazyObjectIterator.java
│ │ ├── OLazyObjectList.java
│ │ ├── OLazyObjectMap.java
│ │ ├── OLazyObjectSet.java
│ │ ├── OObjectDatabasePool.java
│ │ ├── OObjectDatabaseTx.java
│ │ ├── OObjectDatabaseTxPooled.java
│ │ ├── OObjectLazyIterator.java
│ │ ├── OObjectLazyList.java
│ │ ├── OObjectLazyListIterator.java
│ │ ├── OObjectLazyMap.java
│ │ ├── OObjectLazySet.java
│ │ ├── OObjectNotDetachedException.java
│ │ ├── OObjectNotManagedException.java
│ │ └── graph
│ │ │ ├── ODatabaseGraphTx.java
│ │ │ ├── OGraphEdge.java
│ │ │ ├── OGraphElement.java
│ │ │ └── OGraphVertex.java
│ │ ├── dictionary
│ │ └── ODictionaryWrapper.java
│ │ ├── enhancement
│ │ ├── OObjectEntityEnhancer.java
│ │ ├── OObjectEntitySerializer.java
│ │ └── OObjectProxyMethodHandler.java
│ │ ├── entity
│ │ └── OObjectEntityClassHandler.java
│ │ ├── enumerations
│ │ ├── OLazyObjectEnumSerializer.java
│ │ ├── OObjectEnumLazyIterator.java
│ │ ├── OObjectEnumLazyList.java
│ │ ├── OObjectEnumLazyMap.java
│ │ └── OObjectEnumLazySet.java
│ │ ├── fetch
│ │ ├── OObjectFetchContext.java
│ │ └── OObjectFetchListener.java
│ │ ├── iterator
│ │ ├── OObjectIteratorClass.java
│ │ ├── OObjectIteratorCluster.java
│ │ └── graph
│ │ │ ├── OGraphEdgeIterator.java
│ │ │ ├── OGraphElementIterator.java
│ │ │ └── OGraphVertexIterator.java
│ │ ├── jpa
│ │ ├── OJPAEntityManager.java
│ │ ├── OJPAEntityManagerFactory.java
│ │ ├── OJPAEntityTransaction.java
│ │ └── OJPAPersistenceProvider.java
│ │ └── serialization
│ │ ├── OLazyObjectCustomSerializer.java
│ │ ├── OObjectCustomSerializerIterator.java
│ │ ├── OObjectCustomSerializerList.java
│ │ ├── OObjectCustomSerializerMap.java
│ │ ├── OObjectCustomSerializerSet.java
│ │ ├── OObjectSerializationThreadLocal.java
│ │ ├── OObjectSerializerContext.java
│ │ ├── OObjectSerializerHelper.java
│ │ └── OObjectSerializerManager.java
│ └── test
│ └── java
│ └── com
│ └── orientechnologies
│ └── orient
│ └── object
│ └── enhancement
│ ├── AbstractEntity.java
│ ├── ExactEntity.java
│ └── OObjectEntitySerializerTest.java
├── pom.xml
├── readme.txt
└── tools
├── META-INF
└── MANIFEST.MF
├── pom.xml
├── script
├── console.bat
└── console.sh
└── src
└── main
└── java
└── com
└── orientechnologies
└── orient
└── console
├── OConsoleDatabaseApp.java
├── OConsoleDatabaseListener.java
└── OrientConsole.java
/.gitignore:
--------------------------------------------------------------------------------
1 | #Eclipse
2 | .project
3 | .classpath
4 | .settings
5 | .checkstyle
6 | project.properties
7 |
8 | #IntelliJ IDEA
9 | .idea
10 | *.iml
11 | *.ipr
12 | *.iws
13 | classes
14 | gen-external-apklibs
15 |
16 | #Maven
17 | target
18 | release.properties
19 | pom.xml.*
20 |
21 | #OSX
22 | .DS_Store
23 | .DS_Store*
24 | ehthumbs.db
25 | Icon?
26 | Thumbs.db
27 |
28 | #Android
29 | bin
30 | gen
31 | lint.xml
32 | proguard
33 | android-support-v4.jar
34 | proguard.cfg
35 | proguard-project.txt
36 | AndroidManifest.xml
37 |
38 | #Ant
39 | build.xml
40 | ant.properties
41 | local.properties
42 |
43 |
--------------------------------------------------------------------------------
/_base/images/orient_db.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuman/orientdb-android/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/_base/images/orient_db.png
--------------------------------------------------------------------------------
/_base/lib/UmlGraph.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuman/orientdb-android/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/_base/lib/UmlGraph.jar
--------------------------------------------------------------------------------
/build.bat:
--------------------------------------------------------------------------------
1 | @REM
2 | @REM Copyright (c) 1999-2011 Luca Garulli
3 | @REM
4 | call ant
5 |
6 | pause
7 |
--------------------------------------------------------------------------------
/build.number:
--------------------------------------------------------------------------------
1 | #Build Number for ANT. Do not edit!
2 | #Tue Jul 24 17:31:25 CEST 2012
3 | build.number=12316
4 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ant
3 |
--------------------------------------------------------------------------------
/client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 4.0.0
5 |
6 |
7 | com.wu-man
8 | orientdb-android-parent
9 | 1.1.0.2-SNAPSHOT
10 | ../
11 |
12 |
13 | orientdb-android-client
14 |
15 | OrientDB Client
16 |
17 |
18 | *
19 | com.orientechnologies.orient.client.*
20 |
21 |
22 |
23 |
24 | com.wu-man
25 | orientdb-android-enterprise
26 | ${project.version}
27 |
28 |
29 | dnsjava
30 | dnsjava
31 | 2.1.1
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemoteAsynchEventListener.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.orient.client.remote;
2 |
3 | import com.orientechnologies.common.log.OLogManager;
4 | import com.orientechnologies.orient.core.record.ORecordInternal;
5 | import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol;
6 | import com.orientechnologies.orient.enterprise.channel.binary.ORemoteServerEventListener;
7 |
8 | public class OStorageRemoteAsynchEventListener implements ORemoteServerEventListener {
9 |
10 | private OStorageRemote storage;
11 |
12 | public OStorageRemoteAsynchEventListener(OStorageRemote storage) {
13 | this.storage = storage;
14 | }
15 |
16 | public void onRequest(final byte iRequestCode, final Object obj) {
17 | if (iRequestCode == OChannelBinaryProtocol.REQUEST_PUSH_RECORD)
18 | // ASYNCHRONOUS PUSH INTO THE LEVEL2 CACHE
19 | storage.getLevel2Cache().updateRecord((ORecordInternal>) obj);
20 | else if (iRequestCode == OChannelBinaryProtocol.REQUEST_PUSH_DISTRIB_CONFIG) {
21 | storage.updateClusterConfiguration((byte[]) obj);
22 |
23 | if (OLogManager.instance().isInfoEnabled())
24 | OLogManager.instance().info(this, "Received new cluster configuration: %s", storage.getClusterConfiguration().toJSON(""));
25 | }
26 | }
27 |
28 | public OStorageRemote getStorage() {
29 | return storage;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemoteThreadLocal.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.client.remote;
17 |
18 | import com.orientechnologies.orient.client.remote.OStorageRemoteThreadLocal.OStorageRemoteSession;
19 |
20 | public class OStorageRemoteThreadLocal extends ThreadLocal {
21 | public static OStorageRemoteThreadLocal INSTANCE = new OStorageRemoteThreadLocal();
22 |
23 | public class OStorageRemoteSession {
24 | public boolean commandExecuting = false;
25 | public Integer sessionId = -1;
26 | }
27 |
28 | @Override
29 | protected OStorageRemoteSession initialValue() {
30 | return new OStorageRemoteSession();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/client/src/main/resources/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path: orient-database-enterprise.jar
--------------------------------------------------------------------------------
/commons/lib/testng-5.10-jdk15.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wuman/orientdb-android/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/lib/testng-5.10-jdk15.jar
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/collection/OAlwaysGreaterKey.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.collection;
17 |
18 | /**
19 | * Key that is used in {@link OMVRBTree} for partial composite key search.
20 | * It always greater than any passed in key.
21 | *
22 | * @author Andrey Lomakin
23 | * @since 20.03.12
24 | */
25 | public final class OAlwaysGreaterKey implements Comparable>{
26 | public int compareTo(Comparable> o) {
27 | return 1;
28 | }
29 | }
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/collection/OAlwaysLessKey.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.collection;
17 |
18 | /**
19 | * Key that is used in {@link OMVRBTree} for partial composite key search.
20 | * It always lesser than any passed in key.
21 | *
22 | * @author Andrey Lomakin
23 | * @since 20.03.12
24 | */
25 | public final class OAlwaysLessKey implements Comparable> {
26 | public int compareTo(Comparable> o) {
27 | return -1;
28 | }
29 | }
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/collection/OLazyIterator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.collection;
17 |
18 | import java.util.Iterator;
19 |
20 | /**
21 | * Generic interface for lazy iterators allowing the update of current value.
22 | *
23 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
24 | *
25 | */
26 | public interface OLazyIterator extends Iterator {
27 | public T update(T iValue);
28 | }
29 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/collection/OLazyIteratorListWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.collection;
17 |
18 | import java.util.ListIterator;
19 |
20 | /**
21 | * Lazy iterator implementation based on List Iterator.
22 | *
23 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
24 | *
25 | */
26 | public class OLazyIteratorListWrapper implements OLazyIterator {
27 | private ListIterator underlying;
28 |
29 | public OLazyIteratorListWrapper(ListIterator iUnderlying) {
30 | underlying = iUnderlying;
31 | }
32 |
33 | public boolean hasNext() {
34 | return underlying.hasNext();
35 | }
36 |
37 | public T next() {
38 | return underlying.next();
39 | }
40 |
41 | public void remove() {
42 | underlying.remove();
43 | }
44 |
45 | public T update(T e) {
46 | underlying.set(e);
47 | return null;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/ONeedRetryException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur;
17 |
18 | import com.orientechnologies.common.exception.OException;
19 |
20 | /**
21 | * Abstract base exception to extend for all the exception that report to the user it has been thrown but re-executing it could
22 | * succeed.
23 | *
24 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
25 | *
26 | */
27 | public abstract class ONeedRetryException extends OException {
28 | private static final long serialVersionUID = 1L;
29 |
30 | public ONeedRetryException() {
31 | super();
32 | }
33 |
34 | public ONeedRetryException(String message, Throwable cause) {
35 | super(message, cause);
36 | }
37 |
38 | public ONeedRetryException(String message) {
39 | super(message);
40 | }
41 |
42 | public ONeedRetryException(Throwable cause) {
43 | super(cause);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/OTimeoutException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur;
17 |
18 |
19 | /**
20 | * Timeout exception. The acquiring of a shared resource caused a timeout.
21 | *
22 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
23 | *
24 | */
25 | public class OTimeoutException extends ONeedRetryException {
26 | private static final long serialVersionUID = 1L;
27 |
28 | public OTimeoutException() {
29 | super();
30 | }
31 |
32 | public OTimeoutException(String message, Throwable cause) {
33 | super(message, cause);
34 | }
35 |
36 | public OTimeoutException(String message) {
37 | super(message);
38 | }
39 |
40 | public OTimeoutException(Throwable cause) {
41 | super(cause);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/lock/OLockException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur.lock;
17 |
18 | import com.orientechnologies.common.exception.OException;
19 | import com.orientechnologies.common.profiler.OProfiler;
20 |
21 | public class OLockException extends OException {
22 | private static final long serialVersionUID = 2215169397325875189L;
23 |
24 | public OLockException(String iMessage) {
25 | super(iMessage);
26 | OProfiler.getInstance().updateCounter("system.concurrency.OLockException", +1);
27 | }
28 |
29 | public OLockException(String iMessage, Exception iException) {
30 | super(iMessage, iException);
31 | OProfiler.getInstance().updateCounter("system.concurrency.OLockException", +1);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/lock/OModificationOperationProhibitedException.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.concur.lock;
2 |
3 | import com.orientechnologies.common.exception.OException;
4 |
5 | /**
6 | * Exception is thrown in case DB is locked for modifications but modification request ist trying to be acquired.
7 | *
8 | * @author Andrey Lomakin
9 | * @since 03.07.12
10 | */
11 | public class OModificationOperationProhibitedException extends OException {
12 | private static final long serialVersionUID = 1L;
13 |
14 | public OModificationOperationProhibitedException() {
15 | }
16 |
17 | public OModificationOperationProhibitedException(String message) {
18 | super(message);
19 | }
20 |
21 | public OModificationOperationProhibitedException(Throwable cause) {
22 | super(cause);
23 | }
24 |
25 | public OModificationOperationProhibitedException(String message, Throwable cause) {
26 | super(message, cause);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/OCloseable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur.resource;
17 |
18 | public interface OCloseable {
19 | public void close();
20 | }
21 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/ONotSharedResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur.resource;
17 |
18 | /**
19 | * Not shared resource. No lock is managed.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public class ONotSharedResource {
25 | protected void acquireSharedLock() {
26 | }
27 |
28 | protected void releaseSharedLock() {
29 | }
30 |
31 | protected void acquireExclusiveLock() {
32 | }
33 |
34 | protected void releaseExclusiveLock() {
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/OResourcePoolListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur.resource;
17 |
18 | public interface OResourcePoolListener {
19 |
20 | /**
21 | * Creates a new resource to be used and to be pooled when the client finishes with it.
22 | *
23 | * @return The new resource
24 | */
25 | public V createNewResource(K iKey, Object... iAdditionalArgs);
26 |
27 | /**
28 | * Reuses the pooled resource.
29 | *
30 | * @return true if can be reused, otherwise false. In this case the resource will be removed from the pool
31 | */
32 | public boolean reuseResource(K iKey, Object[] iAdditionalArgs, V iValue);
33 | }
34 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/OSharedContainer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur.resource;
17 |
18 | import java.util.concurrent.Callable;
19 |
20 | /**
21 | * Shared container interface that works with callbacks like closures.
22 | *
23 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
24 | *
25 | */
26 | public interface OSharedContainer {
27 | public boolean existsResource(final String iName);
28 |
29 | public T removeResource(final String iName);
30 |
31 | public T getResource(final String iName, final Callable iCallback);
32 | }
33 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/OSharedResource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.concur.resource;
17 |
18 | /**
19 | * Shared resource interface. Implementations can acquire and release shared and exclusive locks.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface OSharedResource {
25 | void acquireSharedLock();
26 |
27 | void releaseSharedLock();
28 |
29 | void acquireExclusiveLock();
30 |
31 | void releaseExclusiveLock();
32 | }
33 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/OSharedResourceExternal.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.concur.resource;
2 |
3 | public class OSharedResourceExternal extends OSharedResourceAbstract implements OSharedResource {
4 |
5 | @Override
6 | public void acquireExclusiveLock() {
7 | super.acquireExclusiveLock();
8 | }
9 |
10 | @Override
11 | public void acquireSharedLock() {
12 | super.acquireSharedLock();
13 | }
14 |
15 | @Override
16 | public void releaseExclusiveLock() {
17 | super.releaseExclusiveLock();
18 | }
19 |
20 | @Override
21 | public void releaseSharedLock() {
22 | super.releaseSharedLock();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/concur/resource/OSharedResourceExternalTimeout.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.concur.resource;
2 |
3 | import com.orientechnologies.common.concur.OTimeoutException;
4 |
5 | public class OSharedResourceExternalTimeout extends OSharedResourceTimeout {
6 |
7 | public OSharedResourceExternalTimeout(final int timeout) {
8 | super(timeout);
9 | }
10 |
11 | @Override
12 | public void acquireExclusiveLock() throws OTimeoutException {
13 | super.acquireExclusiveLock();
14 | }
15 |
16 | @Override
17 | public void acquireSharedLock() throws OTimeoutException {
18 | super.acquireSharedLock();
19 | }
20 |
21 | @Override
22 | public void releaseExclusiveLock() {
23 | super.releaseExclusiveLock();
24 | }
25 |
26 | @Override
27 | public void releaseSharedLock() {
28 | super.releaseSharedLock();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/console/DefaultConsoleReader.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.console;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.InputStreamReader;
6 |
7 | public class DefaultConsoleReader implements OConsoleReader {
8 | final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
9 |
10 | public String readLine() {
11 | try {
12 | return reader.readLine();
13 | } catch (IOException e) {
14 | return null;
15 | }
16 | }
17 |
18 | public OConsoleApplication getConsole() {
19 | return null;
20 | }
21 |
22 | public void setConsole(OConsoleApplication console) {
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/console/OConsoleCommandCollection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Orient Technologies.
3 | * Copyright 2012 Geomatys.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.orientechnologies.common.console;
18 |
19 | import com.orientechnologies.common.console.annotation.ConsoleCommand;
20 |
21 | /**
22 | * Commun interface for addtitional console commands.
23 | * Instances of this class are discovered throught serviceLoaders.
24 | * It should be declared in file :
25 | * META-INF/services/com.orientechnologies.common.console.OConsoleCommandCollection
26 | *
27 | * This interface is empty, all wanted commands are expected to be annoted with
28 | * {@link ConsoleCommand}.
29 | *
30 | * @author Johann Sorel (Geomatys)
31 | */
32 | public abstract class OConsoleCommandCollection {
33 |
34 | protected OConsoleApplication context;
35 |
36 | void setContext(OConsoleApplication context){
37 | this.context = context;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/console/OConsoleReader.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.console;
2 |
3 | public interface OConsoleReader {
4 | public String readLine();
5 |
6 | public void setConsole(OConsoleApplication console);
7 |
8 | public OConsoleApplication getConsole();
9 | }
10 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/console/annotation/ConsoleCommand.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.console.annotation;
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 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.METHOD)
10 | public @interface ConsoleCommand {
11 | String[] aliases() default {};
12 |
13 | String description() default "";
14 |
15 | boolean splitInWords() default true;
16 | }
17 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/console/annotation/ConsoleParameter.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.console.annotation;
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 | @Target(ElementType.PARAMETER)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface ConsoleParameter {
11 | String name() default "";
12 |
13 | String description() default "";
14 |
15 | boolean optional() default false;
16 | }
17 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/exception/OException.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.exception;
2 |
3 | public class OException extends RuntimeException {
4 |
5 | private static final long serialVersionUID = 3882447822497861424L;
6 |
7 | public OException() {
8 | }
9 |
10 | public OException(final String message) {
11 | super(message);
12 | }
13 |
14 | public OException(final Throwable cause) {
15 | super(cause);
16 | }
17 |
18 | public OException(final String message, final Throwable cause) {
19 | super(message, cause);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/factory/ODynamicFactory.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.factory;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | public class ODynamicFactory {
7 | protected Map registry = new HashMap();
8 |
9 | public V get(K iKey) {
10 | return registry.get(iKey);
11 | }
12 |
13 | public void register(K iKey, V iValue) {
14 | registry.put(iKey, iValue);
15 | }
16 |
17 | public void unregister(K iKey) {
18 | registry.remove(iKey);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/factory/ODynamicFactoryInverse.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.factory;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | public class ODynamicFactoryInverse extends ODynamicFactory {
7 | protected Map inverseRegistry = new HashMap();
8 |
9 | public K getInverse(V iValue) {
10 | return inverseRegistry.get(iValue);
11 | }
12 |
13 | @Override
14 | public void register(K iKey, V iValue) {
15 | super.register(iKey, iValue);
16 | inverseRegistry.put(iValue, iKey);
17 | }
18 |
19 | @Override
20 | public void unregister(K iKey) {
21 | V value = get(iKey);
22 | if (value == null)
23 | return;
24 | super.unregister(iKey);
25 | inverseRegistry.remove(value);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/io/OIOException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.io;
17 |
18 | import com.orientechnologies.common.exception.OException;
19 |
20 | public class OIOException extends OException {
21 |
22 | private static final long serialVersionUID = -3003977236203691448L;
23 |
24 | public OIOException(String string) {
25 | super(string);
26 | }
27 |
28 | public OIOException(String message, Throwable cause) {
29 | super(message, cause);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/listener/OProgressListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.listener;
17 |
18 | /**
19 | * Listener interface called on task execution.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface OProgressListener {
25 | public void onBegin(Object iTask, long iTotal);
26 |
27 | public boolean onProgress(Object iTask, long iCounter, float iPercent);
28 |
29 | public void onCompletition(Object iTask, boolean iSucceed);
30 | }
31 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/parser/OVariableParserListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006-2008 Luca Garulli (luca.garulli--at--assetdata.it)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.parser;
17 |
18 | /**
19 | * Wake up at every variable found.
20 | *
21 | * @author Luca Garulli (luca.garulli--at--assetdata.it
22 | *
23 | */
24 | public interface OVariableParserListener {
25 | public String resolve(String iVariable);
26 | }
27 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/profiler/OProfilerMBean.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.profiler;
2 |
3 | import java.util.Date;
4 |
5 | public interface OProfilerMBean {
6 |
7 | // ----------------------------------------------------------------------------
8 | public void updateCounter(String iStatName, long iPlus);
9 |
10 | // ----------------------------------------------------------------------------
11 | public long getCounter(String iStatName);
12 |
13 | public String dump();
14 |
15 | public String dumpCounters();
16 |
17 | // ----------------------------------------------------------------------------
18 | /**
19 | * Resetta i contatori statistici e i chrono.
20 | */
21 | public void reset();
22 |
23 | // ----------------------------------------------------------------------------
24 | /**
25 | * Fa partire un nuovo chrono.
26 | */
27 | public long startChrono();
28 |
29 | // ----------------------------------------------------------------------------
30 | /**
31 | * Ferma un chrono con nome .
32 | */
33 | public long stopChrono(String iName, long iStartTime);
34 |
35 | public String dumpChronos();
36 |
37 | public String[] getCountersAsString();
38 |
39 | public String[] getChronosAsString();
40 |
41 | public Date getLastReset();
42 |
43 | public boolean isRecording();
44 |
45 | public OProfilerMBean startRecording();
46 |
47 | public OProfilerMBean stopRecording();
48 | }
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/thread/OPollerThread.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.thread;
2 |
3 | public abstract class OPollerThread extends OSoftThread {
4 | protected final long delay;
5 |
6 | public OPollerThread(final long iDelay) {
7 | delay = iDelay;
8 | }
9 |
10 | public OPollerThread(long iDelay, final ThreadGroup iThreadGroup) {
11 | super(iThreadGroup, OPollerThread.class.getSimpleName());
12 | delay = iDelay;
13 | }
14 |
15 | public OPollerThread(final long iDelay, final String name) {
16 | super(name);
17 | delay = iDelay;
18 | }
19 |
20 | public OPollerThread(final long iDelay, final ThreadGroup group, final String name) {
21 | super(group, name);
22 | delay = iDelay;
23 | }
24 |
25 | @Override
26 | protected void afterExecution() throws InterruptedException {
27 | pauseCurrentThread(delay);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/types/OBinary.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.types;
17 |
18 | /**
19 | * Binary wrapper to let to byte[] to be managed inside OrientDB where comparable is needed, like for indexes.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public class OBinary implements Comparable {
25 | private byte[] value;
26 |
27 | public OBinary(final byte[] buffer) {
28 | value = buffer;
29 | }
30 |
31 | public int compareTo(final OBinary o) {
32 | final int size = value.length;
33 |
34 | for (int i = 0; i < size; ++i) {
35 | if (value[i] > o.value[i])
36 | return 1;
37 | else if (value[i] < o.value[i])
38 | return -1;
39 | }
40 | return 0;
41 | }
42 |
43 | public byte[] toByteArray() {
44 | return value;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/types/ORef.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.types;
17 |
18 | /**
19 | * Modifiable value. Point to the real value. Useful to pass in method as parameter, letting the method to change. A sort of void*
20 | * of C language.
21 | *
22 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
23 | *
24 | */
25 | public class ORef {
26 | public T value;
27 |
28 | public ORef() {
29 | }
30 |
31 | public ORef(final T object) {
32 | this.value = object;
33 | }
34 |
35 | public ORef clear() {
36 | value = null;
37 | return this;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/util/OCallable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.util;
17 |
18 | /**
19 | * Generic callable interface that accepts a parameter.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface OCallable {
25 | public RET call(PAR iArgument);
26 | }
27 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/util/OCaseIncentiveComparator.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.util;
2 |
3 | import java.util.Comparator;
4 |
5 | /**
6 | * Compares strings without taking into account their case.
7 | */
8 | public class OCaseIncentiveComparator implements Comparator {
9 | public int compare(final String stringOne, final String stringTwo) {
10 | return stringOne.toLowerCase().compareTo(stringTwo.toLowerCase());
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/util/OClassLoaderHelper.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.util;
2 |
3 | import java.util.Iterator;
4 |
5 | import com.wuman.spi.ServiceRegistry;
6 |
7 | public class OClassLoaderHelper {
8 |
9 | /**
10 | * Switch to the OrientDb classloader before lookups on ServiceRegistry for
11 | * implementation of the given Class. Useful under OSGI and generally under
12 | * applications where jars are loaded by another class loader
13 | *
14 | * @param clazz
15 | * the class to lookup foor
16 | * @return an Iterator on the class implementation
17 | */
18 | public static synchronized Iterator lookupProviderWithOrientClassLoader(Class clazz) {
19 |
20 | return lookupProviderWithOrientClassLoader(clazz,OClassLoaderHelper.class.getClassLoader());
21 | }
22 |
23 | public static synchronized Iterator lookupProviderWithOrientClassLoader(Class clazz,ClassLoader orientClassLoader) {
24 |
25 | ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader();
26 |
27 | Thread.currentThread().setContextClassLoader(orientClassLoader);
28 | Iterator lookupProviders = ServiceRegistry.lookupProviders(clazz);
29 | Thread.currentThread().setContextClassLoader(origClassLoader);
30 |
31 | return lookupProviders;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/commons/src/main/java/com/orientechnologies/common/util/OService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.common.util;
17 |
18 | /**
19 | * Generic Service interface.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface OService {
25 | public String getName();
26 |
27 | public void startup();
28 |
29 | public void shutdown();
30 | }
31 |
--------------------------------------------------------------------------------
/commons/src/test/java/com/orientechnologies/common/test/SpeedTest.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.test;
2 |
3 |
4 | public interface SpeedTest {
5 | public void cycle() throws Exception;
6 |
7 | public void init() throws Exception;
8 |
9 | public void deinit() throws Exception;
10 |
11 | public void beforeCycle() throws Exception;
12 |
13 | public void afterCycle() throws Exception;
14 | }
15 |
--------------------------------------------------------------------------------
/commons/src/test/java/com/orientechnologies/common/test/SpeedTestMonoThread.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.test;
2 |
3 | public abstract class SpeedTestMonoThread extends SpeedTestAbstract {
4 | protected SpeedTestMonoThread() {
5 | }
6 |
7 | protected SpeedTestMonoThread(final long iCycles) {
8 | super(iCycles);
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/commons/src/test/java/com/orientechnologies/common/test/SpeedTestMultiThreads.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.test;
2 |
3 | import org.testng.annotations.Test;
4 |
5 | @Test(enabled = false)
6 | public abstract class SpeedTestMultiThreads extends SpeedTestAbstract {
7 | protected Class extends SpeedTestThread> threadClass;
8 | protected int threads;
9 | protected long threadCycles;
10 |
11 | protected SpeedTestMultiThreads(long iCycles, int iThreads, Class extends SpeedTestThread> iThreadClass) {
12 | super(1);
13 | threadClass = iThreadClass;
14 | threads = iThreads;
15 | threadCycles = iCycles;
16 | }
17 |
18 | @Override
19 | public void cycle() throws InterruptedException {
20 | SpeedTestThread[] ts = new SpeedTestThread[threads];
21 | SpeedTestThread t;
22 | for (int i = 0; i < threads; ++i)
23 | try {
24 | t = threadClass.newInstance();
25 | ts[i] = t;
26 |
27 | t.setOwner(this);
28 | t.setCycles(threadCycles / threads);
29 | t.start();
30 | } catch (Exception e) {
31 | e.printStackTrace();
32 | return;
33 | }
34 |
35 | for (int i = 0; i < threads; ++i) {
36 | ts[i].join();
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/commons/src/test/java/com/orientechnologies/common/test/SpeedTestThread.java:
--------------------------------------------------------------------------------
1 | package com.orientechnologies.common.test;
2 |
3 | public abstract class SpeedTestThread extends Thread implements SpeedTest {
4 | protected SpeedTestData data;
5 | protected SpeedTestMultiThreads owner;
6 |
7 | protected SpeedTestThread() {
8 | data = new SpeedTestData();
9 | }
10 |
11 | protected SpeedTestThread(long iCycles) {
12 | data = new SpeedTestData(iCycles);
13 | }
14 |
15 | public void setCycles(long iCycles) {
16 | data.cycles = iCycles;
17 | }
18 |
19 | public void setOwner(SpeedTestMultiThreads iOwner) {
20 | owner = iOwner;
21 | }
22 |
23 | @Override
24 | public void run() {
25 | data.printResults = false;
26 | data.go(this);
27 | }
28 |
29 | public void init() throws Exception {
30 | }
31 |
32 | public void deinit() throws Exception {
33 | }
34 |
35 | public void afterCycle() throws Exception {
36 | }
37 |
38 | public void beforeCycle() throws Exception {
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/core/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 4.0.0
5 |
6 |
7 | com.wu-man
8 | orientdb-android-parent
9 | 1.1.0.2-SNAPSHOT
10 | ../
11 |
12 |
13 | orientdb-android-core
14 |
15 | OrientDB Core
16 |
17 |
18 | *
19 | com.orientechnologies.orient.core.*
20 |
21 |
22 |
23 |
24 | com.wu-man
25 | orient-android-commons
26 | ${project.version}
27 |
28 |
29 |
30 | org.testng
31 | testng
32 | 5.14.1
33 | test
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/OConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core;
17 |
18 | public class OConstants {
19 | public static final String ORIENT_VERSION = "1.1.0";
20 | public static final String ORIENT_URL = "www.orientechnologies.com";
21 |
22 | public static String getVersion() {
23 | final StringBuilder buffer = new StringBuilder();
24 | buffer.append(OConstants.ORIENT_VERSION);
25 |
26 | final String buildNumber = System.getProperty("orientdb.build.number");
27 |
28 | if (buildNumber != null) {
29 | buffer.append(" (build ");
30 | buffer.append(buildNumber);
31 | buffer.append(")");
32 | }
33 |
34 | return buffer.toString();
35 | }
36 |
37 | public static String getBuildNumber() {
38 | final String buildNumber = System.getProperty("orientdb.build.number");
39 | if (buildNumber == null)
40 | return null;
41 |
42 | return buildNumber;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/OOrientListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core;
17 |
18 | import com.orientechnologies.orient.core.storage.OStorage;
19 |
20 | /**
21 | * Listener Interface for basic Orient events.
22 | *
23 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
24 | *
25 | */
26 | public interface OOrientListener {
27 |
28 | public void onStorageRegistered(final OStorage iStorage);
29 |
30 | public void onStorageUnregistered(final OStorage iStorage);
31 |
32 | public void onShutdown();
33 | }
34 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/OrientShutdownHook.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core;
17 |
18 | public class OrientShutdownHook extends Thread {
19 | protected OrientShutdownHook() {
20 | Runtime.getRuntime().addShutdownHook(this);
21 | }
22 |
23 | /**
24 | * Shutdown Orient engine.
25 | */
26 | @Override
27 | public void run() {
28 | Orient.instance().shutdown();
29 | }
30 |
31 | public void cancel() {
32 | try {
33 | Runtime.getRuntime().removeShutdownHook(this);
34 | } catch (IllegalStateException e) {
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OAccess.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Tells the way OrientDB should bind the field. By default OrientDB searches for getter and setter. If they are not present, then
26 | * the field is accessed directly. Using this annotation, instead, forces the field level access. Use this if you want by-pass
27 | * getter and setter methods.
28 | */
29 | @Documented
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target(ElementType.FIELD)
32 | public @interface OAccess {
33 | public enum OAccessType {
34 | FIELD, PROPERTY
35 | }
36 |
37 | public OAccessType value() default OAccessType.PROPERTY;
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OAfterDeserialization.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Documented
25 | @Retention(RetentionPolicy.RUNTIME)
26 | @Target(ElementType.METHOD)
27 | /**
28 | * Tells to OrientDB to call the method AFTER the record is read and unmarshalled from database.
29 | * Applies only to the entity Objects reachable by the OrientDB engine after have registered them.
30 | */
31 | public @interface OAfterDeserialization {
32 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OAfterSerialization.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Documented
25 | @Retention(RetentionPolicy.RUNTIME)
26 | @Target(ElementType.METHOD)
27 | /**
28 | * Tells to OrientDB to call the method AFTER the record is marshalled and written to the database.
29 | * Applies only to the entity Objects reachable by the OrientDB engine after have registered them.
30 | */
31 | public @interface OAfterSerialization {
32 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OBeforeDeserialization.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Documented
25 | @Retention(RetentionPolicy.RUNTIME)
26 | @Target(ElementType.METHOD)
27 | /**
28 | * Tells to OrientDB to call the method BEFORE the record is read and unmarshalled from database.
29 | * Applies only to the entity Objects reachable by the OrientDB engine after have registered them.
30 | */
31 | public @interface OBeforeDeserialization {
32 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OBeforeSerialization.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Documented
25 | @Retention(RetentionPolicy.RUNTIME)
26 | @Target(ElementType.METHOD)
27 | /**
28 | * Tells to OrientDB to call the method BEFORE the record is marshalled and written to the database.
29 | * Applies only to the entity Objects reachable by the OrientDB engine after have registered them.
30 | */
31 | public @interface OBeforeSerialization {
32 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/ODocumentInstance.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Tells that the field contains the embedded document bound to the POJO. Default is FALSE.
26 | */
27 | @Documented
28 | @Retention(RetentionPolicy.RUNTIME)
29 | @Target(ElementType.FIELD)
30 | public @interface ODocumentInstance {
31 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OId.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Tells that the field contains the RecordID. This is needed when you work with detached object graph. OrientDb will use this field
26 | * to know the Document bound across different database instances.
27 | */
28 | @Documented
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target(ElementType.FIELD)
31 | public @interface OId {
32 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/annotation/OVersion.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.annotation;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Tells that the field contains the Document version. This is needed when you work with detached object graph and transactions.
26 | */
27 | @Documented
28 | @Retention(RetentionPolicy.RUNTIME)
29 | @Target(ElementType.FIELD)
30 | public @interface OVersion {
31 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 |
19 | /**
20 | * Generic GOF command pattern implementation.
21 | *
22 | * @author Luca Garulli
23 | *
24 | * @param
25 | */
26 | public interface OCommand {
27 | /**
28 | * Executes command.
29 | *
30 | * @return The result of command if any, otherwise null
31 | */
32 | public Object execute();
33 |
34 | public OCommandContext getContext();
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | import java.util.Map;
19 |
20 | /**
21 | * Basic interface for commands. Manages the context variables during execution.
22 | *
23 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
24 | *
25 | */
26 | public interface OCommandContext {
27 | public Object getVariable(final String iName);
28 |
29 | public void setVariable(final String iName, final Object iValue);
30 |
31 | public Map getVariables();
32 |
33 | public void merge(OCommandContext context);
34 | }
35 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandDistributedConditionalReplicateRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | /**
19 | * Generic tagged interface to determine at runtime if the command must be replicated among all the servers.
20 | *
21 | * @author Luca Garulli
22 | */
23 | public interface OCommandDistributedConditionalReplicateRequest extends OCommandDistributedReplicateRequest {
24 |
25 | public boolean isReplicated();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandDistributedReplicateRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | /**
19 | * Generic tagged interface to know if the command must be distributed in clustered scenario.
20 | *
21 | * @author Luca Garulli
22 | */
23 | public interface OCommandDistributedReplicateRequest {
24 | }
25 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandOutputListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | /**
19 | * Receives callback from a command as output.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface OCommandOutputListener {
25 | public void onMessage(String iText);
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandPredicate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orientechnologies.orient.core.command;
18 |
19 | import com.orientechnologies.orient.core.record.ORecord;
20 |
21 | /**
22 | * Command predicate to be evaluated against a record and a context.
23 | *
24 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
25 | *
26 | */
27 | public interface OCommandPredicate {
28 | /**
29 | * Evaluates the predicate.
30 | *
31 | * @param iRecord
32 | * Target record
33 | * @param iContext
34 | * Context of execution
35 | * @return true or false
36 | */
37 | public boolean evaluate(final ORecord> iRecord, final OCommandContext iContext);
38 | }
39 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandProcess.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.orientechnologies.orient.core.command;
18 |
19 | /**
20 | * Base command processing class.
21 | *
22 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
23 | *
24 | */
25 | public abstract class OCommandProcess {
26 | protected final C command;
27 | protected final T target;
28 |
29 | /**
30 | * Create the process defining command and target.
31 | */
32 | public OCommandProcess(final C iCommand, final T iTarget) {
33 | command = iCommand;
34 | target = iTarget;
35 | }
36 |
37 | public abstract R process();
38 |
39 | public T getTarget() {
40 | return target;
41 | }
42 |
43 | @Override
44 | public String toString() {
45 | return target.toString();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandRequestAsynch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | public interface OCommandRequestAsynch {
19 | public OCommandResultListener getResultListener();
20 |
21 | public void setResultListener(OCommandResultListener iListener);
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandRequestText.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | import com.orientechnologies.orient.core.serialization.OSerializableStream;
19 |
20 | /**
21 | * Internal specialization of generic OCommand interface.
22 | *
23 | * @author Luca Garulli
24 | *
25 | * @param
26 | */
27 | public interface OCommandRequestText extends OCommandRequestInternal, OSerializableStream {
28 | public String getText();
29 |
30 | public OCommandRequestText setText(String iText);
31 |
32 | public OCommandContext getContext();
33 |
34 | public OCommandRequestText setContext(final OCommandContext iContext);
35 | }
36 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/OCommandResultListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command;
17 |
18 | /**
19 | * Callback interface called when the command returns results.
20 | *
21 | * @author Luca Garulli
22 | *
23 | */
24 | public interface OCommandResultListener {
25 | public boolean result(Object iRecord);
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/command/traverse/OTraverseAbstractProcess.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.command.traverse;
17 |
18 | import com.orientechnologies.orient.core.command.OCommandProcess;
19 | import com.orientechnologies.orient.core.db.record.OIdentifiable;
20 |
21 | public abstract class OTraverseAbstractProcess extends OCommandProcess {
22 | public OTraverseAbstractProcess(final OTraverse iCommand, final T iTarget) {
23 | super(iCommand, iTarget);
24 | command.getContext().push(this);
25 | }
26 |
27 | public abstract String getStatus();
28 |
29 | public OIdentifiable drop() {
30 | command.getContext().pop();
31 | return null;
32 | }
33 | }
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OAbstractStorageClusterConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | public abstract class OAbstractStorageClusterConfiguration implements OStorageClusterConfiguration {
19 | public int id;
20 | public String name;
21 | public String location;
22 | protected int dataSegmentId;
23 |
24 | public OAbstractStorageClusterConfiguration(final String name, final int id, final int iDataSegmentId) {
25 | this.name = name;
26 | this.id = id;
27 | this.dataSegmentId = iDataSegmentId;
28 | }
29 |
30 | public String getName() {
31 | return name;
32 | }
33 |
34 | public int getId() {
35 | return id;
36 | }
37 |
38 | public void setId(final int iId) {
39 | id = iId;
40 | }
41 |
42 | public int getDataSegmentId() {
43 | return dataSegmentId;
44 | }
45 |
46 | public String getLocation() {
47 | return location;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OConfigurationChangeCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | /**
19 | * Interface of actions to call in case of change of the configuration.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface OConfigurationChangeCallback {
25 | public void change(final Object iCurrentValue, final Object iNewValue);
26 | }
27 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OStorageClusterConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | public interface OStorageClusterConfiguration {
19 |
20 | public int getId();
21 |
22 | public String getName();
23 |
24 | public String getLocation();
25 |
26 | public int getDataSegmentId();
27 | }
28 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OStorageClusterHoleConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | public class OStorageClusterHoleConfiguration extends OStorageFileConfiguration {
19 | private static final long serialVersionUID = 1L;
20 |
21 | private static final String DEF_EXTENSION = ".och";
22 | private static final String DEF_INCREMENT_SIZE = "50%";
23 |
24 | public OStorageClusterHoleConfiguration() {
25 | super();
26 | }
27 |
28 | public OStorageClusterHoleConfiguration(OStorageSegmentConfiguration iParent, String iPath, String iType, String iMaxSize) {
29 | super(iParent, iPath + DEF_EXTENSION, iType, iMaxSize, DEF_INCREMENT_SIZE);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OStorageDataHoleConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | public class OStorageDataHoleConfiguration extends OStorageFileConfiguration {
19 | private static final long serialVersionUID = 1L;
20 |
21 | private static final String DEF_EXTENSION = ".odh";
22 | private static final String DEF_INCREMENT_SIZE = "50%";
23 |
24 | public OStorageDataHoleConfiguration() {
25 | }
26 |
27 | public OStorageDataHoleConfiguration(OStorageSegmentConfiguration iParent, String iPath, String iType, String iMaxSize) {
28 | super(iParent, iPath + DEF_EXTENSION, iType, iMaxSize, DEF_INCREMENT_SIZE);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OStorageEntryConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | import java.io.Serializable;
19 |
20 | @SuppressWarnings("serial")
21 | public class OStorageEntryConfiguration implements Serializable {
22 | public String name;
23 | public String value;
24 |
25 | public OStorageEntryConfiguration() {
26 | }
27 |
28 | public OStorageEntryConfiguration(final String iName, final String iValue) {
29 | name = iName;
30 | value = iValue;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/config/OStorageMemoryClusterConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.config;
17 |
18 | public class OStorageMemoryClusterConfiguration extends OAbstractStorageClusterConfiguration {
19 | public OStorageMemoryClusterConfiguration(final String name, final int id, final int iDataSegmentId) {
20 | super(name, id, iDataSegmentId);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/db/ODataSegmentStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.db;
17 |
18 | import com.orientechnologies.orient.core.record.ORecord;
19 |
20 | /**
21 | * Strategy interface to assign a data-segment to a new record.
22 | *
23 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
24 | *
25 | */
26 | public interface ODataSegmentStrategy {
27 |
28 | /**
29 | * Tells to the database in what data segment put the new record. Default strategy always use data segment 0 (default).
30 | *
31 | * @param iDatabase
32 | * Database instance
33 | * @param iRecord
34 | * Record istance
35 | * @return The data segment id
36 | */
37 | public int assignDataSegmentId(ODatabase iDatabase, ORecord> iRecord);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseLifecycleListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.db;
17 |
18 | /**
19 | * Listener Interface to receive callbacks on database usage.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface ODatabaseLifecycleListener {
25 |
26 | public void onOpen(ODatabase iDatabase);
27 |
28 | public void onClose(ODatabase iDatabase);
29 | }
30 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/db/ODatabasePooled.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.db;
17 |
18 | /**
19 | * Basic interface for pooled database implementations.
20 | *
21 | * @author Luca Garulli (l.garulli--at--orientechnologies.com)
22 | *
23 | */
24 | public interface ODatabasePooled {
25 |
26 | /**
27 | * Reuses current instance.
28 | *
29 | * @param iOwner
30 | * @param iAdditionalArgs
31 | */
32 | public void reuse(final Object iOwner, final Object[] iAdditionalArgs);
33 |
34 | /**
35 | * Tells if the underlying database is closed.
36 | */
37 | public boolean isUnderlyingOpen();
38 |
39 | /**
40 | * Force closing the current instance avoiding to being reused.
41 | */
42 | public void forceClose();
43 | }
44 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseSchemaAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.orientechnologies.orient.core.db;
17 |
18 | /**
19 | * Generic interface for record based Database implementations with schema concept.
20 | *
21 | * @author Luca Garulli
22 | *
23 | */
24 | public interface ODatabaseSchemaAware extends ODatabaseComplex {
25 | /**
26 | * Creates a new entity instance. Each database implementation will return the right type.
27 | *
28 | * @return The new instance.
29 | */
30 | public RET newInstance(String iClassName);
31 |
32 | /**
33 | * Counts the entities contained in the specified class.
34 | *
35 | * @param iClassName
36 | * Class name
37 | * @return Total entities
38 | */
39 | public long countClass(String iClassName);
40 | }
41 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/db/object/OLazyObjectListInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2012 Luca Molino (molino.luca--AT--gmail.com)
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.orientechnologies.orient.core.db.object;
18 |
19 | import java.util.List;
20 |
21 | /**
22 | * @author luca.molino
23 | *
24 | */
25 | public interface OLazyObjectListInterface extends List {
26 |
27 | public void setConvertToRecord(boolean convertToRecord);
28 |
29 | public boolean isConverted();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/core/src/main/java/com/orientechnologies/orient/core/db/object/OLazyObjectMapInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2012 Luca Molino (molino.luca--AT--gmail.com)
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.orientechnologies.orient.core.db.object;
18 |
19 | import java.util.Map;
20 |
21 | /**
22 | * @author luca.molino
23 | *
24 | */
25 | public interface OLazyObjectMapInterface extends Map