From 3217289401595434b0c2116c3e09f1ed6fa031ca Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 5 Jul 2011 19:18:31 +0300 Subject: [PATCH] + renamed org.springframework.data.keyvalue.redis to o.s.d.redis + eliminated Riak package + eliminate Core package --- .classpath | 10 + .gitignore | 1 + .project | 34 + .../org.eclipse.jdt.core.prefs | 19 +- .settings/org.maven.ide.eclipse.prefs | 9 - README.md | 4 +- build.gradle | 101 ++- docs/.classpath | 6 + {spring-data-keyvalue-core => docs}/.project | 3 +- docs/build.gradle | 7 +- docs/src/api/javadoc.options | 4 +- .../docbook/reference/redis-messaging.xml | 10 +- .../src/reference/docbook/reference/redis.xml | 34 +- gradle.properties | 15 +- settings.gradle | 7 +- spring-data-keyvalue-core/.classpath | 24 - .../.settings/org.eclipse.jdt.core.prefs | 13 - spring-data-keyvalue-core/build.gradle | 0 .../UncategorizedKeyvalueStoreException.java | 27 - spring-data-keyvalue-core/template.mf | 19 - spring-data-redis/.classpath | 38 - spring-data-redis/.gitignore | 2 - spring-data-redis/.project | 16 - spring-data-redis/build.gradle | 17 - spring-data-redis/gradle.properties | 13 - .../redis/core/query/package-info.java | 5 - .../support/collections/package-info.java | 12 - .../main/resources/META-INF/spring.schemas | 2 - spring-data-riak/README.md | 107 --- spring-data-riak/build.gradle | 9 - .../DataStoreConnectionFailureException.java | 38 - .../riak/DataStoreOperationException.java | 38 - .../riak/convert/KeyValueStoreMetaData.java | 47 -- .../riak/core/AbstractRiakTemplate.java | 540 ------------ .../AsyncBucketKeyValueStoreOperations.java | 166 ---- .../core/AsyncKeyValueStoreOperation.java | 29 - .../keyvalue/riak/core/AsyncRiakTemplate.java | 630 -------------- .../keyvalue/riak/core/BucketKeyPair.java | 43 - .../keyvalue/riak/core/BucketKeyResolver.java | 45 - .../core/BucketKeyValueStoreOperations.java | 205 ----- .../riak/core/KeyValueStoreMetaData.java | 52 -- .../riak/core/KeyValueStoreOperations.java | 271 ------ .../riak/core/KeyValueStoreValue.java | 42 - .../keyvalue/riak/core/QosParameters.java | 52 -- .../riak/core/RiakKeyValueTemplate.java | 349 -------- .../data/keyvalue/riak/core/RiakMetaData.java | 83 -- .../keyvalue/riak/core/RiakQosParameters.java | 57 -- .../data/keyvalue/riak/core/RiakTemplate.java | 781 ------------------ .../data/keyvalue/riak/core/RiakValue.java | 42 - .../riak/core/SimpleBucketKeyPair.java | 57 -- .../riak/core/SimpleBucketKeyResolver.java | 76 -- .../data/keyvalue/riak/core/io/RiakFile.java | 392 --------- .../riak/core/io/RiakInputStream.java | 91 -- .../riak/core/io/RiakOutputStream.java | 46 -- .../keyvalue/riak/core/io/RiakResource.java | 138 ---- .../data/keyvalue/riak/core/io/overview.html | 15 - .../data/keyvalue/riak/core/overview.html | 7 - .../keyvalue/riak/groovy/RiakBuilder.java | 463 ----------- .../riak/groovy/RiakMapReduceOperation.java | 115 --- .../keyvalue/riak/groovy/RiakOperation.java | 303 ------- .../data/keyvalue/riak/groovy/overview.html | 8 - .../mapreduce/AbstractRiakMapReduceJob.java | 144 ---- .../mapreduce/AsyncMapReduceOperations.java | 41 - .../riak/mapreduce/AsyncRiakMapReduceJob.java | 48 -- .../mapreduce/ErlangMapReduceOperation.java | 67 -- .../JavascriptMapReduceOperation.java | 73 -- .../keyvalue/riak/mapreduce/MapReduceJob.java | 69 -- .../mapreduce/MapReduceLinkOperation.java | 26 - .../riak/mapreduce/MapReduceOperation.java | 35 - .../riak/mapreduce/MapReduceOperations.java | 58 -- .../riak/mapreduce/MapReducePhase.java | 82 -- .../riak/mapreduce/RiakMapReduceJob.java | 49 -- .../riak/mapreduce/RiakMapReducePhase.java | 88 -- .../keyvalue/riak/mapreduce/overview.html | 7 - .../data/keyvalue/riak/overview.html | 8 - .../riak/util/Ignore404sErrorHandler.java | 49 -- .../riak/util/RiakClassFileLoader.java | 153 ---- .../keyvalue/riak/util/RiakClassLoader.java | 186 ----- .../resources/META-INF/spring/app-context.xml | 8 - .../keyvalue/riak/core/ClassLoaderTest.class | Bin 639 -> 0 bytes .../keyvalue/riak/core/ClassLoaderTest.java | 35 - .../riak/core/AsyncRiakTemplateSpec.groovy | 87 -- .../keyvalue/riak/core/RiakBuilderSpec.groovy | 285 ------- .../riak/core/RiakClassLoaderSpec.groovy | 73 -- .../riak/core/RiakKeyValueTemplateSpec.groovy | 283 ------- .../riak/core/RiakTemplateSpec.groovy | 315 ------- .../data/keyvalue/riak/core/TestObject.java | 41 - .../src/test/resources/log4j.properties | 14 - .../data/AsyncRiakTemplateTests.xml | 34 - spring-data-riak/template.mf | 31 - .../RedisConnectionFailureException.java | 2 +- .../data}/redis/RedisSystemException.java | 6 +- .../redis/config/RedisCollectionParser.java | 4 +- .../config/RedisListenerContainerParser.java | 12 +- .../redis/config/RedisNamespaceHandler.java | 2 +- .../data}/redis/connection/DataType.java | 2 +- .../redis/connection/DefaultMessage.java | 2 +- .../connection/DefaultSortParameters.java | 2 +- .../DefaultStringRedisConnection.java | 10 +- .../redis/connection/DefaultStringTuple.java | 6 +- .../data}/redis/connection/DefaultTuple.java | 4 +- .../data}/redis/connection/Message.java | 2 +- .../redis/connection/MessageListener.java | 2 +- .../data}/redis/connection/RedisCommands.java | 2 +- .../redis/connection/RedisConnection.java | 2 +- .../connection/RedisConnectionCommands.java | 2 +- .../connection/RedisConnectionFactory.java | 2 +- .../redis/connection/RedisHashCommands.java | 2 +- .../RedisInvalidSubscriptionException.java | 2 +- .../redis/connection/RedisKeyCommands.java | 2 +- .../redis/connection/RedisListCommands.java | 2 +- .../redis/connection/RedisPubSubCommands.java | 2 +- .../redis/connection/RedisServerCommands.java | 2 +- .../redis/connection/RedisSetCommands.java | 2 +- .../redis/connection/RedisStringCommands.java | 2 +- .../RedisSubscribedConnectionException.java | 4 +- .../redis/connection/RedisTxCommands.java | 2 +- .../redis/connection/RedisZSetCommands.java | 2 +- .../redis/connection/SortParameters.java | 2 +- .../connection/StringRedisConnection.java | 8 +- .../data}/redis/connection/Subscription.java | 2 +- .../connection/jedis/JedisConnection.java | 18 +- .../jedis/JedisConnectionFactory.java | 6 +- .../jedis/JedisMessageListener.java | 6 +- .../connection/jedis/JedisSubscription.java | 6 +- .../redis/connection/jedis/JedisUtils.java | 20 +- .../redis/connection/jedis/package-info.java | 2 +- .../connection/jredis/JredisConnection.java | 19 +- .../jredis/JredisConnectionFactory.java | 6 +- .../redis/connection/jredis/JredisUtils.java | 12 +- .../redis/connection/jredis/package-info.java | 2 +- .../data}/redis/connection/package-info.java | 2 +- .../rjc/CloseSuppressingRjcConnection.java | 2 +- .../redis/connection/rjc/RjcConnection.java | 18 +- .../connection/rjc/RjcConnectionFactory.java | 8 +- .../connection/rjc/RjcMessageListener.java | 8 +- .../redis/connection/rjc/RjcSubscription.java | 6 +- .../data}/redis/connection/rjc/RjcUtils.java | 22 +- .../connection/rjc/SingleDataSource.java | 2 +- .../redis/connection/rjc/package-info.java | 2 +- .../connection/util/AbstractSubscription.java | 8 +- .../data}/redis/connection/util/Base64.java | 2 +- .../connection/util/ByteArrayWrapper.java | 2 +- .../redis/connection/util/DecodeUtils.java | 2 +- .../redis/connection/util/package-info.java | 2 +- .../data}/redis/core/AbstractOperations.java | 12 +- .../data}/redis/core/BoundHashOperations.java | 2 +- .../data}/redis/core/BoundKeyOperations.java | 4 +- .../data}/redis/core/BoundListOperations.java | 2 +- .../data}/redis/core/BoundSetOperations.java | 2 +- .../redis/core/BoundValueOperations.java | 2 +- .../data}/redis/core/BoundZSetOperations.java | 4 +- .../data}/redis/core/BulkMapper.java | 2 +- .../CloseSuppressingInvocationHandler.java | 4 +- .../core/DefaultBoundHashOperations.java | 4 +- .../redis/core/DefaultBoundKeyOperations.java | 2 +- .../core/DefaultBoundListOperations.java | 4 +- .../redis/core/DefaultBoundSetOperations.java | 4 +- .../core/DefaultBoundValueOperations.java | 4 +- .../core/DefaultBoundZSetOperations.java | 6 +- .../redis/core/DefaultHashOperations.java | 4 +- .../redis/core/DefaultListOperations.java | 6 +- .../redis/core/DefaultSetOperations.java | 4 +- .../data}/redis/core/DefaultTypedTuple.java | 4 +- .../redis/core/DefaultValueOperations.java | 4 +- .../redis/core/DefaultZSetOperations.java | 6 +- .../data}/redis/core/HashOperations.java | 2 +- .../redis/core/HashOperationsEditor.java | 2 +- .../data}/redis/core/ListOperations.java | 2 +- .../redis/core/ListOperationsEditor.java | 2 +- .../data}/redis/core/RedisAccessor.java | 4 +- .../data}/redis/core/RedisCallback.java | 4 +- .../redis/core/RedisConnectionUtils.java | 6 +- .../data}/redis/core/RedisOperations.java | 8 +- .../data}/redis/core/RedisTemplate.java | 22 +- .../data}/redis/core/SessionCallback.java | 2 +- .../data}/redis/core/SetOperations.java | 2 +- .../data}/redis/core/SetOperationsEditor.java | 2 +- .../data}/redis/core/StringRedisTemplate.java | 14 +- .../data}/redis/core/ValueOperations.java | 2 +- .../redis/core/ValueOperationsEditor.java | 2 +- .../data}/redis/core/ZSetOperations.java | 2 +- .../redis/core/ZSetOperationsEditor.java | 2 +- .../data}/redis/core/package-info.java | 2 +- .../core/query/DefaultSortCriterion.java | 6 +- .../redis/core/query/DefaultSortQuery.java | 6 +- .../data}/redis/core/query/QueryUtils.java | 8 +- .../data}/redis/core/query/SortCriterion.java | 6 +- .../data}/redis/core/query/SortQuery.java | 12 +- .../redis/core/query/SortQueryBuilder.java | 2 +- .../data/redis/core/query/package-info.java | 5 + .../data}/redis/hash/BeanUtilsHashMapper.java | 2 +- .../hash/DecoratingStringHashMapper.java | 2 +- .../data}/redis/hash/HashMapper.java | 2 +- .../data}/redis/hash/JacksonHashMapper.java | 2 +- .../data}/redis/hash/package-info.java | 2 +- .../data}/redis/listener/ChannelTopic.java | 2 +- .../data}/redis/listener/PatternTopic.java | 2 +- .../RedisMessageListenerContainer.java | 18 +- .../data}/redis/listener/Topic.java | 2 +- .../adapter/MessageListenerAdapter.java | 12 +- ...RedisListenerExecutionFailedException.java | 2 +- .../redis/listener/adapter/package-info.java | 2 +- .../data}/redis/listener/package-info.java | 2 +- .../data}/redis/package-info.java | 2 +- .../serializer/GenericToStringSerializer.java | 2 +- .../JacksonJsonRedisSerializer.java | 2 +- .../JdkSerializationRedisSerializer.java | 2 +- .../data}/redis/serializer/OxmSerializer.java | 2 +- .../redis/serializer/RedisSerializer.java | 2 +- .../serializer/SerializationException.java | 2 +- .../redis/serializer/SerializationUtils.java | 2 +- .../serializer/StringRedisSerializer.java | 2 +- .../data}/redis/serializer/package-info.java | 2 +- .../support/atomic/RedisAtomicInteger.java | 20 +- .../redis/support/atomic/RedisAtomicLong.java | 20 +- .../redis/support/atomic/package-info.java | 2 +- .../collections/AbstractRedisCollection.java | 4 +- .../support/collections/CollectionUtils.java | 6 +- .../support/collections/DefaultRedisList.java | 8 +- .../support/collections/DefaultRedisMap.java | 8 +- .../support/collections/DefaultRedisSet.java | 8 +- .../support/collections/DefaultRedisZSet.java | 10 +- .../support/collections/RedisCollection.java | 2 +- .../RedisCollectionFactoryBean.java | 6 +- .../support/collections/RedisIterator.java | 2 +- .../redis/support/collections/RedisList.java | 2 +- .../redis/support/collections/RedisMap.java | 2 +- .../support/collections/RedisProperties.java | 8 +- .../redis/support/collections/RedisSet.java | 2 +- .../redis/support/collections/RedisStore.java | 6 +- .../redis/support/collections/RedisZSet.java | 4 +- .../support/collections/package-info.java | 12 + .../data}/redis/support/package-info.java | 2 +- .../main/resources/META-INF/spring.handlers | 2 +- src/main/resources/META-INF/spring.schemas | 2 + .../main/resources/META-INF/spring.tooling | 2 +- .../data}/redis/config/spring-redis-1.0.xsd | 12 +- .../data}/redis/config/spring-redis.gif | Bin .../springframework/data}/redis/Address.java | 2 +- .../data}/redis/ConnectionFactoryTracker.java | 4 +- .../springframework/data}/redis/Person.java | 2 +- .../data}/redis/PropertyEditorsTest.java | 8 +- .../data}/redis/RedisViewPE.java | 12 +- .../data}/redis/SettingsUtils.java | 4 +- .../data}/redis/config/NamespaceTest.java | 11 +- .../data}/redis/config/StubErrorHandler.java | 2 +- .../AbstractConnectionIntegrationTests.java | 22 +- .../JedisConnectionIntegrationTests.java | 9 +- .../JRedisConnectionIntegrationTests.java | 9 +- .../rjc/RjcConnectionIntegrationTests.java | 9 +- .../data}/redis/core/SessionTest.java | 11 +- .../data}/redis/core/SortTest.java | 4 +- .../data}/redis/core/TemplateTest.java | 9 +- .../redis/listener/PubSubTestParams.java | 20 +- .../data}/redis/listener/PubSubTests.java | 12 +- .../adapter/ContainerXmlSetupTest.java | 8 +- .../listener/adapter/MessageListenerTest.java | 13 +- .../redis/listener/adapter/RedisMDP.java | 2 +- .../adapter/ThrowableMessageListener.java | 6 +- .../redis/mapping/AbstractHashMapperTest.java | 8 +- .../mapping/BeanUtilsHashMapperTest.java | 6 +- .../redis/mapping/JacksonHashMapperTest.java | 6 +- .../SimpleRedisSerializerTests.java | 10 +- .../redis/support/BoundKeyOperationsTest.java | 10 +- .../data}/redis/support/BoundKeyParams.java | 24 +- .../support/atomic/AtomicCountersParam.java | 6 +- .../support/atomic/RedisAtomicTests.java | 10 +- .../AbstractRedisCollectionTests.java | 12 +- .../collections/AbstractRedisListTests.java | 6 +- .../collections/AbstractRedisMapTests.java | 15 +- .../collections/AbstractRedisSetTests.java | 8 +- .../collections/AbstractRedisZSetTest.java | 8 +- .../collections/CollectionTestParams.java | 20 +- .../support/collections/ObjectFactory.java | 2 +- .../collections/PersonObjectFactory.java | 6 +- .../RedisCollectionFactoryBeanTests.java | 22 +- .../support/collections/RedisListTests.java | 10 +- .../support/collections/RedisMapTests.java | 20 +- .../collections/RedisPropertiesTests.java | 28 +- .../support/collections/RedisSetTests.java | 10 +- .../support/collections/RedisZSetTests.java | 7 +- .../collections/StringObjectFactory.java | 2 +- .../support/collections/SupportXmlTests.java | 4 +- .../test/resources/log4j.properties | 0 .../data}/redis/config/namespace.xml | 12 +- .../data}/redis/listener/container.xml | 10 +- .../org/springframework/data}/redis/pe.xml | 6 +- .../redis/support/collections/container.xml | 4 +- .../support/collections/props.properties | 0 .../data}/redis/support/collections/props.xml | 0 .../data}/redis/test.properties | 0 spring-data-redis/template.mf => template.mf | 4 +- 293 files changed, 794 insertions(+), 8579 deletions(-) create mode 100644 .classpath create mode 100644 .project rename {spring-data-redis/.settings => .settings}/org.eclipse.jdt.core.prefs (94%) delete mode 100644 .settings/org.maven.ide.eclipse.prefs create mode 100644 docs/.classpath rename {spring-data-keyvalue-core => docs}/.project (78%) delete mode 100644 spring-data-keyvalue-core/.classpath delete mode 100644 spring-data-keyvalue-core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 spring-data-keyvalue-core/build.gradle delete mode 100644 spring-data-keyvalue-core/src/main/java/org/springframework/data/keyvalue/UncategorizedKeyvalueStoreException.java delete mode 100644 spring-data-keyvalue-core/template.mf delete mode 100644 spring-data-redis/.classpath delete mode 100644 spring-data-redis/.gitignore delete mode 100644 spring-data-redis/.project delete mode 100644 spring-data-redis/build.gradle delete mode 100644 spring-data-redis/gradle.properties delete mode 100644 spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/package-info.java delete mode 100644 spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/package-info.java delete mode 100644 spring-data-redis/src/main/resources/META-INF/spring.schemas delete mode 100644 spring-data-riak/README.md delete mode 100644 spring-data-riak/build.gradle delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreConnectionFailureException.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreOperationException.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/convert/KeyValueStoreMetaData.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AbstractRiakTemplate.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncBucketKeyValueStoreOperations.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncKeyValueStoreOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplate.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyPair.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyResolver.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyValueStoreOperations.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreMetaData.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreOperations.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreValue.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/QosParameters.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplate.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakMetaData.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakQosParameters.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakTemplate.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakValue.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyPair.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyResolver.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakFile.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakInputStream.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakOutputStream.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakResource.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/overview.html delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/overview.html delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakBuilder.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakMapReduceOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/overview.html delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AbstractRiakMapReduceJob.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncMapReduceOperations.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncRiakMapReduceJob.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/ErlangMapReduceOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/JavascriptMapReduceOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceJob.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceLinkOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperation.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperations.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReducePhase.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReduceJob.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReducePhase.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/overview.html delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/overview.html delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/Ignore404sErrorHandler.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassFileLoader.java delete mode 100644 spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassLoader.java delete mode 100644 spring-data-riak/src/main/resources/META-INF/spring/app-context.xml delete mode 100644 spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.class delete mode 100644 spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.java delete mode 100644 spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplateSpec.groovy delete mode 100644 spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakBuilderSpec.groovy delete mode 100644 spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakClassLoaderSpec.groovy delete mode 100644 spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplateSpec.groovy delete mode 100644 spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakTemplateSpec.groovy delete mode 100644 spring-data-riak/src/test/java/org/springframework/data/keyvalue/riak/core/TestObject.java delete mode 100644 spring-data-riak/src/test/resources/log4j.properties delete mode 100644 spring-data-riak/src/test/resources/org/springframework/data/AsyncRiakTemplateTests.xml delete mode 100644 spring-data-riak/template.mf rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/RedisConnectionFailureException.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/RedisSystemException.java (80%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/config/RedisCollectionParser.java (91%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/config/RedisListenerContainerParser.java (91%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/config/RedisNamespaceHandler.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/DataType.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/DefaultMessage.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/DefaultSortParameters.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/DefaultStringRedisConnection.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/DefaultStringTuple.java (85%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/DefaultTuple.java (88%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/Message.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/MessageListener.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisCommands.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisConnection.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisConnectionCommands.java (93%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisConnectionFactory.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisHashCommands.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisInvalidSubscriptionException.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisKeyCommands.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisListCommands.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisPubSubCommands.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisServerCommands.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisSetCommands.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisStringCommands.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisSubscribedConnectionException.java (90%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisTxCommands.java (93%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/RedisZSetCommands.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/SortParameters.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/StringRedisConnection.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/Subscription.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jedis/JedisConnection.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jedis/JedisConnectionFactory.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jedis/JedisMessageListener.java (88%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jedis/JedisSubscription.java (88%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jedis/JedisUtils.java (89%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jedis/package-info.java (59%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jredis/JredisConnection.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jredis/JredisConnectionFactory.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jredis/JredisUtils.java (89%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/jredis/package-info.java (59%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/package-info.java (79%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/CloseSuppressingRjcConnection.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/RjcConnection.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/RjcConnectionFactory.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/RjcMessageListener.java (79%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/RjcSubscription.java (88%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/RjcUtils.java (87%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/SingleDataSource.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/rjc/package-info.java (59%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/util/AbstractSubscription.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/util/Base64.java (99%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/util/ByteArrayWrapper.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/util/DecodeUtils.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/connection/util/package-info.java (60%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/AbstractOperations.java (92%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BoundHashOperations.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BoundKeyOperations.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BoundListOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BoundSetOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BoundValueOperations.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BoundZSetOperations.java (93%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/BulkMapper.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/CloseSuppressingInvocationHandler.java (93%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultBoundHashOperations.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultBoundKeyOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultBoundListOperations.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultBoundSetOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultBoundValueOperations.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultBoundZSetOperations.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultHashOperations.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultListOperations.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultSetOperations.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultTypedTuple.java (89%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultValueOperations.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/DefaultZSetOperations.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/HashOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/HashOperationsEditor.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/ListOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/ListOperationsEditor.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/RedisAccessor.java (92%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/RedisCallback.java (91%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/RedisConnectionUtils.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/RedisOperations.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/RedisTemplate.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/SessionCallback.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/SetOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/SetOperationsEditor.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/StringRedisTemplate.java (79%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/ValueOperations.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/ValueOperationsEditor.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/ZSetOperations.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/ZSetOperationsEditor.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/package-info.java (77%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/query/DefaultSortCriterion.java (89%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/query/DefaultSortQuery.java (88%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/query/QueryUtils.java (84%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/query/SortCriterion.java (82%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/query/SortQuery.java (79%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/core/query/SortQueryBuilder.java (94%) create mode 100644 src/main/java/org/springframework/data/redis/core/query/package-info.java rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/hash/BeanUtilsHashMapper.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/hash/DecoratingStringHashMapper.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/hash/HashMapper.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/hash/JacksonHashMapper.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/hash/package-info.java (69%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/ChannelTopic.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/PatternTopic.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/RedisMessageListenerContainer.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/Topic.java (93%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/adapter/MessageListenerAdapter.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/adapter/RedisListenerExecutionFailedException.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/adapter/package-info.java (77%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/listener/package-info.java (58%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/package-info.java (82%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/GenericToStringSerializer.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/JacksonJsonRedisSerializer.java (98%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/JdkSerializationRedisSerializer.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/OxmSerializer.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/RedisSerializer.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/SerializationException.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/SerializationUtils.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/StringRedisSerializer.java (96%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/serializer/package-info.java (62%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/atomic/RedisAtomicInteger.java (89%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/atomic/RedisAtomicLong.java (89%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/atomic/package-info.java (56%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/AbstractRedisCollection.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/CollectionUtils.java (93%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/DefaultRedisList.java (97%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/DefaultRedisMap.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/DefaultRedisSet.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/DefaultRedisZSet.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisCollection.java (92%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisCollectionFactoryBean.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisIterator.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisList.java (94%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisMap.java (92%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisProperties.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisSet.java (95%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisStore.java (83%) rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/collections/RedisZSet.java (96%) create mode 100644 src/main/java/org/springframework/data/redis/support/collections/package-info.java rename {spring-data-redis/src/main/java/org/springframework/data/keyvalue => src/main/java/org/springframework/data}/redis/support/package-info.java (61%) rename {spring-data-redis/src => src}/main/resources/META-INF/spring.handlers (56%) create mode 100644 src/main/resources/META-INF/spring.schemas rename {spring-data-redis/src => src}/main/resources/META-INF/spring.tooling (82%) rename {spring-data-redis/src/main/resources/org/springframework/data/keyvalue => src/main/resources/org/springframework/data}/redis/config/spring-redis-1.0.xsd (94%) rename {spring-data-redis/src/main/resources/org/springframework/data/keyvalue => src/main/resources/org/springframework/data}/redis/config/spring-redis.gif (100%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/Address.java (97%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/ConnectionFactoryTracker.java (92%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/Person.java (98%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/PropertyEditorsTest.java (89%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/RedisViewPE.java (82%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/SettingsUtils.java (92%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/config/NamespaceTest.java (86%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/config/StubErrorHandler.java (94%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/connection/AbstractConnectionIntegrationTests.java (90%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/connection/jedis/JedisConnectionIntegrationTests.java (87%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/connection/jredis/JRedisConnectionIntegrationTests.java (85%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/connection/rjc/RjcConnectionIntegrationTests.java (80%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/core/SessionTest.java (78%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/core/SortTest.java (87%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/core/TemplateTest.java (82%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/listener/PubSubTestParams.java (75%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/listener/PubSubTests.java (88%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/listener/adapter/ContainerXmlSetupTest.java (80%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/listener/adapter/MessageListenerTest.java (85%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/listener/adapter/RedisMDP.java (93%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/listener/adapter/ThrowableMessageListener.java (81%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/mapping/AbstractHashMapperTest.java (84%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/mapping/BeanUtilsHashMapperTest.java (83%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/mapping/JacksonHashMapperTest.java (80%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/serializer/SimpleRedisSerializerTests.java (91%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/BoundKeyOperationsTest.java (87%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/BoundKeyParams.java (68%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/atomic/AtomicCountersParam.java (87%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/atomic/RedisAtomicTests.java (88%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/AbstractRedisCollectionTests.java (94%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/AbstractRedisListTests.java (97%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/AbstractRedisMapTests.java (94%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/AbstractRedisSetTests.java (94%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/AbstractRedisZSetTest.java (96%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/CollectionTestParams.java (89%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/ObjectFactory.java (91%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/PersonObjectFactory.java (83%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/RedisCollectionFactoryBeanTests.java (76%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/RedisListTests.java (76%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/RedisMapTests.java (89%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/RedisPropertiesTests.java (91%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/RedisSetTests.java (76%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/RedisZSetTests.java (79%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/StringObjectFactory.java (92%) rename {spring-data-redis/src/test/java/org/springframework/data/keyvalue => src/test/java/org/springframework/data}/redis/support/collections/SupportXmlTests.java (88%) rename {spring-data-redis/src => src}/test/resources/log4j.properties (100%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/config/namespace.xml (68%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/listener/container.xml (58%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/pe.xml (60%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/support/collections/container.xml (71%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/support/collections/props.properties (100%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/support/collections/props.xml (100%) rename {spring-data-redis/src/test/resources/org/springframework/data/keyvalue => src/test/resources/org/springframework/data}/redis/test.properties (100%) rename spring-data-redis/template.mf => template.mf (90%) diff --git a/.classpath b/.classpath new file mode 100644 index 000000000..23fb3b56a --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.gitignore b/.gitignore index de8921796..5c643ec33 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ src/ant/.ant-targets-upload-dist.xml *.iml *.ipr *.iws +*.log diff --git a/.project b/.project new file mode 100644 index 000000000..97c950f78 --- /dev/null +++ b/.project @@ -0,0 +1,34 @@ + + + spring-data-redis + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + com.springsource.sts.gradle.core.nature + org.eclipse.jdt.core.javanature + + + + 1309881117241 + + 10 + + org.eclipse.ui.ide.orFilterMatcher + + + org.eclipse.ui.ide.multiFilter + 1.0-projectRelativePath-equals-true-false-E:docs + + + + + + diff --git a/spring-data-redis/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs similarity index 94% rename from spring-data-redis/.settings/org.eclipse.jdt.core.prefs rename to .settings/org.eclipse.jdt.core.prefs index 9811d21e9..429280cd1 100644 --- a/spring-data-redis/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,13 +1,12 @@ -# -#Fri Jul 01 15:44:20 EEST 2011 -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.debug.lineNumber=generate +#Tue Jul 05 18:51:57 EEST 2011 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/.settings/org.maven.ide.eclipse.prefs b/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index fc929aaef..000000000 --- a/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#Mon Oct 11 17:02:20 EDT 2010 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -skipCompilerPlugin=true -version=1 diff --git a/README.md b/README.md index 60347ea60..acc1b8830 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,9 @@ For those in a hurry: xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + - diff --git a/build.gradle b/build.gradle index 2546282d0..bb051fa3c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // used for artifact names, building doc upload urls, etc. -description = 'Spring Data Key Value' -abbreviation = 'DATAKV' +description = 'Spring Data Redis' +abbreviation = 'DATAREDIS' apply plugin: 'base' apply plugin: 'idea' @@ -30,7 +30,7 @@ buildscript { } allprojects { - group = 'org.springframework.data' + group = 'org.springframework.data.redis' version = '1.0.0.BUILD-SNAPSHOT' releaseBuild = version.endsWith('RELEASE') @@ -48,49 +48,63 @@ allprojects { mavenRepo name: "sonatype-snapshot", urls: "http://oss.sonatype.org/content/repositories/snapshots" mavenRepo name: "jboss", urls: "http://repository.jboss.org/maven2/" mavenRepo name: "java.net", urls: "http://download.java.net/maven/2/" + mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/" } + } -javaprojects = subprojects.findAll { - project -> project.path.startsWith(':spring-data-') + +apply plugin: "java" +apply plugin: "maven" +apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project +apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml +apply plugin: 'docbook' +apply plugin: 'bundlor' // all core projects should be OSGi-compliant + +bundlor.useProjectProps = true +[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"] + +// Common dependencies +dependencies { + // Logging + compile "org.slf4j:slf4j-api:$slf4jVersion" + compile "org.slf4j:jcl-over-slf4j:$slf4jVersion" + runtime "log4j:log4j:$log4jVersion" + runtime "org.slf4j:slf4j-log4j12:$slf4jVersion" + + // Spring Framework + compile("org.springframework:spring-core:$springVersion") { + exclude module: "commons-logging" + } + compile "org.springframework:spring-beans:$springVersion" + compile "org.springframework:spring-context:$springVersion" + compile "org.springframework:spring-context-support:$springVersion" + compile "org.springframework:spring-tx:$springVersion" + compile("org.springframework:spring-oxm:$springVersion") { optional = true } + + // Redis Drivers + compile "redis.clients:jedis:$jedisVersion" + compile("org.jredis:jredis-anthonylauzon:$jredisVersion") { optional = true } + compile("org.idevlab:rjc:$rjcVersion") { optional = true } + + // Mappers + compile("org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion") { optional = true } + compile("commons-beanutils:commons-beanutils-core:1.8.3") { optional = true } + + // Testing + testCompile "junit:junit:$junitVersion" + testCompile "org.springframework:spring-test:$springVersion" + testCompile "org.mockito:mockito-all:$mockitoVersion" + testCompile("javax.annotation:jsr250-api:1.0") { optional = true } + testCompile("com.thoughtworks.xstream:xstream:1.3") { optional = true } } -configure(javaprojects) { - apply plugin: "java" - apply plugin: "maven" - apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project - apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml - apply plugin: 'docbook' - apply plugin: 'bundlor' // all core projects should be OSGi-compliant +javaprojects = rootProject - bundlor.useProjectProps = true - [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"] - - // Common dependencies - dependencies { - // Logging - compile "org.slf4j:slf4j-api:$slf4jVersion" - compile "org.slf4j:jcl-over-slf4j:$slf4jVersion" - runtime "log4j:log4j:$log4jVersion" - runtime "org.slf4j:slf4j-log4j12:$slf4jVersion" - // Spring Framework - compile("org.springframework:spring-core:$springVersion") { - exclude module: "commons-logging" - } - compile "org.springframework:spring-beans:$springVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-context-support:$springVersion" - compile "org.springframework:spring-tx:$springVersion" - // Jackson JSON Mapper - compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion" - // Testing - testCompile "junit:junit:$junitVersion" - testCompile "org.springframework:spring-test:$springVersion" - testCompile "org.mockito:mockito-all:$mockitoVersion" - } - - apply from: "$rootDir/maven.gradle" -} +sourceCompatibility = 1.6 +targetCompatibility = 1.6 + +apply from: "$rootDir/maven.gradle" ideaProject { withXml { provider -> @@ -122,9 +136,6 @@ task dist(type: Zip) { include 'reference/**/*' include 'api/**/*' } - into('dist') { - from javaprojects.collect {project -> project.libsDir } - } } doLast { ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1') @@ -137,4 +148,6 @@ task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload, dependsOn archiveFile = dist.archivePath projectKey = 'DATAKV' projectName = 'Spring Data Key Value' -} \ No newline at end of file +} + +defaultTasks 'clean', 'build' \ No newline at end of file diff --git a/docs/.classpath b/docs/.classpath new file mode 100644 index 000000000..0e5f210c1 --- /dev/null +++ b/docs/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/spring-data-keyvalue-core/.project b/docs/.project similarity index 78% rename from spring-data-keyvalue-core/.project rename to docs/.project index 145c84059..b14fc0d5c 100644 --- a/spring-data-keyvalue-core/.project +++ b/docs/.project @@ -1,6 +1,6 @@ - spring-data-core + spring-data-redis.docs @@ -12,6 +12,7 @@ + com.springsource.sts.gradle.core.nature org.eclipse.jdt.core.javanature diff --git a/docs/build.gradle b/docs/build.gradle index ebdf04155..8c8c2156c 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -1,4 +1,3 @@ -import org.apache.tools.ant.filters.FixCrLfFilter import org.apache.tools.ant.filters.ReplaceTokens // ----------------------------------------------------------------------------- @@ -10,7 +9,6 @@ apply plugin: 'docbook' assemble.dependsOn = ['api', 'docbook'] - [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.group = 'Documentation' [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'index.xml' [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceDirectory = new File(projectDir, 'src/reference/docbook') @@ -46,7 +44,6 @@ task reference (type: Copy) { dependsOn 'docbook' description = "Builds aggregated DocBook" group = "Documentation" - logger.info("Version is " + version) destinationDir = buildDir with(refSpec) } @@ -71,9 +68,7 @@ task api(type: Javadoc) { breakIterator = true showFromProtected() groups = [ - 'Spring Data Key Value Core': ['org.springframework.data.keyvalue*'], - 'Spring Data Redis Support' : ['org.springframework.data.keyvalue.redis*'], - 'Spring Data Riak Support' : ['org.springframework.data.keyvalue.riak*'] + 'Spring Data Redis Support' : ['org.springframework.data.redis*'], ] links = [ diff --git a/docs/src/api/javadoc.options b/docs/src/api/javadoc.options index 04964ca74..432e5b85e 100644 --- a/docs/src/api/javadoc.options +++ b/docs/src/api/javadoc.options @@ -5,9 +5,9 @@ -quiet -docfilessubdirs -group "Spring Data Key Value Core" "org.springframework.data.keyvalue*" --group "Spring Data Redis Support" "org.springframework.data.keyvalue.redis*" +-group "Spring Data Redis Support" "org.springframework.data.redis*" -group "Spring Data Riak Support" "org.springframework.data.keyvalue.riak*" -link http://static.springframework.org/spring/docs/3.0.x/javadoc-api -link http://download.oracle.com/javase/6/docs/api/ --exclude org.springframework.data.keyvalue.redis.config +-exclude org.springframework.data.redis.config diff --git a/docs/src/reference/docbook/reference/redis-messaging.xml b/docs/src/reference/docbook/reference/redis-messaging.xml index 7bfbc8508..e7b21e9b7 100644 --- a/docs/src/reference/docbook/reference/redis-messaging.xml +++ b/docs/src/reference/docbook/reference/redis-messaging.xml @@ -15,8 +15,8 @@ listener containers that is used to create Message-Driven POJOs (MDPs) and for synchronous reception, the RedisConnection contract. - The package org.springframework.data.keyvalue.redis.connection and - org.springframework.data.keyvalue.redis.listener provide + The package org.springframework.data.redis.connection and + org.springframework.data.redis.listener provide the core functionality for using Redis messaging.
@@ -168,20 +168,20 @@ template.convertAndSend("hello!", "world");]]> is displayed below: <!-- this is the Message Driven POJO (MDP) --> -<bean id="messageListener" class="org.springframework.data.keyvalue.redis.listener.adapter.MessageListenerAdapter"> +<bean id="messageListener" class="org.springframework.data.redis.listener.adapter.MessageListenerAdapter"> <constructor-arg> <bean class="redisexample.DefaultMessageDelegate"/> </constructor-arg> </bean> <!-- and this is the message listener container... --> -<bean id="redisContainer" class="org.springframework.data.keyvalue.redis.listener.RedisMessageListenerContainer"> +<bean id="redisContainer" class="org.springframework.data.redis.listener.RedisMessageListenerContainer"> <property name="connectionFactory" ref="connectionFactory"/> <property name="messageListeners"> <!-- map of listeners and their associated topics (channels or/and patterns) --> <map> <entry key-ref="messageListener"> - <bean class="org.springframework.data.keyvalue.redis.listener.ChannelTopic"> + <bean class="org.springframework.data.redis.listener.ChannelTopic"> <constructor-arg value="chatroom"> </bean> </entry> diff --git a/docs/src/reference/docbook/reference/redis.xml b/docs/src/reference/docbook/reference/redis.xml index df2ece116..607dc2cca 100644 --- a/docs/src/reference/docbook/reference/redis.xml +++ b/docs/src/reference/docbook/reference/redis.xml @@ -46,7 +46,7 @@ One of the first tasks when using Redis and Spring is to connect to the store through the IoC container. To do that, a Java connector (or binding) is required; currently SDKV has support for Jedis and JRedis. No matter the library one chooses, there only one set of SDKV API that one needs to use that behaves consistently - across all connectors, namely the org.springframework.data.keyvalue.redis.connection package and its + across all connectors, namely the org.springframework.data.redis.connection package and its RedisConnection and RedisConnectionFactory interfaces for working respectively for retrieving active connection to Redis. @@ -86,7 +86,7 @@ Configuring Jedis connector Jedis is one of the connectors supported by the Key Value module through the - org.springframework.data.keyvalue.redis.connection.jedis package. In its simples form, the Jedis configuration looks as follow: + org.springframework.data.redis.connection.jedis package. In its simples form, the Jedis configuration looks as follow: - + ]]> For production use however, one might want to tweak the settings such as the host or password: @@ -107,7 +107,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - ]]> @@ -117,7 +117,7 @@ Configuring JRedis connector JRedis is another popular, open-source connector supported by SDKV through the - org.springframework.data.keyvalue.redis.connection.jredis package. + org.springframework.data.redis.connection.jredis package. Since JRedis itself does not support (yet) Redis 2.x commands, SDKV uses an updated fork available here. @@ -130,7 +130,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - ]]> @@ -149,7 +149,7 @@ Configuring RJC connector RJC is the third, open-source connector supported by SDKV through the - org.springframework.data.keyvalue.redis.connection.rjc package. + org.springframework.data.redis.connection.rjc package. Similar to the other connectors, a typical RJC configuration can looks like this: @@ -160,7 +160,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - ]]> @@ -180,7 +180,7 @@
Working with Objects through <classname>RedisTemplate</classname> - Most users are likely to use RedisTemplate and its coresponding package org.springframework.data.keyvalue.redis.core - the + Most users are likely to use RedisTemplate and its coresponding package org.springframework.data.redis.core - the template is in fact the central class of the Redis module due to its rich feature set. The template offers a high-level abstraction for Redis interaction - while RedisConnection offer low level methods that accept and return binary values (byte arrays), the template takes care of serialization and connection management, freeing the user from dealing with such details. @@ -256,7 +256,7 @@ Out of the box, RedisTemplate uses a Java-based serializer for most of its operations. This means that any object written or read by the template will be serializer/deserialized through Java. The serialization mechanism can be easily changed on the template and the Redis module offers several implementations available in the - org.springframework.data.keyvalue.redis.serializer package - see for more information. + org.springframework.data.redis.serializer package - see for more information. Note that the template requires all keys to be non-null - values can be null as long as the underlying serializer accepts them; read the javadoc of each serializer for more information. @@ -270,11 +270,11 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - - ... @@ -314,10 +314,10 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - - ... @@ -355,7 +355,7 @@ From the framework perspective, the data stored in Redis are just bytes. While Redis itself supports various types, for the most part these refer to the way the data is stored rather then what it represents. It is up to the user to decide whether the information gets translated into Strings or any other objects. The conversion between the user (custom) types and raw data (and vice-versa) is handled in SDKV Redis through the RedisSerializer interface - (package org.springframework.data.keyvalue.redis.serializer) which as the name implies, takes care of the serialization process. Multiple implementations are + (package org.springframework.data.redis.serializer) which as the name implies, takes care of the serialization process. Multiple implementations are available out of the box, two of which have been already mentioned before in this documentation: the StringRedisSerializer and the JdkSerializationRedisSerializer. However one can use OxmSerializer for Object/XML mapping through Spring 3 OXM support or JacksonJsonRedisSerializer for storing @@ -368,7 +368,7 @@
Support Classes - Package org.springframework.data.keyvalue.redis.support offers various reusable components that rely on Redis as a backing store. Curently the package contains + Package org.springframework.data.redis.support offers various reusable components that rely on Redis as a backing store. Curently the package contains various JDK-based interface implementations on top of Redis such as atomic counters and JDK Collections. @@ -385,7 +385,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> - + diff --git a/gradle.properties b/gradle.properties index f5a5999b1..97bec7ca3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,9 +12,22 @@ jacksonVersion = 1.6.4 junitVersion = 4.8.1 mockitoVersion = 1.8.5 +# Drivers +jedisVersion = 2.0.0 +jredisVersion = 03122010 +rjcVersion= 0.6.4 + +# Manifest properties + +## OSGi ranges +spring.range = "[3.0.0, 4.0.0)" +jedis.range = "[2.0.0, 2.0.0]" +jackson.range = "[1.6, 2.0.0)" +rjc.range = "[0.6.4, 0.6.4]" # -------------------- # Project wide version # -------------------- springDataKeyValueVersion=1.0.0.BUILD-SNAPSHOT -version = 'springDataKeyValueVersion' \ No newline at end of file +version = 'springDataKeyValueVersion' + diff --git a/settings.gradle b/settings.gradle index 78739438f..bb02d8dfa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,5 @@ -rootProject.name = 'spring-data-key-value' +rootProject.name = 'spring-data-redis' include 'docs' -include "spring-data-keyvalue-core", - "spring-data-redis", - "spring-data-riak" - + docs = findProject(':docs') \ No newline at end of file diff --git a/spring-data-keyvalue-core/.classpath b/spring-data-keyvalue-core/.classpath deleted file mode 100644 index e49979c1c..000000000 --- a/spring-data-keyvalue-core/.classpath +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-data-keyvalue-core/.settings/org.eclipse.jdt.core.prefs b/spring-data-keyvalue-core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f924903e3..000000000 --- a/spring-data-keyvalue-core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -# -#Thu Apr 21 21:26:44 EEST 2011 -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error diff --git a/spring-data-keyvalue-core/build.gradle b/spring-data-keyvalue-core/build.gradle deleted file mode 100644 index e69de29bb..000000000 diff --git a/spring-data-keyvalue-core/src/main/java/org/springframework/data/keyvalue/UncategorizedKeyvalueStoreException.java b/spring-data-keyvalue-core/src/main/java/org/springframework/data/keyvalue/UncategorizedKeyvalueStoreException.java deleted file mode 100644 index c65d6ac1f..000000000 --- a/spring-data-keyvalue-core/src/main/java/org/springframework/data/keyvalue/UncategorizedKeyvalueStoreException.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue; - -import org.springframework.dao.UncategorizedDataAccessException; - -public class UncategorizedKeyvalueStoreException extends UncategorizedDataAccessException { - - public UncategorizedKeyvalueStoreException(String msg, Throwable cause) { - super(msg, cause); - } - -} diff --git a/spring-data-keyvalue-core/template.mf b/spring-data-keyvalue-core/template.mf deleted file mode 100644 index d553c5f67..000000000 --- a/spring-data-keyvalue-core/template.mf +++ /dev/null @@ -1,19 +0,0 @@ -Bundle-SymbolicName: org.springframework.data.keyvalue -Bundle-Name: Spring data Key-Value -Bundle-Vendor: SpringSource -Bundle-ManifestVersion: 2 -Import-Package: - sun.reflect;version="0";resolution:=optional -Import-Template: - org.springframework.beans.*;version="[3.0.0, 4.0.0)", - org.springframework.core.*;version="[3.0.0, 4.0.0)", - org.springframework.dao.*;version="[3.0.0, 4.0.0)", - org.springframework.util.*;version="[3.0.0, 4.0.0)", - org.springframework.data.core.*;version="[1.0.0, 2.0.0)", - org.springframework.data.core.*;version="[1.0.0, 2.0.0)", - org.springframework.data.persistence.*;version="[1.0.0, 2.0.0)", - org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional, - org.apache.commons.logging.*;version="[1.1.1, 2.0.0)", - org.w3c.dom.*;version="0" - - diff --git a/spring-data-redis/.classpath b/spring-data-redis/.classpath deleted file mode 100644 index 3848cd547..000000000 --- a/spring-data-redis/.classpath +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-data-redis/.gitignore b/spring-data-redis/.gitignore deleted file mode 100644 index 7ee4e668b..000000000 --- a/spring-data-redis/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ - -*.log \ No newline at end of file diff --git a/spring-data-redis/.project b/spring-data-redis/.project deleted file mode 100644 index 7ab2483ad..000000000 --- a/spring-data-redis/.project +++ /dev/null @@ -1,16 +0,0 @@ - - - spring-data-redis - - - - org.eclipse.jdt.core.javanature - - - - org.eclipse.jdt.core.javabuilder - - - - - diff --git a/spring-data-redis/build.gradle b/spring-data-redis/build.gradle deleted file mode 100644 index cd6427bf6..000000000 --- a/spring-data-redis/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -repositories { - mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/" -} - -dependencies { - compile project(":spring-data-keyvalue-core") - compile "redis.clients:jedis:$jedisVersion" - compile("org.jredis:jredis-anthonylauzon:$jredisVersion") { optional = true } - compile("org.idevlab:rjc:$rjcVersion") { optional = true } - compile("org.springframework:spring-oxm:$springVersion") { optional = true } - compile("commons-beanutils:commons-beanutils-core:1.8.3") { optional = true } - testCompile("javax.annotation:jsr250-api:1.0") { optional = true } - testCompile("com.thoughtworks.xstream:xstream:1.3") { optional = true } -} - -sourceCompatibility = 1.6 -targetCompatibility = 1.6 \ No newline at end of file diff --git a/spring-data-redis/gradle.properties b/spring-data-redis/gradle.properties deleted file mode 100644 index 74a43fc38..000000000 --- a/spring-data-redis/gradle.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Dependencies properties -jedisVersion = 2.0.0 -jredisVersion = 03122010 -rjcVersion= 0.6.4 - - -# Manifest properties - -## OSGi ranges -spring.range = "[3.0.0, 4.0.0)" -jedis.range = "[2.0.0, 2.0.0]" -jackson.range = "[1.6, 2.0.0)" -rjc.range = "[0.6.4, 0.6.4]" diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/package-info.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/package-info.java deleted file mode 100644 index 3a0c87b28..000000000 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Query package for Redis template. - */ -package org.springframework.data.keyvalue.redis.core.query; - diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/package-info.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/package-info.java deleted file mode 100644 index e00eeab04..000000000 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/package-info.java +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Package providing implementations for most of the {@code java.util} collections on top of Redis. - *

- * For indexed collections, such as {@link java.util.List}, {@link java.util.Queue} or {@link java.util.Deque} - * consider {@link org.springframework.data.keyvalue.redis.support.collections.RedisList}.

- * For collections without duplicates the obvious candidate is {@link org.springframework.data.keyvalue.redis.support.collections.RedisSet}. Use - * {@link org.springframework.data.keyvalue.redis.support.collections.RedisZSet} if a - * certain order is required.

- * Lastly, for key/value associations {@link org.springframework.data.keyvalue.redis.support.collections.RedisMap} providing a Map-like abstraction on top of a Redis hash. - */ -package org.springframework.data.keyvalue.redis.support.collections; - diff --git a/spring-data-redis/src/main/resources/META-INF/spring.schemas b/spring-data-redis/src/main/resources/META-INF/spring.schemas deleted file mode 100644 index fea927201..000000000 --- a/spring-data-redis/src/main/resources/META-INF/spring.schemas +++ /dev/null @@ -1,2 +0,0 @@ -http\://www.springframework.org/schema/redis/spring-redis-1.0.xsd=org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd -http\://www.springframework.org/schema/redis/spring-redis.xsd=org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd \ No newline at end of file diff --git a/spring-data-riak/README.md b/spring-data-riak/README.md deleted file mode 100644 index 33f5303de..000000000 --- a/spring-data-riak/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# Spring Data support for Riak - -The spring-data-riak module strives to make working with Riak painless by providing -the developer several different ways to easily access or store data using the Riak -Key/Value store. - -## Recent Changes: - -* 12/22/2010: Added async Map/Reduce support to AsyncRiakTemplate and Groovy DSL -* 12/20/2010: AsyncRiakTemplate and Groovy DSL - -### Groovy DSL - -One cool new feature just added is a Groovy DSL for data access using SDKV/Riak: - - def riak = new RiakBuilder(riakTemplate) - def result = null - - riak.set(bucket: "test", key: "test", qos: [dw: "all"], value: obj, wait: 3000L) { - completed(when: { it.integer == 12 }) { result = it.test } - completed { result = "otherwise" } - - failed { it.printStackTrace() } - } - -The Groovy DSL will respond to the following methods: - -* set -* setAsBytes -* put -* get -* getAsBytes -* getAsType -* containsKey -* delete -* foreach - -Each completed or failed closure can be accompanied by a "guard" closure. For example, -to process an entry differently, based on the type: - - riak.get(bucket: "test", key: "test") { - completed(when: { it instanceof Map }) { processMap(it) } - completed(when: { it instanceof String }) { processString(it) } - completed(when: { it instanceof byte[] }) { processBytes(it) } - completed { result = "otherwise" } - - failed { it.printStackTrace() } - } - -You can nest them, of course. To insert data and then delete all keys from a bucket: - - riak { - put(bucket: "test", value: [test: "value 1"]) - put(bucket: "test", value: [test: "value 2"]) - put(bucket: "test", value: [test: "value 3"]) - - foreach(bucket: "test") { - completed { v, meta -> - delete(bucket: meta.bucket, key: meta.key) - } - failed { it.printStackTrace() } - } - } - -You can also use a "default" bucket by nesting your operations inside an arbitrary block. In -the example below, the `test{}` closure sets a default bucket of "test" and all the -subsequent operations check for this if a `bucket` is not specified (you can override the -default by specifying a `bucket` property on the operation itself). - -The Groovy DSL for Riak now has Map/Reduce support. You build up a Map/Reduce job using the -closures shown in the example. You can pass static arguments to the phases, as well. You can -also specify a `wait` timeout on the `mapreduce` closure, just like with the other operations. - - riak { - test { - put(value: [test: "value"]) - put(value: [test: "value"]) - put(value: [test: "value"]) - put(value: [test: "value"]) - - mapreduce { - query { - map(arg: [test: "arg", alist: [1, 2, 3, 4]]) { - source "function(v){ return [1]; }" - } - reduce { - source "function(v){ return Riak.reduceSum(v); }" - } - } - completed { println "result $it" } - failed { it.printStackTrace() } - } - } - } - -Some things to note here: - -* The Groovy DSL utilizes the new AsyncRiakTemplate, so all closure calls happen - asynchronously. By default, the operation will block indefinitely. To not block at all - and continue on immediately, set the `wait` to `0`. To block until a specified timeout, - set the `wait` to the number of milliseconds to wait for the operation to complete before - timing out and throwing an exception. -* Callbacks are defined as either `completed` or `failed` closures. In addition to the - closure, you can define a "guard" closure, which is called before the main closure and - should return non-null or Boolean `true` if the closure should be executed or null or - Boolean `false` if the closure is to be skipped. This functionality is inspired by the - use of [the guard expression in Erlang case statements](http://en.wikibooks.org/wiki/Erlang_Programming/guards). \ No newline at end of file diff --git a/spring-data-riak/build.gradle b/spring-data-riak/build.gradle deleted file mode 100644 index 0610d27c2..000000000 --- a/spring-data-riak/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - compile project(":spring-data-keyvalue-core") - compile "org.codehaus.groovy:groovy-all:1.7.6" - compile "javax.mail:mail:1.4.1" - compile "javax.activation:activation:1.1.1" - compile "commons-cli:commons-cli:1.2" - - compile "org.springframework:spring-web:$springVersion" -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreConnectionFailureException.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreConnectionFailureException.java deleted file mode 100644 index b9c56ad5c..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreConnectionFailureException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak; - -import org.springframework.dao.DataAccessResourceFailureException; - -/** - * @author J. Brisbin - */ -public class DataStoreConnectionFailureException extends DataAccessResourceFailureException { - - public static final long serialVersionUID = 1L; - - public DataStoreConnectionFailureException(String msg) { - super(msg); - } - - public DataStoreConnectionFailureException(String msg, Throwable cause) { - super(msg, cause); - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreOperationException.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreOperationException.java deleted file mode 100644 index 9dfe893a2..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/DataStoreOperationException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak; - -import org.springframework.dao.DataAccessException; - -/** - * @author J. Brisbin - */ -public class DataStoreOperationException extends DataAccessException { - - public static final long serialVersionUID = 1L; - - public DataStoreOperationException(String msg) { - super(msg); - } - - public DataStoreOperationException(String msg, Throwable cause) { - super(msg, cause); - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/convert/KeyValueStoreMetaData.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/convert/KeyValueStoreMetaData.java deleted file mode 100644 index 40f8d66f5..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/convert/KeyValueStoreMetaData.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.convert; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * Specify the bucket in which to store the annotated object, overriding the - * default classname method of deriving bucket name. - * - * @author J. Brisbin - */ -@Retention(RetentionPolicy.RUNTIME) -public @interface KeyValueStoreMetaData { - - /** - * The bucket in which to store an instance of this object. - * - * @return - */ - String bucket(); - - /** - * The media type in which to covert and store this object. - * - * @return - */ - String mediaType() default "application/json"; - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AbstractRiakTemplate.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AbstractRiakTemplate.java deleted file mode 100644 index 85b50f641..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AbstractRiakTemplate.java +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codehaus.groovy.runtime.GStringImpl; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.ser.CustomSerializerFactory; -import org.codehaus.jackson.map.ser.ToStringSerializer; -import org.springframework.beans.factory.BeanClassLoaderAware; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.support.ConversionServiceFactory; -import org.springframework.data.keyvalue.riak.DataStoreOperationException; -import org.springframework.data.keyvalue.riak.convert.KeyValueStoreMetaData; -import org.springframework.data.keyvalue.riak.util.Ignore404sErrorHandler; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpInputMessage; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter; -import org.springframework.util.Assert; -import org.springframework.util.ClassUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.client.DefaultResponseErrorHandler; -import org.springframework.web.client.ResourceAccessException; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.client.support.RestGatewaySupport; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.annotation.Annotation; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.ConcurrentSkipListMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Base class for RiakTemplates that defines basic behaviour common to both kinds of templates - * (Key/Value and Bucket/Key/Value). - * - * @author J. Brisbin - */ -public abstract class AbstractRiakTemplate extends RestGatewaySupport implements InitializingBean, BeanClassLoaderAware { - - protected static final String RIAK_META_CLASSNAME = "X-Riak-Meta-ClassName"; - protected static final String RIAK_VCLOCK = "X-Riak-Vclock"; - - /** - * Regex used to extract host, port, and prefix from the given URI. - */ - protected static final Pattern prefix = Pattern.compile( - "http[s]?://(\\S+):([0-9]+)/(\\S+)/\\{bucket\\}(\\S+)"); - /** - * Do we need to handle Groovy strings in the Jackson JSON processor? - */ - protected final boolean groovyPresent = ClassUtils.isPresent( - "org.codehaus.groovy.runtime.GStringImpl", - getClass().getClassLoader()); - /** - * For getting a java.util.Date from the Last-Modified header. - */ - protected static SimpleDateFormat httpDate = new SimpleDateFormat( - "EEE, d MMM yyyy HH:mm:ss z"); - - protected final Log log = LogFactory.getLog(getClass()); - - /** - * Client ID used by Riak to correlate updates. - */ - protected final String RIAK_CLIENT_ID = getClass().getName() + "/1.0"; - - /** - * For converting objects to/from other kinds of objects. - */ - protected ConversionService conversionService = ConversionServiceFactory - .createDefaultConversionService(); - /** - * For caching objects based on ETags. - */ - protected ConcurrentSkipListMap> cache = new ConcurrentSkipListMap>(); - /** - * Whether or not to use the ETag-based cache. - */ - protected boolean useCache = true; - /** - * The URI to use inside the RestTemplate. - */ - protected String defaultUri = "http://localhost:8098/riak/{bucket}/{key}"; - /** - * The URI for the Riak Map/Reduce API. - */ - protected String mapReduceUri = "http://localhost:8098/mapred"; - /** - * A list of resolvers to turn a single object into a {@link BucketKeyPair}. - */ - protected List bucketKeyResolvers = new ArrayList(); - /** - * The default QosParameters to use for all operations through this template. - */ - protected QosParameters defaultQosParameters = null; - /** - * {@link java.util.concurrent.ExecutorService} to use for running asynchronous jobs. - */ - protected ExecutorService workerPool = Executors.newCachedThreadPool(); - /** - * Default type to use when trying to deserialize objects and we can't otherwise tell what to - * do. - */ - protected Class defaultType = String.class; - /** - * ClassLoader to use for saving/loading objects using the automatic converters. - */ - protected ClassLoader classLoader = null; - - /** - * Take all the defaults. - */ - public AbstractRiakTemplate() { - setRestTemplate(new RestTemplate()); - } - - /** - * Use the specified {@link org.springframework.http.client.ClientHttpRequestFactory}. - * - * @param requestFactory - */ - public AbstractRiakTemplate(ClientHttpRequestFactory requestFactory) { - super(requestFactory); - setRestTemplate(new RestTemplate()); - } - - public ConversionService getConversionService() { - return conversionService; - } - - /** - * Specify the conversion service to use. - * - * @param conversionService - */ - public void setConversionService(ConversionService conversionService) { - this.conversionService = conversionService; - } - - public String getDefaultUri() { - return defaultUri; - } - - public void setDefaultUri(String defaultUri) { - this.defaultUri = defaultUri; - } - - public String getMapReduceUri() { - return mapReduceUri; - } - - public void setMapReduceUri(String mapReduceUri) { - this.mapReduceUri = mapReduceUri; - } - - public boolean isUseCache() { - return useCache; - } - - public void setUseCache(boolean useCache) { - this.useCache = useCache; - } - - public QosParameters getDefaultQosParameters() { - return defaultQosParameters; - } - - public void setDefaultQosParameters(QosParameters defaultQosParameters) { - this.defaultQosParameters = defaultQosParameters; - } - - public ExecutorService getWorkerPool() { - return workerPool; - } - - public void setWorkerPool(ExecutorService workerPool) { - this.workerPool = workerPool; - } - - public void setIgnoreNotFound(boolean b) { - if (b) { - getRestTemplate().setErrorHandler(new Ignore404sErrorHandler()); - } else { - if (getRestTemplate().getErrorHandler() instanceof Ignore404sErrorHandler) { - getRestTemplate().setErrorHandler(new DefaultResponseErrorHandler()); - } - } - } - - public boolean getIgnoreNotFound() { - return (getRestTemplate().getErrorHandler() instanceof Ignore404sErrorHandler); - } - - /** - * Get the default type to use if none can be inferred. - * - * @return - */ - public Class getDefaultType() { - return defaultType; - } - - /** - * Set the default type to use if none can be inferred. - * - * @param defaultType - */ - public void setDefaultType(Class defaultType) { - this.defaultType = defaultType; - } - - public void setBeanClassLoader(ClassLoader classLoader) { - this.classLoader = classLoader; - } - - public String getHost() { - Matcher m = prefix.matcher(defaultUri); - if (m.matches()) { - return m.group(1); - } - return "localhost"; - } - - public Integer getPort() { - Matcher m = prefix.matcher(defaultUri); - if (m.matches()) { - return new Integer(m.group(2)); - } - return 8098; - } - - /** - * Extract the prefix from the URI for use in creating links. - * - * @return - */ - public String getPrefix() { - Matcher m = prefix.matcher(defaultUri); - if (m.matches()) { - return "/" + m.group(3); - } - return "/riak"; - } - - public void afterPropertiesSet() throws Exception { - Assert.notNull(conversionService, - "Must specify a valid ConversionService."); - - List> converters = getRestTemplate().getMessageConverters(); - ObjectMapper mapper = new ObjectMapper(); - CustomSerializerFactory fac = new CustomSerializerFactory(); - if (groovyPresent) { - // Native conversion for Groovy GString objects - fac.addSpecificMapping(GStringImpl.class, ToStringSerializer.instance); - } - mapper.setSerializerFactory(fac); - for (HttpMessageConverter converter : converters) { - if (converter instanceof MappingJacksonHttpMessageConverter) { - ((MappingJacksonHttpMessageConverter) converter).setObjectMapper( - mapper); - } - } - } - - /*----------------- Utilities -----------------*/ - - @SuppressWarnings({"unchecked"}) - protected BucketKeyPair resolveBucketKeyPair(Object key, Object val) { - BucketKeyResolver resolver = null; - for (BucketKeyResolver r : bucketKeyResolvers) { - if (r.canResolve(key)) { - resolver = r; - break; - } - } - if (null == resolver) { - resolver = new SimpleBucketKeyResolver(); - } - - BucketKeyPair bucketKeyPair = resolver.resolve(key); - if (null == bucketKeyPair.getBucket() && null != val) { - // No bucket specified, check for an annotation that specified bucket name. - Annotation meta = (val instanceof Class ? (Class) val : val.getClass()).getAnnotation( - org.springframework.data.keyvalue.riak.convert.KeyValueStoreMetaData.class); - if (null != meta) { - String bucket = ((KeyValueStoreMetaData) meta).bucket(); - if (null != bucket) { - return new SimpleBucketKeyPair(bucket, - bucketKeyPair.getKey()); - } - } - } - return bucketKeyPair; - } - - protected MediaType extractMediaType(Object value) { - MediaType mediaType = (value instanceof byte[] ? MediaType.APPLICATION_OCTET_STREAM : MediaType.APPLICATION_JSON); - if (null != value && value.getClass().getAnnotations().length > 0) { - KeyValueStoreMetaData meta = value.getClass() - .getAnnotation(KeyValueStoreMetaData.class); - if (null != meta) { - // Use the media type specified on the annotation. - mediaType = MediaType.parseMediaType(meta.mediaType()); - } - } - return mediaType; - } - - protected RiakMetaData extractMetaData(HttpHeaders headers) throws - IOException { - Map props = new LinkedHashMap(); - for (Map.Entry> entry : headers.entrySet()) { - List val = entry.getValue(); - Object prop = (1 == val.size() ? val.get(0) : val); - try { - if (entry.getKey().equals("Last-Modified") || entry.getKey() - .equals("Date")) { - prop = httpDate.parse(val.get(0)); - } - } catch (ParseException e) { - log.error(e.getMessage(), e); - } - - if (entry.getKey().equals("Link")) { - List links = new ArrayList(); - for (String link : entry.getValue()) { - String[] parts = link.split(","); - for (String part : parts) { - String s = part.replaceAll("<(.+)>; rel=\"(\\S+)\"[,]?", "").trim(); - if (!"".equals(s)) { - links.add(s); - } - } - } - props.put("Link", links); - } else { - props.put(entry.getKey().toString(), prop); - } - } - props.put("ETag", headers.getETag()); - RiakMetaData meta = new RiakMetaData(headers.getContentType(), props); - - return meta; - } - - @SuppressWarnings({"unchecked"}) - protected RiakValue extractValue(final ResponseEntity response, Class origType, - Class requiredType) throws - IOException { - if (response.hasBody()) { - RiakMetaData meta = extractMetaData(response.getHeaders()); - Object o = response.getBody(); - if (!origType.equals(requiredType)) { - if (conversionService.canConvert(origType, requiredType)) { - o = conversionService.convert(o, requiredType); - } else { - if (o instanceof byte[] || o instanceof String) { - // Peek inside, see if it's a string of something we recognize - String s = (o instanceof byte[] ? new String((byte[]) o) : (String) o); - if (s.charAt(0) == '{' || s.charAt(0) == '[') { - // Looks like it might be a JSON string. Use the JSON converter - for (HttpMessageConverter conv : getRestTemplate().getMessageConverters()) { - if (conv instanceof MappingJacksonHttpMessageConverter) { - o = conv.read(requiredType, new HttpInputMessage() { - public InputStream getBody() throws IOException { - Object body = response.getBody(); - return new ByteArrayInputStream( - (body instanceof byte[] ? (byte[]) body : ((String) body) - .getBytes())); - } - - public HttpHeaders getHeaders() { - return response.getHeaders(); - } - }); - break; - } - } - - } - } else { - throw new DataStoreOperationException( - "Cannot convert object of type " + origType + " to type " + requiredType); - } - } - } - return new RiakValue((T) o, meta); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - protected T checkCache(K key, Class requiredType) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, requiredType); - RiakValue obj = cache.get(bucketKeyPair); - if (null != obj) { - String bucketName = (null != bucketKeyPair.getBucket() ? bucketKeyPair.getBucket() - .toString() : requiredType.getName()); - RestTemplate restTemplate = getRestTemplate(); - try { - HttpHeaders resp = restTemplate.headForHeaders(defaultUri, - bucketName, - bucketKeyPair.getKey()); - if (!obj.getMetaData() - .getProperties() - .get("ETag") - .toString() - .equals(resp.getETag())) { - obj = null; - } else { - if (log.isDebugEnabled()) { - log.debug("Returning CACHED object: " + obj); - } - } - } catch (ResourceAccessException ignored) { - return null; - } - } - - if (null != obj && obj.getClass() == requiredType) { - return (T) obj.get(); - } else { - return null; - } - } - - /** - * Get a string that represents the QOS parameters, taken either from the specified object or - * from the template defaults. - * - * @param qosParams - * @return - */ - protected String extractQosParameters(QosParameters qosParams) { - List params = new LinkedList(); - if (null != qosParams.getReadThreshold()) { - params.add(String.format("r=%s", qosParams.getReadThreshold())); - } else if (null != defaultQosParameters && null != defaultQosParameters - .getReadThreshold()) { - params.add(String.format("r=%s", defaultQosParameters.getReadThreshold())); - } - if (null != qosParams.getWriteThreshold()) { - params.add(String.format("w=%s", qosParams.getWriteThreshold())); - } else if (null != defaultQosParameters && null != defaultQosParameters - .getWriteThreshold()) { - params.add(String.format("w=%s", defaultQosParameters.getWriteThreshold())); - } - if (null != qosParams.getDurableWriteThreshold()) { - params.add(String.format("dw=%s", qosParams.getDurableWriteThreshold())); - } else if (null != defaultQosParameters && null != defaultQosParameters - .getDurableWriteThreshold()) { - params.add(String.format("dw=%s", defaultQosParameters.getDurableWriteThreshold())); - } - - return (params.size() > 0 ? "?" + StringUtils.collectionToDelimitedString( - params, - "&") : ""); - } - - protected HttpHeaders defaultHeaders(Map metadata) { - HttpHeaders headers = new HttpHeaders(); - headers.set("X-Riak-ClientId", RIAK_CLIENT_ID); - if (null != metadata) { - for (Map.Entry entry : metadata.entrySet()) { - Object o = entry.getValue(); - headers.set(entry.getKey(), (null != o ? o.toString() : null)); - } - } - return headers; - } - - protected Class getType(B bucket, K key) { - return getType(bucket, key, getClass().getClassLoader()); - } - - protected Class getType(B bucket, K key, ClassLoader classLoader) { - Class clazz = null; - try { - HttpHeaders headers = getRestTemplate().headForHeaders(defaultUri, bucket, key); - if (null != headers) { - String s = headers.getFirst(RIAK_META_CLASSNAME); - if (null != s) { - try { - if (null != classLoader) { - clazz = Class.forName(s, false, classLoader); - } else { - clazz = Class.forName(s); - } - } catch (ClassNotFoundException ignored) { - } - } - } - if (null == clazz) { - if (headers.getContentType().equals(MediaType.APPLICATION_JSON)) { - clazz = Map.class; - } else if (headers.getContentType().equals(MediaType.TEXT_PLAIN)) { - clazz = String.class; - } else { - // handle as bytes - log.error("Need to handle bytes!"); - clazz = byte[].class; - } - } - } catch (ResourceAccessException notFound) { - clazz = String.class; - } - return clazz; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncBucketKeyValueStoreOperations.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncBucketKeyValueStoreOperations.java deleted file mode 100644 index 0b222d855..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncBucketKeyValueStoreOperations.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import java.util.Map; -import java.util.concurrent.Future; - -/** - * An asynchronous version of {@link BucketKeyValueStoreOperations}. - * - * @author J. Brisbin - */ -public interface AsyncBucketKeyValueStoreOperations { - - /** - * Put an object in Riak at a specific bucket and key and invoke callback with the value - * pulled back out of Riak after the update, which contains full headers and metadata. - * - * @param bucket - * @param key - * @param value - * @param callback Called with the update value pulled from Riak - */ - Future set(B bucket, K key, V value, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @param qosParams - * @return - */ - Future set(B bucket, K key, V value, QosParameters qosParams, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @return - */ - Future setAsBytes(B bucket, K key, byte[] value, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @param qosParams - * @return - */ - Future setAsBytes(B bucket, K key, byte[] value, QosParameters qosParams, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @param metaData - * @return - */ - Future setWithMetaData(B bucket, K key, V value, Map metaData, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @param metaData - * @param qosParams - * @return - */ - Future setWithMetaData(B bucket, K key, V value, Map metaData, QosParameters qosParams, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @return - */ - Future get(B bucket, K key, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @return - */ - Future getAsBytes(B bucket, K key, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param requiredType - * @return - */ - Future getAsType(B bucket, K key, Class requiredType, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @return - */ - Future getAndSet(B bucket, K key, V value, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @return - */ - Future getAndSetAsBytes(B bucket, K key, byte[] value, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @param requiredType - * @return - */ - Future getAndSetAsType(B bucket, K key, V value, Class requiredType, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @return - */ - Future setIfKeyNonExistent(B bucket, K key, V value, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @param value - * @return - */ - Future setIfKeyNonExistentAsBytes(B bucket, K key, byte[] value, AsyncKeyValueStoreOperation callback); - - /** - * @param bucket - * @param key - * @return - */ - Future containsKey(B bucket, K key, AsyncKeyValueStoreOperation callback); - - /** - * Delete a specific entry from this data store. - * - * @param bucket - * @param key - * @return - */ - Future delete(B bucket, K key, AsyncKeyValueStoreOperation callback); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncKeyValueStoreOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncKeyValueStoreOperation.java deleted file mode 100644 index 291d8d126..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncKeyValueStoreOperation.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * @author J. Brisbin - */ -public interface AsyncKeyValueStoreOperation { - - T completed(KeyValueStoreMetaData meta, V result); - - T failed(Throwable error); -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplate.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplate.java deleted file mode 100644 index b96a82765..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplate.java +++ /dev/null @@ -1,630 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.springframework.dao.DataAccessResourceFailureException; -import org.springframework.data.keyvalue.riak.DataStoreOperationException; -import org.springframework.data.keyvalue.riak.mapreduce.AsyncMapReduceOperations; -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.util.Assert; -import org.springframework.web.client.ResourceAccessException; -import org.springframework.web.client.RestTemplate; - -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -/** - * An implementation of {@link AsyncBucketKeyValueStoreOperations} and {@link - * AsyncMapReduceOperations} for the Riak datastore. - *

- * To use the AsyncRiakTemplate, create a singleton in your Spring application-context.xml: - *


- * <bean id="riak" class="org.springframework.data.keyvalue.riak.core.AsyncRiakTemplate"
- *     p:defaultUri="http://localhost:8098/riak/{bucket}/{key}"
- *     p:mapReduceUri="http://localhost:8098/mapred"/>
- * 
- * To store and retrieve objects in Riak, use the setXXX and getXXX methods (example in - * Groovy): - *

- * def callback = [
- *   completed: { v, meta ->
- *     ... do something with results ...
- *   },
- *   failed: { err ->
- *   }
- * ] as AsyncKeyValueStoreOperation
- * def obj = new TestObject(name: "My Name", age: 40)
- * def future = riak.set("mybucket", "mykey", obj, callback)
- * ... this runs asynchronously, so do other work ...
- * def name = future.get().name
- * println "Hello $name!"
- * 
- * - * @author J. Brisbin - */ -public class AsyncRiakTemplate extends AbstractRiakTemplate implements AsyncBucketKeyValueStoreOperations, AsyncMapReduceOperations { - - protected AsyncKeyValueStoreOperation defaultErrorHandler = new LoggingErrorHandler(); - - public AsyncRiakTemplate() { - super(); - } - - public AsyncRiakTemplate(ClientHttpRequestFactory requestFactory) { - super(requestFactory); - } - - public AsyncKeyValueStoreOperation getDefaultErrorHandler() { - return defaultErrorHandler; - } - - public void setDefaultErrorHandler( - AsyncKeyValueStoreOperation defaultErrorHandler) { - this.defaultErrorHandler = defaultErrorHandler; - } - - public Future set(B bucket, K key, V value, - AsyncKeyValueStoreOperation callback) { - return setWithMetaData(bucket, key, value, null, null, callback); - } - - public Future set(B bucket, K key, V value, QosParameters qosParams, - AsyncKeyValueStoreOperation callback) { - return setWithMetaData(bucket, key, value, null, qosParams, callback); - } - - public Future setAsBytes(B bucket, K key, byte[] value, - AsyncKeyValueStoreOperation callback) { - return setWithMetaData(bucket, key, value, null, null, callback); - } - - @SuppressWarnings({"unchecked"}) - public Future setWithMetaData(B bucket, K key, V value, - Map metaData, - QosParameters qosParams, - AsyncKeyValueStoreOperation callback) { - String bucketName = (null != bucket ? bucket.toString() : value.getClass().getName()); - // Get a key name that may or may not include the QOS parameters. - Assert.notNull(key, "Cannot use a key."); - String keyName = (null != qosParams ? key.toString() + extractQosParameters(qosParams) : key - .toString()); - - KeyValueStoreMetaData origMeta = getMetaData(bucket, keyName); - String vclock = null; - if (null != origMeta) { - Map mprops = origMeta.getProperties(); - if (null != mprops) { - Object o = mprops.get(RIAK_VCLOCK); - if (null != o) { - vclock = o.toString(); - } - } - } - - HttpHeaders headers = defaultHeaders(metaData); - headers.setContentType(extractMediaType(value)); - if (null != vclock) { - headers.set(RIAK_VCLOCK, vclock); - } - headers.set(RIAK_META_CLASSNAME, value.getClass().getName()); - HttpEntity entity = new HttpEntity(value, headers); - return (Future) workerPool.submit(new AsyncPost(bucketName, - keyName, - entity, - callback)); - } - - public Future put(B bucket, V value, - AsyncKeyValueStoreOperation callback) { - return put(bucket, value, null, null, callback); - } - - public Future put(B bucket, V value, Map metaData, - AsyncKeyValueStoreOperation callback) { - return put(bucket, value, metaData, null, callback); - } - - @SuppressWarnings({"unchecked"}) - public Future put(B bucket, V value, Map metaData, - QosParameters qosParams, - AsyncKeyValueStoreOperation callback) { - Assert.notNull(bucket, "Bucket cannot be null"); - String bucketName = (null != qosParams ? bucket.toString() + extractQosParameters( - qosParams) : bucket - .toString()); - - HttpHeaders headers = defaultHeaders(metaData); - headers.setContentType(extractMediaType(value)); - headers.set(RIAK_META_CLASSNAME, value.getClass().getName()); - HttpEntity entity = new HttpEntity(value, headers); - return (Future) workerPool.submit(new AsyncPut(bucketName, entity, callback)); - } - - public Future get(B bucket, K key, - AsyncKeyValueStoreOperation callback) { - return getWithMetaData(bucket, key, null, callback); - } - - public RiakMetaData getMetaData(B bucket, K key) { - RestTemplate restTemplate = getRestTemplate(); - HttpHeaders headers; - try { - headers = restTemplate.headForHeaders(defaultUri, bucket, key); - RiakMetaData meta = extractMetaData(headers); - meta.setBucket((null != bucket ? bucket.toString() : null)); - meta.setKey((null != key ? key.toString() : null)); - return meta; - } catch (ResourceAccessException e) { - } catch (IOException e) { - throw new DataAccessResourceFailureException(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - public Future getBucketSchema(B bucket, QosParameters qosParams, - final AsyncKeyValueStoreOperation, R> callback) { - Assert.notNull(bucket, "Bucket cannot be null"); - Assert.notNull(callback, "Callback cannot be null"); - - String bucketName = (null != qosParams ? bucket.toString() + extractQosParameters( - qosParams) : bucket - .toString()); - - return workerPool.submit(new AsyncGet(bucketName, - "?keys=true", - Map.class, - new AsyncKeyValueStoreOperation() { - @SuppressWarnings({"unchecked"}) - public Object completed(KeyValueStoreMetaData meta, Object result) { - return callback.completed(meta, (Map) result); - } - - public Object failed(Throwable error) { - return callback.failed(error); - } - })); - } - - @SuppressWarnings({"unchecked"}) - public Future getWithMetaData(B bucket, K key, Class requiredType, - AsyncKeyValueStoreOperation callback) { - Assert.notNull(key, "Cannot use a null key."); - Assert.notNull(callback, "Callback cannot be null"); - - String bucketName = (null != bucket ? bucket.toString() : requiredType.getName()); - - if (null == requiredType) { - requiredType = (Class) getType(bucketName, key.toString()); - } - return workerPool.submit(new AsyncGet(bucketName, - key.toString(), - requiredType, - callback)); - } - - public Future getAsBytes(B bucket, K key, - AsyncKeyValueStoreOperation callback) { - return getWithMetaData(bucket, key, byte[].class, callback); - } - - public Future getAsType(B bucket, K key, Class requiredType, - AsyncKeyValueStoreOperation callback) { - return getWithMetaData(bucket, key, requiredType, callback); - } - - public Future getAndSet(final B bucket, final K key, final V value, - final AsyncKeyValueStoreOperation callback) { - final List> futures = new ArrayList>(); - try { - getWithMetaData(bucket, key, null, new AsyncKeyValueStoreOperation() { - @SuppressWarnings({"unchecked"}) - public Object completed(KeyValueStoreMetaData meta, Object result) { - futures.add(setWithMetaData(bucket, key, value, null, null, null)); - return callback.completed(meta, (V) result); - } - - public Object failed(Throwable error) { - return callback.failed(error); - } - }).get(); - } catch (InterruptedException e) { - log.error(e.getMessage(), e); - } catch (ExecutionException e) { - log.error(e.getMessage(), e); - } - return futures.size() > 0 ? futures.get(0) : null; - } - - public Future getAndSetAsBytes(B bucket, K key, byte[] value, - AsyncKeyValueStoreOperation callback) { - return getAndSet(bucket, key, value, callback); - } - - public Future getAndSetAsType(final B bucket, final K key, final V value, - final Class requiredType, - final AsyncKeyValueStoreOperation callback) { - final List> futures = new ArrayList>(); - getWithMetaData(bucket, key, requiredType, new AsyncKeyValueStoreOperation() { - @SuppressWarnings({"unchecked"}) - public R completed(KeyValueStoreMetaData meta, T result) { - try { - setWithMetaData(bucket, key, value, null, null, null).get(); - return callback.completed(meta, result); - } catch (InterruptedException e) { - return callback.failed(e); - } catch (ExecutionException e) { - return callback.failed(e); - } - } - - public R failed(Throwable error) { - return callback.failed(error); - } - }); - return futures.size() > 0 ? futures.get(0) : null; - } - - public Future setIfKeyNonExistent(final B bucket, final K key, final V value, - final AsyncKeyValueStoreOperation callback) { - return containsKey(bucket, key, new AsyncKeyValueStoreOperation() { - public Object completed(KeyValueStoreMetaData meta, Boolean result) { - if (!result) { - return setWithMetaData(bucket, key, value, null, null, callback); - } else { - return null; - } - } - - public Object failed(Throwable error) { - return callback.failed(error); - } - }); - } - - public Future setIfKeyNonExistentAsBytes(final B bucket, final K key, - final byte[] value, - final AsyncKeyValueStoreOperation callback) { - return containsKey(bucket, key, new AsyncKeyValueStoreOperation() { - public Object completed(KeyValueStoreMetaData meta, Boolean result) { - if (!result) { - return setWithMetaData(bucket, key, value, null, null, callback); - } else { - return null; - } - } - - public Object failed(Throwable error) { - return callback.failed(error); - } - }); - } - - @SuppressWarnings({"unchecked"}) - public Future containsKey(B bucket, K key, - final AsyncKeyValueStoreOperation callback) { - Assert.notNull(bucket, "Bucket cannot be null when checking for existence."); - Assert.notNull(key, "Key cannot be null when checking for existence"); - return workerPool.submit(new AsyncHead(bucket.toString(), - key.toString(), - new AsyncKeyValueStoreOperation() { - public Object completed(KeyValueStoreMetaData meta, HttpHeaders result) { - return callback.completed(null, (null != result)); - } - - public Object failed(Throwable error) { - return callback.failed(error); - } - })); - } - - @SuppressWarnings({"unchecked"}) - public Future delete(B bucket, K key, - AsyncKeyValueStoreOperation callback) { - Assert.notNull(bucket, "Bucket cannot be null when deleting."); - Assert.notNull(key, "Key cannot be null when deleting."); - return workerPool.submit(new AsyncDelete(bucket.toString(), key.toString(), callback)); - } - - public Future setAsBytes(B bucket, K key, byte[] value, QosParameters qosParams, - AsyncKeyValueStoreOperation callback) { - return setWithMetaData(bucket, key, value, null, qosParams, callback); - } - - public Future setWithMetaData(B bucket, K key, V value, - Map metaData, - AsyncKeyValueStoreOperation callback) { - return setWithMetaData(bucket, key, value, metaData, null, callback); - } - - /* ---------------- Map/Reduce ---------------- */ - - @SuppressWarnings({"unchecked"}) - public Future execute(MapReduceJob job, - AsyncKeyValueStoreOperation, R> callback) { - HttpHeaders headers = defaultHeaders(null); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity json = new HttpEntity(job.toJson(), headers); - return workerPool.submit(new AsyncMapReduce(json, callback)); - } - - /* ---------------- Runnable helpers ---------------- */ - - protected class AsyncPut implements Callable { - - private String bucket; - private HttpEntity entity = null; - private AsyncKeyValueStoreOperation callback = null; - - public AsyncPut(String bucket, HttpEntity entity, - AsyncKeyValueStoreOperation callback) { - this.bucket = bucket; - this.entity = entity; - this.callback = callback; - } - - public R call() throws Exception { - try { - URI location = getRestTemplate().postForLocation(defaultUri, entity, bucket, ""); - String path = location.getPath(); - String key = path.substring(path.lastIndexOf("/") + 1); - - HttpHeaders headers = getRestTemplate().headForHeaders(defaultUri, bucket, key); - if (null != callback) { - RiakMetaData meta = extractMetaData(headers); - meta.setBucket((null != bucket ? bucket.toString() : null)); - meta.setKey((null != key ? key.toString() : null)); - return callback.completed(meta, entity.getBody()); - } - } catch (Throwable t) { - DataStoreOperationException dsoe = new DataStoreOperationException(t.getMessage(), t); - if (null != callback) { - return callback.failed(dsoe); - } else { - defaultErrorHandler.failed(dsoe); - } - } - return null; - } - - } - - protected class AsyncPost implements Callable { - - private String bucket; - private String key; - private HttpEntity entity = null; - private AsyncKeyValueStoreOperation callback = null; - - public AsyncPost(String bucket, String key, HttpEntity entity, - AsyncKeyValueStoreOperation callback) { - this.bucket = bucket; - this.key = key; - this.entity = entity; - this.callback = callback; - } - - @SuppressWarnings({"unchecked"}) - public R call() throws Exception { - try { - HttpEntity result = getRestTemplate().postForEntity(defaultUri, - entity, - (entity.getBody() instanceof byte[] ? byte[].class : entity.getBody().getClass()), - bucket, - key + "?returnbody=true"); - if (log.isDebugEnabled()) { - log.debug(String.format("PUT object: bucket=%s, key=%s, value=%s", - bucket, - key, - entity)); - } - if (null != callback) { - RiakMetaData meta = extractMetaData(result.getHeaders()); - meta.setBucket((null != bucket ? bucket.toString() : null)); - meta.setKey((null != key ? key.toString() : null)); - return callback.completed(meta, (V) result.getBody()); - } - } catch (Throwable t) { - DataStoreOperationException dsoe = new DataStoreOperationException(t.getMessage(), t); - if (null != callback) { - return callback.failed(dsoe); - } else { - defaultErrorHandler.failed(dsoe); - } - } - return null; - } - - } - - protected class AsyncMapReduce implements Callable { - - private HttpEntity entity = null; - private AsyncKeyValueStoreOperation, R> callback = null; - - public AsyncMapReduce(HttpEntity entity, - AsyncKeyValueStoreOperation, R> callback) { - this.entity = entity; - this.callback = callback; - } - - @SuppressWarnings({"unchecked"}) - public R call() throws Exception { - try { - HttpEntity result = getRestTemplate().postForEntity(mapReduceUri, - entity, - List.class); - if (log.isDebugEnabled()) { - log.debug(String.format("M/R: json=%s", entity.getBody())); - } - if (null != callback) { - RiakMetaData meta = extractMetaData(result.getHeaders()); - return callback.completed(meta, result.getBody()); - } - } catch (Throwable t) { - DataStoreOperationException dsoe = new DataStoreOperationException(t.getMessage(), t); - if (null != callback) { - return callback.failed(dsoe); - } else { - defaultErrorHandler.failed(dsoe); - } - } - return null; - } - - } - - protected class AsyncGet implements Callable { - - private String bucket; - private String key; - private Class requiredType; - private AsyncKeyValueStoreOperation callback = null; - - public AsyncGet(String bucket, String key, Class requiredType, - AsyncKeyValueStoreOperation callback) { - this.bucket = bucket; - this.key = key; - this.requiredType = requiredType; - this.callback = callback; - } - - public R call() throws Exception { - try { - ResponseEntity result = getRestTemplate().getForEntity(defaultUri, - requiredType, - bucket, - key); - if (result.hasBody()) { - RiakMetaData meta = extractMetaData(result.getHeaders()); - meta.setBucket((null != bucket ? bucket.toString() : null)); - meta.setKey((null != key ? key.toString() : null)); - RiakValue val = new RiakValue(result.getBody(), meta); - if (useCache) { - cache.put(new SimpleBucketKeyPair(bucket, key), val); - } - if (null != callback) { - return callback.completed(meta, val.get()); - } - if (log.isDebugEnabled()) { - log.debug(String.format("GET object: bucket=%s, key=%s, type=%s", - bucket, - key, - requiredType.getName())); - } - } - } catch (Throwable t) { - DataStoreOperationException dsoe = new DataStoreOperationException(t.getMessage(), t); - if (null != callback) { - return callback.failed(dsoe); - } else { - defaultErrorHandler.failed(dsoe); - } - } - return null; - } - } - - protected class AsyncHead implements Callable { - - private String bucket; - private String key; - private AsyncKeyValueStoreOperation callback = null; - - public AsyncHead(String bucket, String key, - AsyncKeyValueStoreOperation callback) { - this.bucket = bucket; - this.key = key; - this.callback = callback; - } - - public R call() throws Exception { - try { - HttpHeaders headers = getRestTemplate().headForHeaders(defaultUri, bucket, key); - if (null != headers) { - if (null != callback) { - return callback.completed(null, headers); - } - } - } catch (Throwable t) { - DataStoreOperationException dsoe = new DataStoreOperationException(t.getMessage(), t); - if (null != callback) { - return callback.failed(dsoe); - } else { - defaultErrorHandler.failed(dsoe); - } - } - return null; - } - } - - protected class AsyncDelete implements Callable { - - private String bucket; - private String key; - private AsyncKeyValueStoreOperation callback = null; - - public AsyncDelete(String bucket, String key, - AsyncKeyValueStoreOperation callback) { - this.bucket = bucket; - this.key = key; - this.callback = callback; - } - - public R call() throws Exception { - try { - getRestTemplate().delete(defaultUri, bucket, key); - if (null != callback) { - return callback.completed(null, true); - } - } catch (Throwable t) { - DataStoreOperationException dsoe = new DataStoreOperationException(t.getMessage(), t); - if (null != callback) { - return callback.failed(dsoe); - } else { - defaultErrorHandler.failed(dsoe); - } - } - return null; - } - } - - protected class LoggingErrorHandler implements AsyncKeyValueStoreOperation { - public Object completed(KeyValueStoreMetaData meta, Throwable result) { - return null; - } - - public Object failed(Throwable error) { - log.error(error.getMessage(), error); - return null; - } - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyPair.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyPair.java deleted file mode 100644 index 4fe4be165..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyPair.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * A generic interface for representing composite keys in data stores that use a - * bucket and key pair. - * - * @author J. Brisbin - */ -public interface BucketKeyPair { - - /** - * Get the bucket representation. - * - * @return - */ - B getBucket(); - - /** - * Get the key representation. - * - * @return - */ - K getKey(); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyResolver.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyResolver.java deleted file mode 100644 index 722b5f575..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyResolver.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * A generic interface to a resolver to turn a single object into a {@link - * org.springframework.data.keyvalue.riak.core.BucketKeyPair}. - * - * @author J. Brisbin - */ -public interface BucketKeyResolver { - - /** - * Can this resolver deal with the given object? - * - * @param o - * @param - * @return - */ - boolean canResolve(V o); - - /** - * Turn the given object into a BucketKeyPair. - * - * @param o - * @return - */ - BucketKeyPair resolve(V o); -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyValueStoreOperations.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyValueStoreOperations.java deleted file mode 100644 index 23f370518..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/BucketKeyValueStoreOperations.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import java.util.Map; - -/** - * @author J. Brisbin - */ -public interface BucketKeyValueStoreOperations { - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#set(Object, - * Object)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @return - */ - BucketKeyValueStoreOperations set(B bucket, K key, V value); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#set(Object, - * Object, QosParameters)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @param qosParams - * @return - */ - BucketKeyValueStoreOperations set(B bucket, K key, V value, QosParameters qosParams); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#setAsBytes(Object, - * byte[])} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @return - */ - BucketKeyValueStoreOperations setAsBytes(B bucket, K key, byte[] value); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#setWithMetaData(Object, - * Object, java.util.Map, QosParameters)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @param metaData - * @param qosParams - * @return - */ - BucketKeyValueStoreOperations setWithMetaData(B bucket, K key, V value, Map metaData, QosParameters qosParams); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#get(Object)} - * that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @return - */ - V get(B bucket, K key); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#getAsBytes(Object)} - * that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @return - */ - byte[] getAsBytes(B bucket, K key); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#getAsType(Object, - * Class)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param requiredType - * @return - */ - T getAsType(B bucket, K key, Class requiredType); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#getAndSet(Object, - * Object)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @return - */ - V getAndSet(B bucket, K key, V value); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#getAndSetAsBytes(Object, - * byte[])} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @return - */ - byte[] getAndSetAsBytes(B bucket, K key, byte[] value); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#getAndSetAsType(Object, - * Object, Class)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @param requiredType - * @return - */ - T getAndSetAsType(B bucket, K key, V value, Class requiredType); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#setIfKeyNonExistent(Object, - * Object)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @return - */ - BucketKeyValueStoreOperations setIfKeyNonExistent(B bucket, K key, V value); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#setIfKeyNonExistentAsBytes(Object, - * byte[])} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @return - */ - BucketKeyValueStoreOperations setIfKeyNonExistentAsBytes(B bucket, K key, byte[] value); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#containsKey(Object)} - * that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @return - */ - boolean containsKey(B bucket, K key); - - /** - * Delete a specific entry from this data store. - * - * @param bucket - * @param key - * @return - */ - boolean delete(B bucket, K key); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#setAsBytes(Object, - * byte[], QosParameters)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @param qosParams - * @return - */ - BucketKeyValueStoreOperations setAsBytes(B bucket, K key, byte[] value, QosParameters qosParams); - - /** - * Variant of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations#setWithMetaData(Object, - * Object, java.util.Map)} that takes a discreet bucket and key pair. - * - * @param bucket - * @param key - * @param value - * @param metaData - * @return - */ - BucketKeyValueStoreOperations setWithMetaData(B bucket, K key, V value, Map metaData); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreMetaData.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreMetaData.java deleted file mode 100644 index 4773811cd..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreMetaData.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.springframework.http.MediaType; - -import java.util.Map; - -/** - * A generic interface to MetaData provided by Key/Value data stores. - * - * @author J. Brisbin - */ -public interface KeyValueStoreMetaData { - - String getBucket(); - - String getKey(); - - /** - * Get the Content-Type of this object. - * - * @return - */ - MediaType getContentType(); - - long getLastModified(); - - /** - * Get the arbitrary properties for this object. - * - * @return - */ - Map getProperties(); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreOperations.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreOperations.java deleted file mode 100644 index b618bcda6..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreOperations.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.keyvalue.riak.core; - -import java.util.List; -import java.util.Map; - -/** - * Generic abstraction for Key/Value stores. Contains most operations that generic K/V stores - * might expose. - */ -public interface KeyValueStoreOperations { - - // Set operations - - /** - * Set a value at a specified key. - * - * @param key - * @param value - * @return This template interface - */ - KeyValueStoreOperations set(K key, V value); - - /** - * Variation on set() that allows the user to specify {@link org.springframework.data.keyvalue.riak.core.QosParameters}. - * - * @param key - * @param value - * @param qosParams - * @param - * @param - * @return - */ - KeyValueStoreOperations set(K key, V value, QosParameters qosParams); - - /** - * Set a value as a byte array at a specified key. - * - * @param key - * @param value - * @return This template interface - */ - KeyValueStoreOperations setAsBytes(K key, byte[] value); - - /** - * Variation on setWithMetaData() that allows the user to pass {@link - * org.springframework.data.keyvalue.riak.core.QosParameters}. - * - * @param key - * @param value - * @param metaData - * @param qosParams - * @param - * @param - * @return - */ - KeyValueStoreOperations setWithMetaData(K key, V value, Map metaData, QosParameters qosParams); - - // Get operations - - /** - * Get a value at the specified key, trying to infer the type from either the bucket in which - * the value was stored, or (by default) as a java.util.Map. - * - * @param key - * @return The converted value, or null if not found. - */ - V get(K key); - - /** - * Get the value at the specified key as a byte array. - * - * @param key - * @return The byte array of data, or null if not found. - */ - byte[] getAsBytes(K key); - - /** - * Get the value at the specified key and convert it into an instance of the specified type. - * - * @param key - * @param requiredType - * @return The converted value, or null if not found. - */ - T getAsType(K key, Class requiredType); - - // Get and Set operations - - /** - * Get the old value at the specified key and replace it with the given value. - * - * @param key - * @param value - * @return The old value (before it was overwritten). - */ - V getAndSet(K key, V value); - - /** - * Get the old value at the specified key as a byte array and replace it with the given - * bytes. - * - * @param key - * @param value - * @return The old byte array (before it was overwritten). - */ - byte[] getAndSetAsBytes(K key, byte[] value); - - /** - * Get the old value at the specified key and replace it with the given value, converting it - * to an instance of the given type. - * - * @param key - * @param value - * @param requiredType The type to convert the value to. - * @return The old value (before it was overwritten). - */ - T getAndSetAsType(K key, V value, Class requiredType); - - // Multi-get operations - - /** - * Get all the values at the specified keys. - * - * @param keys - * @return A list of the values retrieved or an empty list if none were found. - */ - List getValues(List keys); - - /** - * Variation on {@link KeyValueStoreOperations#getValues(java.util.List)} that uses varargs - * instead of a java.util.List. - * - * @param keys - * @return A list of the values retrieved or an empty list if none were found. - */ - List getValues(K... keys); - - /** - * Get all the values at the specified keys, converting the values into instances of the - * specified type. - * - * @param keys - * @param requiredType - * @return A list of the values retrieved or an empty list if none were found. - */ - List getValuesAsType(List keys, Class requiredType); - - /** - * A variation on {@link KeyValueStoreOperations#getValuesAsType(java.util.List, Class)} that - * takes uses varargs instead of a java.util.List. - * - * @param requiredType - * @param keys - * @return A list of the values retrieved or an empty list if none were found. - */ - List getValuesAsType(Class requiredType, K... keys); - - // Set if non-existent operations - - /** - * Set the value at the given key only if that key doesn't already exist. - * - * @param key - * @param value - * @return This template interface - */ - KeyValueStoreOperations setIfKeyNonExistent(K key, V value); - - /** - * Set the value at the given key as a byte array only if that key doesn't already exist. - * - * @param key - * @param value - * @return This template interface - */ - KeyValueStoreOperations setIfKeyNonExistentAsBytes(K key, byte[] value); - - // Multiple key-value set - - /** - * Convenience method to set multiple values as Key/Value pairs. - * - * @param keysAndValues - * @return This template interface - */ - KeyValueStoreOperations setMultiple(Map keysAndValues); - - /** - * Convenience method to set multiple values as Key/byte[] pairs. - * - * @param keysAndValues - * @return This template interface - */ - KeyValueStoreOperations setMultipleAsBytes(Map keysAndValues); - - // Multiple key-value set if non-existent - - /** - * Variation on setting multiple values only if the key doesn't already exist. - * - * @param keysAndValues - * @return This template interface - */ - KeyValueStoreOperations setMultipleIfKeysNonExistent(Map keysAndValues); - - /** - * Variation on setting multiple values as byte arrays only if the key doesn't already exist. - * - * @param keysAndValues - * @param - * @return - */ - KeyValueStoreOperations setMultipleAsBytesIfKeysNonExistent(Map keysAndValues); - - /** - * Does the store contain this key? - * - * @param key - * @return true if the key exists, false otherwise. - */ - boolean containsKey(K key); - - /** - * Delete one or more keys from the store. - * - * @param keys - * @return true if all keys were successfully deleted, false - * otherwise. - */ - boolean deleteKeys(K... keys); - - /** - * Get the properties of the specified bucket. - * - * @param bucket - * @return The bucket properties, without a list of keys in that bucket. - */ - Map getBucketSchema(B bucket); - - KeyValueStoreOperations updateBucketSchema(B bucket, Map props); - - /** - * Get the properties of the bucket and specify whether or not to list the keys in that - * bucket. - * - * @param bucket - * @param listKeys - * @return The bucket properties, with or without a list of keys in that bucket. - */ - Map getBucketSchema(B bucket, boolean listKeys); - - KeyValueStoreOperations setAsBytes(K key, byte[] value, QosParameters qosParams); - - KeyValueStoreOperations setWithMetaData(K key, V value, Map metaData); -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreValue.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreValue.java deleted file mode 100644 index 51d29c877..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/KeyValueStoreValue.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * A generic interface for dealing with values and their store metadata. - * - * @author J. Brisbin - */ -public interface KeyValueStoreValue { - - /** - * Get the metadata associated with this value. - * - * @return - */ - KeyValueStoreMetaData getMetaData(); - - /** - * Get the converted value itself. - * - * @return - */ - T get(); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/QosParameters.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/QosParameters.java deleted file mode 100644 index e65f6f32c..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/QosParameters.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * Specify Quality Of Service parameters. - * - * @author J. Brisbin - */ -public interface QosParameters { - - /** - * Instruct the server on the read threshold. - * - * @param - * @return - */ - public T getReadThreshold(); - - /** - * Instruct the server on the normal write threshold. - * - * @param - * @return - */ - public T getWriteThreshold(); - - /** - * Instruct the server on the durable write threshold. - * - * @param - * @return - */ - public T getDurableWriteThreshold(); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplate.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplate.java deleted file mode 100644 index edb9b4e44..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplate.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.springframework.beans.factory.InitializingBean; -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob; -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperations; -import org.springframework.data.keyvalue.riak.mapreduce.RiakMapReduceJob; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.util.Assert; -import org.springframework.web.client.RestTemplate; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Future; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreOperations} - * and {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperations} for the Riak - * data store. - *

- * To use the RiakTemplate, create a singleton in your Spring application-context.xml: - *


- * <bean id="riak" class="org.springframework.data.keyvalue.riak.core.RiakTemplate"
- *     p:defaultUri="http://localhost:8098/riak/{bucket}/{key}"
- *     p:mapReduceUri="http://localhost:8098/mapred"/>
- * 
- * To store and retrieve objects in Riak, use the setXXX and getXXX methods (example in - * Groovy): - *

- * def obj = new TestObject(name: "My Name", age: 40)
- * riak.set([bucket: "mybucket", key: "mykey"], obj)
- * ...
- * def name = riak.get([bucket: "mybucket", key: "mykey"]).name
- * println "Hello $name!"
- * 
- * You're key object should be one of:
  • A String encoding the bucket and key - * together, separated by a colon. e.g. "mybucket:mykey"
  • An implementation of - * BucketKeyPair (like {@link org.springframework.data.keyvalue.riak.core.SimpleBucketKeyPair})
  • - *
  • A Map with both a "bucket" and a "key" specified.
  • A - * String of only the key name, but specifying a bucket by using the {@link - * org.springframework.data.keyvalue.riak.convert.KeyValueStoreMetaData} annotation on the - * object you're storing.
- * - * @author J. Brisbin - */ -public class RiakKeyValueTemplate extends AbstractRiakTemplate implements KeyValueStoreOperations, MapReduceOperations, InitializingBean { - - protected RiakTemplate riak; - - /** - * Take all the defaults. - */ - public RiakKeyValueTemplate() { - super(); - riak = new RiakTemplate(); - } - - /** - * Use the specified {@link org.springframework.http.client.ClientHttpRequestFactory}. - * - * @param requestFactory - */ - public RiakKeyValueTemplate(ClientHttpRequestFactory requestFactory) { - super(requestFactory); - riak = new RiakTemplate(requestFactory); - } - - /** - * Use the specified defaultUri and mapReduceUri. - * - * @param defaultUri - * @param mapReduceUri - */ - public RiakKeyValueTemplate(String defaultUri, String mapReduceUri) { - setRestTemplate(new RestTemplate()); - this.setDefaultUri(defaultUri); - this.mapReduceUri = mapReduceUri; - this.riak = new RiakTemplate(defaultUri, mapReduceUri); - } - - @Override - public void afterPropertiesSet() throws Exception { - super.afterPropertiesSet(); - riak.afterPropertiesSet(); - } - - /*----------------- Set Operations -----------------*/ - - public KeyValueStoreOperations set(K key, V value) { - return setWithMetaData(key, value, null, null); - } - - public KeyValueStoreOperations set(K key, V value, QosParameters qosParams) { - return setWithMetaData(key, value, null, qosParams); - } - - public KeyValueStoreOperations setAsBytes(K key, byte[] value) { - return setAsBytes(key, value, null); - } - - public KeyValueStoreOperations setAsBytes(K key, byte[] value, QosParameters qosParams) { - Assert.notNull(key, "Key cannot be null!"); - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, value); - riak.setAsBytes(bucketKeyPair.getBucket(), bucketKeyPair.getKey(), value, qosParams); - return this; - } - - public KeyValueStoreOperations setWithMetaData(K key, V value, Map metaData, QosParameters qosParams) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, value); - riak.setWithMetaData(bucketKeyPair.getBucket(), - bucketKeyPair.getKey(), - value, - metaData, - qosParams); - return this; - } - - public KeyValueStoreOperations setWithMetaData(K key, V value, Map metaData) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, value); - riak.setWithMetaData(bucketKeyPair.getBucket(), - bucketKeyPair.getKey(), - value, - metaData, - null); - return this; - } - - /*----------------- Get Operations -----------------*/ - - public RiakMetaData getMetaData(K key) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getMetaData(bucketKeyPair.getBucket(), bucketKeyPair.getKey()); - } - - public RiakValue getWithMetaData(K key, Class requiredType) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getWithMetaData(bucketKeyPair.getBucket(), - bucketKeyPair.getKey(), - requiredType); - } - - @SuppressWarnings({"unchecked"}) - public V get(K key) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return (V) riak.get(bucketKeyPair.getBucket(), bucketKeyPair.getKey()); - } - - public byte[] getAsBytes(K key) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - RiakValue obj = riak.getAsBytesWithMetaData(bucketKeyPair.getBucket(), - bucketKeyPair.getKey()); - return (null != obj ? obj.get() : null); - } - - public RiakValue getAsBytesWithMetaData(K key) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getAsBytesWithMetaData(bucketKeyPair.getBucket(), bucketKeyPair.getKey()); - } - - public T getAsType(K key, Class requiredType) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getAsType(bucketKeyPair.getBucket(), bucketKeyPair.getKey(), requiredType); - } - - public V getAndSet(K key, V value) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getAndSet(bucketKeyPair.getBucket(), bucketKeyPair.getKey(), value); - } - - public byte[] getAndSetAsBytes(K key, byte[] value) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getAndSetAsBytes(bucketKeyPair.getBucket(), bucketKeyPair.getKey(), value); - } - - public T getAndSetAsType(K key, V value, Class requiredType) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.getAndSetAsType(bucketKeyPair.getBucket(), - bucketKeyPair.getKey(), - value, - requiredType); - } - - @SuppressWarnings({"unchecked"}) - public List getValues(List keys) { - List results = new ArrayList(); - for (K key : keys) { - BucketKeyPair bkp = resolveBucketKeyPair(key, null); - results.add((V) riak.get(bkp.getBucket(), bkp.getKey())); - } - return results; - } - - public List getValues(K... keys) { - return getValues(keys); - } - - public List getValuesAsType(List keys, Class requiredType) { - List results = new ArrayList(); - for (K key : keys) { - BucketKeyPair bkp = resolveBucketKeyPair(key, null); - results.add(riak.getAsType(bkp.getBucket(), bkp.getKey(), requiredType)); - } - return results; - } - - public List getValuesAsType(Class requiredType, K... keys) { - return riak.getValuesAsType(requiredType, keys); - } - - /*----------------- Only-Set-Once Operations -----------------*/ - - public KeyValueStoreOperations setIfKeyNonExistent(K key, V value) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - riak.setIfKeyNonExistent(bucketKeyPair.getBucket(), bucketKeyPair.getKey(), value); - return this; - } - - public KeyValueStoreOperations setIfKeyNonExistentAsBytes(K key, byte[] value) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - riak.setIfKeyNonExistent(bucketKeyPair.getBucket(), bucketKeyPair.getKey(), value); - return this; - } - - /*----------------- Multiple Item Operations -----------------*/ - - public KeyValueStoreOperations setMultiple(Map keysAndValues) { - for (Map.Entry entry : keysAndValues.entrySet()) { - set(entry.getKey(), entry.getValue()); - } - return this; - } - - public KeyValueStoreOperations setMultipleAsBytes(Map keysAndValues) { - for (Map.Entry entry : keysAndValues.entrySet()) { - setAsBytes(entry.getKey(), entry.getValue()); - } - return this; - } - - public KeyValueStoreOperations setMultipleIfKeysNonExistent(Map keysAndValues) { - for (Map.Entry entry : keysAndValues.entrySet()) { - setIfKeyNonExistent(entry.getKey(), entry.getValue()); - } - return this; - } - - public KeyValueStoreOperations setMultipleAsBytesIfKeysNonExistent(Map keysAndValues) { - for (Map.Entry entry : keysAndValues.entrySet()) { - setIfKeyNonExistentAsBytes(entry.getKey(), entry.getValue()); - } - return this; - } - - /*----------------- Key Operations -----------------*/ - - public boolean containsKey(K key) { - BucketKeyPair bucketKeyPair = resolveBucketKeyPair(key, null); - return riak.containsKey(bucketKeyPair.getBucket(), bucketKeyPair.getKey()); - } - - public boolean deleteKeys(K... keys) { - return riak.deleteKeys(keys); - } - - /*----------------- Map/Reduce Operations -----------------*/ - - public RiakMapReduceJob createMapReduceJob() { - return new RiakMapReduceJob(riak); - } - - public Object execute(MapReduceJob job) { - return execute(job, List.class); - } - - public T execute(MapReduceJob job, Class targetType) { - return riak.execute(job, targetType); - } - - public Future> submit(MapReduceJob job) { - // Run this job asynchronously. - return riak.submit(job); - } - - /*----------------- Link Operations -----------------*/ - - /** - * Use Riak's native Link mechanism to link two entries together. - * - * @param destination Key to the child object - * @param source Key to the parent object - * @param tag The tag for this relationship - * @return This template interface - */ - public RiakKeyValueTemplate link(K1 destination, K2 source, String tag) { - BucketKeyPair bkpFrom = resolveBucketKeyPair(source, null); - BucketKeyPair bkpTo = resolveBucketKeyPair(destination, null); - riak.link(bkpTo.getBucket(), bkpTo.getKey(), bkpFrom.getBucket(), bkpFrom.getKey(), tag); - return this; - } - - /** - * Use Riak's link walking mechanism to retrieve a multipart message that will be decoded like - * they were individual objects (e.g. using the built-in HttpMessageConverters of - * RestTemplate). - * - * @param source - * @param tag - * @return - */ - @SuppressWarnings({"unchecked"}) - public T linkWalk(K source, String tag) { - BucketKeyPair bkpSource = resolveBucketKeyPair(source, null); - return (T) riak.linkWalk(bkpSource.getBucket(), bkpSource.getKey(), tag); - } - - /*----------------- Bucket Operations -----------------*/ - - public Map getBucketSchema(B bucket) { - return riak.getBucketSchema(bucket, false); - } - - public Map getBucketSchema(B bucket, boolean listKeys) { - return riak.getBucketSchema(bucket, listKeys); - } - - public KeyValueStoreOperations updateBucketSchema(B bucket, Map props) { - riak.updateBucketSchema(bucket, props); - return this; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakMetaData.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakMetaData.java deleted file mode 100644 index 12d80079c..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakMetaData.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.springframework.http.MediaType; - -import java.util.Date; -import java.util.Map; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.core.KeyValueStoreMetaData} - * for Riak. - * - * @author J. Brisbin - */ -public class RiakMetaData implements KeyValueStoreMetaData { - - private MediaType mediaType = MediaType.APPLICATION_JSON; - private Map properties; - private String bucket = null; - private String key = null; - - public RiakMetaData(Map properties) { - this.properties = properties; - } - - public RiakMetaData(MediaType mediaType, Map properties) { - this.mediaType = mediaType; - this.properties = properties; - } - - public RiakMetaData(MediaType mediaType, Map properties, String bucket, String key) { - this.mediaType = mediaType; - this.properties = properties; - this.bucket = bucket; - this.key = key; - } - - public void setBucket(String bucket) { - this.bucket = bucket; - } - - public void setKey(String key) { - this.key = key; - } - - public String getBucket() { - return this.bucket; - } - - public String getKey() { - return this.key; - } - - public MediaType getContentType() { - return mediaType; - } - - public long getLastModified() { - return ((Date) properties.get("Last-Modified")).getTime(); - } - - public Map getProperties() { - return this.properties; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakQosParameters.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakQosParameters.java deleted file mode 100644 index a0f4a0ebe..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakQosParameters.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * A generic class for specifying Quality Of Service parameters on operations. - * - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class RiakQosParameters implements QosParameters { - - public Object readThreshold = null; - public Object writeThreshold = null; - public Object durableWriteThreshold = null; - - public void setReadThreshold(T readThreshold) { - this.readThreshold = readThreshold; - } - - public void setWriteThreshold(T writeThreshold) { - this.writeThreshold = writeThreshold; - } - - public void setDurableWriteThreshold(T durableWriteThreshold) { - this.durableWriteThreshold = durableWriteThreshold; - } - - public T getReadThreshold() { - return (T) this.readThreshold; - } - - public T getWriteThreshold() { - return (T) this.writeThreshold; - } - - public T getDurableWriteThreshold() { - return (T) this.durableWriteThreshold; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakTemplate.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakTemplate.java deleted file mode 100644 index 740fb96f2..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakTemplate.java +++ /dev/null @@ -1,781 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.springframework.core.convert.ConversionService; -import org.springframework.dao.DataAccessResourceFailureException; -import org.springframework.data.keyvalue.riak.DataStoreOperationException; -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob; -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperations; -import org.springframework.http.*; -import org.springframework.http.client.ClientHttpRequest; -import org.springframework.http.client.ClientHttpRequestFactory; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; -import org.springframework.web.client.*; - -import javax.mail.BodyPart; -import javax.mail.MessagingException; -import javax.mail.internet.MimeMultipart; -import javax.mail.util.ByteArrayDataSource; -import java.io.ByteArrayOutputStream; -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.*; -import java.util.concurrent.Future; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.core.BucketKeyValueStoreOperations} - * and {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperations} for the Riak - * data store. - *

- * To use the RiakTemplate, create a singleton in your Spring application-context.xml: - *


- * <bean id="riak" class="org.springframework.data.keyvalue.riak.core.RiakTemplate"
- *     p:defaultUri="http://localhost:8098/riak/{bucket}/{key}"
- *     p:mapReduceUri="http://localhost:8098/mapred"/>
- * 
- * To store and retrieve objects in Riak, use the setXXX and getXXX methods (example in - * Groovy): - *

- * def obj = new TestObject(name: "My Name", age: 40)
- * riak.set("mybucket", "mykey", obj)
- * ...
- * def name = riak.get("mybucket", "mykey").name
- * println "Hello $name!"
- * 
- * - * @author J. Brisbin - */ -public class RiakTemplate extends AbstractRiakTemplate implements BucketKeyValueStoreOperations, MapReduceOperations { - - /** - * Take all the defaults. - */ - public RiakTemplate() { - super(); - } - - /** - * Use the specified {@link org.springframework.http.client.ClientHttpRequestFactory}. - * - * @param requestFactory - */ - public RiakTemplate(ClientHttpRequestFactory requestFactory) { - super(requestFactory); - } - - /** - * Use the specified defaultUri and mapReduceUri. - * - * @param defaultUri - * @param mapReduceUri - */ - public RiakTemplate(String defaultUri, String mapReduceUri) { - setRestTemplate(new RestTemplate()); - this.setDefaultUri(defaultUri); - this.mapReduceUri = mapReduceUri; - } - -/*----------------- Set Operations -----------------*/ - - public BucketKeyValueStoreOperations set(B bucket, K key, V value) { - return setWithMetaData(bucket, key, value, null, null); - } - - public BucketKeyValueStoreOperations set(B bucket, K key, V value, - QosParameters qosParams) { - return setWithMetaData(bucket, key, value, null, qosParams); - } - - public BucketKeyValueStoreOperations setAsBytes(B bucket, K key, byte[] value) { - return setAsBytes(bucket, key, value, null); - } - - public BucketKeyValueStoreOperations setAsBytes(B bucket, K key, byte[] value, - QosParameters qosParams) { - return setWithMetaData(bucket, key, value, null, qosParams); - } - - public BucketKeyValueStoreOperations setWithMetaData(B bucket, K key, V value, - Map metaData, - QosParameters qosParams) { - Assert.notNull(key, "Key cannot be null!"); - // Get a key name that may or may not include the QOS parameters. - String keyName = (null != qosParams ? key.toString() + extractQosParameters(qosParams) : key - .toString()); - - KeyValueStoreMetaData origMeta = getMetaData(bucket, keyName); - String vclock = null; - if (null != origMeta) { - Map mprops = origMeta.getProperties(); - if (null != mprops) { - Object o = mprops.get(RIAK_VCLOCK); - if (null != o) { - vclock = o.toString(); - } - } - } - RestTemplate restTemplate = getRestTemplate(); - HttpHeaders headers = new HttpHeaders(); - headers.set("X-Riak-ClientId", RIAK_CLIENT_ID); - if (log.isDebugEnabled() && null == value) { - log.debug("bucket=" + bucket + ", key=" + key); - } - headers.setContentType(extractMediaType(value)); - if (null != vclock) { - headers.set(RIAK_VCLOCK, vclock); - } - if (null != metaData) { - for (Map.Entry entry : metaData.entrySet()) { - headers.set(entry.getKey(), entry.getValue()); - } - } - headers.set(RIAK_META_CLASSNAME, - (null != value ? value.getClass().getName() : defaultType.getName())); - HttpEntity entity = new HttpEntity(value, headers); - try { - restTemplate.put(defaultUri, entity, bucket, keyName); - if (log.isDebugEnabled()) { - log.debug(String.format("PUT object: bucket=%s, key=%s, value=%s", bucket, key, value)); - } - } catch (RestClientException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } - return this; - } - - public BucketKeyValueStoreOperations setWithMetaData(B bucket, K key, V value, - Map metaData) { - return setWithMetaData(bucket, key, value, metaData, null); - } - - /*----------------- Put Operations -----------------*/ - - /** - * Save an object to Riak and let it generate an ID for it. - * - * @param bucket - * @param value - * @return The generated ID - */ - public String put(B bucket, V value) { - return put(bucket, value, null); - } - - /** - * Save an object to Riak and let it generate an ID for it. - * - * @param bucket - * @param value - * @param metaData - * @return The generated ID - */ - public String put(B bucket, V value, Map metaData) { - Assert.notNull(bucket, "Bucket cannot be null."); - String bucketName = bucket.toString(); - RestTemplate restTemplate = getRestTemplate(); - HttpHeaders headers = new HttpHeaders(); - headers.set("X-Riak-ClientId", RIAK_CLIENT_ID); - headers.setContentType(extractMediaType(value)); - if (null != metaData) { - for (Map.Entry entry : metaData.entrySet()) { - headers.set(entry.getKey(), entry.getValue()); - } - } - headers.set(RIAK_META_CLASSNAME, value.getClass().getName()); - HttpEntity entity = new HttpEntity(value, headers); - try { - URI uri = restTemplate.postForLocation(defaultUri, entity, bucketName, ""); - String suri = uri.toString(); - String id = suri.substring(suri.lastIndexOf("/") + 1); - if (log.isDebugEnabled()) { - log.debug("New ID: " + id); - } - return id; - } catch (RestClientException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } - } - - /*----------------- Get Operations -----------------*/ - - public RiakMetaData getMetaData(B bucket, K key) { - RestTemplate restTemplate = getRestTemplate(); - HttpHeaders headers; - try { - headers = restTemplate.headForHeaders(defaultUri, bucket, key); - RiakMetaData meta = extractMetaData(headers); - meta.setBucket((null != bucket ? bucket.toString() : null)); - meta.setKey((null != key ? key.toString() : null)); - return meta; - } catch (ResourceAccessException e) { - } catch (IOException e) { - throw new DataAccessResourceFailureException(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - public RiakValue getWithMetaData(B bucket, K key, Class requiredType) { - // If no bucket name is given, infer it from the type name. - String bucketName = (null != bucket ? bucket.toString() : requiredType.getName()); - RestTemplate restTemplate = getRestTemplate(); - if (log.isDebugEnabled()) { - log.debug(String.format("GET object: bucket=%s, key=%s, type=%s", - bucketName, - key, - requiredType.getName())); - } - Class origType = getType(bucket, key, classLoader); - RiakValue val = null; - try { - ResponseEntity result = restTemplate.getForEntity(defaultUri, - requiredType, - bucketName, - key); - val = extractValue(result, requiredType, requiredType); - } catch (HttpClientErrorException e) { - switch (e.getStatusCode()) { - case NOT_ACCEPTABLE: - // Can't convert using HttpMessageConverter. Try fetching as the original type - // and using the conversion service to convert. - ResponseEntity result = restTemplate.getForEntity(defaultUri, - origType, - bucketName, - key); - try { - val = extractValue(result, origType, requiredType); - } catch (IOException ioe) { - throw new DataStoreOperationException(ioe.getMessage(), ioe); - } - break; - case NOT_FOUND: - // IGNORED - break; - default: - throw new DataStoreOperationException(e.getMessage(), e); - } - if (e.getStatusCode() != HttpStatus.NOT_FOUND) { - throw new DataStoreOperationException(e.getMessage(), e); - } - } catch (RestClientException rce) { - if (rce.getMessage().contains("HTTP response code: 406")) { - // Can't convert using HttpMessageConverter. Try fetching as the original type - // and using the conversion service to convert. - ResponseEntity result = restTemplate.getForEntity(defaultUri, - origType, - bucketName, - key); - try { - val = extractValue(result, origType, requiredType); - } catch (IOException ioe) { - throw new DataStoreOperationException(rce.getMessage(), rce); - } - } else { - // IGNORE - if (log.isDebugEnabled()) { - log.debug("RestClientException: " + rce.getMessage()); - } - } - } catch (EOFException eof) { - // IGNORE - if (log.isDebugEnabled()) { - log.debug("EOFException: " + eof.getMessage(), eof); - } - } catch (IOException e) { - log.error(e.getMessage(), e); - } - - if (null != val && useCache) { - cache.put(new SimpleBucketKeyPair(bucket, key), val); - } - return val; - } - - @SuppressWarnings({"unchecked"}) - public T get(B bucket, K key) { - Class targetClass = getType(bucket, key, classLoader); - RiakValue obj = getWithMetaData(bucket, key, targetClass); - return (null != obj ? obj.get() : null); - } - - public byte[] getAsBytes(B bucket, K key) { - RiakValue obj = getAsBytesWithMetaData(bucket, key); - return (null != obj ? obj.get() : null); - } - - @SuppressWarnings({"unchecked"}) - public RiakValue getAsBytesWithMetaData(final B bucket, final K key) { - final RestTemplate restTemplate = getRestTemplate(); - if (log.isDebugEnabled()) { - log.debug(String.format("GET object: bucket=%s, key=%s, type=byte[]", - bucket, - key)); - } - - try { - RiakValue bytes = (RiakValue) restTemplate.execute( - defaultUri, - HttpMethod.GET, - new RequestCallback() { - public void doWithRequest(ClientHttpRequest request) throws - IOException { - List mediaTypes = new ArrayList(); - mediaTypes.add(MediaType.APPLICATION_JSON); - mediaTypes.add(MediaType.APPLICATION_OCTET_STREAM); - request.getHeaders().setAccept(mediaTypes); - } - }, - new ResponseExtractor() { - public Object extractData(ClientHttpResponse response) throws - IOException { - InputStream in = response.getBody(); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte[] buff = new byte[in.available()]; - for (int bytesRead = in.read(buff); bytesRead > 0; bytesRead = in.read( - buff)) { - out.write(buff, 0, bytesRead); - } - - HttpHeaders headers = response.getHeaders(); - RiakMetaData meta = extractMetaData(headers); - meta.setBucket((null != bucket ? bucket.toString() : null)); - meta.setKey((null != key ? key.toString() : null)); - RiakValue val = new RiakValue(out.toByteArray(), - meta); - return val; - } - }, - bucket, - key); - if (useCache) { - cache.put(new SimpleBucketKeyPair(bucket, key), bytes); - } - return bytes; - } catch (HttpClientErrorException e) { - if (e.getStatusCode() != HttpStatus.NOT_FOUND) { - throw new DataStoreOperationException(e.getMessage(), e); - } - } catch (RestClientException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - public T getAsType(B bucket, K key, Class requiredType) { - if (useCache) { - Object obj = checkCache(new SimpleBucketKeyPair(bucket, key), requiredType); - if (null != obj) { - return (T) obj; - } - } - RiakValue obj = getWithMetaData(bucket, key, requiredType); - return (null != obj ? obj.get() : null); - } - - @SuppressWarnings({"unchecked"}) - public V getAndSet(B bucket, K key, V value) { - V old = (V) getAsType(bucket, key, value.getClass()); - set(bucket, key, value, null); - return old; - } - - public byte[] getAndSetAsBytes(B bucket, K key, byte[] value) { - byte[] old = getAsBytes(bucket, key); - setAsBytes(bucket, key, value); - return old; - } - - public T getAndSetAsType(B bucket, K key, V value, Class requiredType) { - T old = getAsType(bucket, key, requiredType); - set(bucket, key, value); - return old; - } - - @SuppressWarnings({"unchecked"}) - public List getValues(List keys) { - List results = new ArrayList(); - for (K key : keys) { - BucketKeyPair bkp = resolveBucketKeyPair(key, null); - results.add((V) get(bkp.getBucket(), bkp.getKey())); - } - return results; - } - - public List getValues(K... keys) { - return getValues(keys); - } - - public List getValuesAsType(List keys, Class requiredType) { - List results = new ArrayList(); - for (K key : keys) { - BucketKeyPair bkp = resolveBucketKeyPair(key, null); - results.add(getAsType(bkp.getBucket(), bkp.getKey(), requiredType)); - } - return results; - } - - public List getValuesAsType(Class requiredType, K... keys) { - List keyList = new ArrayList(keys.length); - return getValuesAsType(keyList, requiredType); - } - - /*----------------- Only-Set-Once Operations -----------------*/ - - public BucketKeyValueStoreOperations setIfKeyNonExistent(B bucket, K key, V value) { - if (!containsKey(bucket, key)) { - set(bucket, key, value); - } else { - if (log.isDebugEnabled()) { - log.debug(String.format("key: %s already exists. Not adding %s", - key, - value)); - } - } - return this; - } - - public BucketKeyValueStoreOperations setIfKeyNonExistentAsBytes(B bucket, K key, - byte[] value) { - if (!containsKey(bucket, key)) { - setAsBytes(bucket, key, value); - } else { - if (log.isDebugEnabled()) { - log.debug(String.format("key: %s already exists. Not adding %s", - key, - value)); - } - } - return this; - } - - /*----------------- Key Operations -----------------*/ - - public boolean containsKey(B bucket, K key) { - RestTemplate restTemplate = getRestTemplate(); - HttpHeaders headers = null; - try { - headers = restTemplate.headForHeaders(defaultUri, bucket, key); - } catch (ResourceAccessException e) { - } - return (null != headers); - } - - @SuppressWarnings({"unchecked"}) - public boolean delete(B bucket, K key) { - return deleteKeys(new SimpleBucketKeyPair(bucket, key)); - } - - public boolean deleteKeys(K... keys) { - boolean stillExists = false; - RestTemplate restTemplate = getRestTemplate(); - for (K key : keys) { - BucketKeyPair bkp = resolveBucketKeyPair(key, null); - try { - restTemplate.delete(defaultUri, bkp.getBucket(), bkp.getKey()); - } catch (HttpClientErrorException e) { - if (e.getStatusCode() != HttpStatus.NOT_FOUND) { - throw new DataAccessResourceFailureException(e.getMessage(), e); - } - } - //if (!stillExists) { - //stillExists = containsKey(key); - //} - } - return !stillExists; - } - - /*----------------- Map/Reduce Operations -----------------*/ - - public Object execute(MapReduceJob job) { - return execute(job, List.class); - } - - @SuppressWarnings({"unchecked"}) - public T execute(MapReduceJob job, Class targetType) { - RestTemplate restTemplate = getRestTemplate(); - try { - ResponseEntity resp = restTemplate.postForEntity(mapReduceUri, - job.toJson(), - List.class); - if (resp.hasBody()) { - if (!targetType.isAssignableFrom(List.class)) { - // M/R jobs always return a List. Try to turn the List into something else. - List results = (List) resp.getBody(); - if (results.size() == 1) { - // A List of size 1 get's returned as the object at list[0]. - Object obj = results.get(0); - if (obj.getClass() != targetType) { - // I can't just return it as-is, I have to convert it first. - ConversionService conv = getConversionService(); - if (conv.canConvert(obj.getClass(), targetType)) { - return conv.convert(obj, targetType); - } else { - throw new DataAccessResourceFailureException( - "Can't find a converter to to convert " + obj - .getClass() + " returned from M/R job to required type " + targetType); - } - } else { - return (T) obj; - } - } - } - return (T) resp.getBody(); - } - } catch (RestClientException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - public Future> submit(MapReduceJob job) { - // Run this job asynchronously. - return workerPool.submit(job); - } - - /*----------------- Link Operations -----------------*/ - - /** - * Use Riak's native Link mechanism to link two entries together. - * - * @param destBucket Bucket of child entry - * @param destKey Key of child entry - * @param sourceBucket Bucket of parent entry - * @param sourceKey Key of parent entry - * @param tag Tag for this relationship - * @return - */ - @SuppressWarnings({"unchecked"}) - public RiakTemplate link(B1 destBucket, K1 destKey, B2 sourceBucket, - K2 sourceKey, String tag) { - RestTemplate restTemplate = getRestTemplate(); - - // Skip all conversion on the data since all we care about is the Link header. - RiakValue fromObj = getAsBytesWithMetaData(sourceBucket, sourceKey); - if (null == fromObj) { - throw new DataStoreOperationException( - "Cannot link from a non-existent source: " + sourceBucket + ":" + sourceKey); - } - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(fromObj.getMetaData().getContentType()); - headers.set(RIAK_VCLOCK, fromObj.getMetaData().getProperties().get(RIAK_VCLOCK).toString()); - Object linksObj = fromObj.getMetaData().getProperties().get("Link"); - List links = new ArrayList(); - // First add all existing links... - if (linksObj instanceof List) { - links.addAll((List) linksObj); - } else if (linksObj instanceof String) { - links.add(linksObj.toString()); - } - // ...then add the link we're creating... - links.add(String.format("<%s/%s/%s>; riaktag=\"%s\"", - getPrefix(), - destBucket, - destKey, - tag)); - String linkHeader = StringUtils.collectionToCommaDelimitedString(links); - headers.set("Link", linkHeader); - // Make sure to store the data back, otherwise it gets lost! - // Basho at some point will likely add the ability to updated metadata separate - // from the content. Until then, we have to transfer the body back-and-forth. - HttpEntity entity = new HttpEntity(fromObj.get(), headers); - restTemplate.put(defaultUri, entity, sourceBucket, sourceKey); - - return this; - } - - /** - * Use Riak's link walking mechanism to retrieve a multipart message that will be decoded like - * they were individual objects (e.g. using the built-in HttpMessageConverters of - * RestTemplate). - * - * @param bucket - * @param key - * @param tag - * @return - */ - @SuppressWarnings({"unchecked"}) - public T linkWalk(B bucket, K key, String tag) { - return (T) linkWalkAsType(bucket, key, tag, null); - } - - /** - * Use Riak's link walking mechanism to retrieve a multipart message that will be decoded like - * they were individual objects (e.g. using the built-in HttpMessageConverters of - * RestTemplate) and return the result as a list of objects of one of:
  1. The type - * specified by requiredType
  2. If that's null, try using the bucket name - * in which the object was stored
  3. If all else fails, use a {@link java.util.Map}
  4. - *
- * - * @param bucket - * @param key - * @param tag - * @param requiredType - * @return - */ - @SuppressWarnings({"unchecked"}) - public T linkWalkAsType(B bucket, K key, String tag, final Class requiredType) { - final RestTemplate restTemplate = getRestTemplate(); - final List types = new ArrayList(); - types.add(MediaType.ALL); - T returnObj = (T) restTemplate.execute(defaultUri + "/_,{tag},_", - HttpMethod.GET, - new RequestCallback() { - public void doWithRequest(ClientHttpRequest request) throws - IOException { - // Make sure I can accept a multipart/mixed response. - request.getHeaders().setAccept(types); - } - }, - new ResponseExtractor() { - @SuppressWarnings({"unchecked"}) - public Object extractData(ClientHttpResponse response) throws - IOException { - String contentType = ((List) response.getHeaders().get("Content-Type")).get(0) - .toString(); - if (contentType.startsWith("multipart/mixed")) { - List results = new LinkedList(); - ByteArrayDataSource ds = new ByteArrayDataSource(response.getBody(), - "multipart/mixed"); - try { - // All this mess is for extracting multipart data from our response. - // I'm using the javax.mail stuff because it's the best multipart library - // that's in Maven and it's a common dependency anyway. - MimeMultipart mp = new MimeMultipart(ds); - int msgCnt = mp.getCount(); - for (int i = 0; i < msgCnt; i++) { - BodyPart bp = mp.getBodyPart(i); - if (bp.getContentType().startsWith("multipart/mixed")) { - MimeMultipart part = (MimeMultipart) bp.getContent(); - int partCnt = part.getCount(); - for (int j = 0; j < partCnt; j++) { - final BodyPart partBody = part.getBodyPart(j); - String partType = partBody.getContentType(); - String link = partBody.getHeader("Link")[0]; - String location = partBody.getHeader("Location")[0]; - String key = location.substring(location.lastIndexOf("/") + 1); - String[] links = StringUtils.delimitedListToStringArray(link, ","); - String bucketName = null; - for (String s : links) { - if (s.contains("rel=\"up\"")) { - String[] linkParts = StringUtils.delimitedListToStringArray(s, ";"); - int start = linkParts[0].lastIndexOf("/"); - bucketName = linkParts[0].substring(start + 1, - linkParts[0].length() - 1); - break; - } - } - Class clazz = requiredType; - if (null == clazz) { - clazz = getType(bucketName, key, classLoader); - } - - // Can convert message? - for (HttpMessageConverter converter : restTemplate - .getMessageConverters()) { - if (converter.canRead(clazz, MediaType.parseMediaType(partType))) { - HttpInputMessage msg = new HttpInputMessage() { - public InputStream getBody() throws IOException { - try { - return partBody.getInputStream(); - } catch (MessagingException e) { - log.error(e.getMessage(), e); - } - return null; - } - - public HttpHeaders getHeaders() { - return new HttpHeaders(); - } - }; - results.add(converter.read(clazz, msg)); - break; - } - } - - if (log.isDebugEnabled()) { - log.debug(String.format("results=%s", results)); - } - } - } - } - } catch (MessagingException e) { - log.error(e.getMessage(), e); - } - - return results; - } - return null; - } - }, - bucket, - key, - tag); - return returnObj; - } - - /*----------------- Bucket Operations -----------------*/ - - public Map getBucketSchema(B bucket) { - return getBucketSchema(bucket, false); - } - - @SuppressWarnings({"unchecked"}) - public Map getBucketSchema(B bucket, boolean listKeys) { - RestTemplate restTemplate = getRestTemplate(); - ResponseEntity resp = restTemplate.getForEntity(defaultUri, - Map.class, - bucket, - (listKeys ? "?keys=true" : "")); - if (resp.hasBody()) { - return resp.getBody(); - } else { - throw new DataStoreOperationException( - "Error encountered retrieving bucket schema (Status: " + resp.getStatusCode() + ")"); - } - } - - @SuppressWarnings({"unchecked"}) - public BucketKeyValueStoreOperations updateBucketSchema(B bucket, - Map props) { - Map bucketProps = new LinkedHashMap(); - bucketProps.put("props", props); - RestTemplate restTemplate = getRestTemplate(); - String bucketName; - if (bucket instanceof String) { - bucketName = bucket.toString(); - } else { - BucketKeyPair bkp = resolveBucketKeyPair(bucket, null); - bucketName = bkp.getBucket().toString(); - } - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity entity = new HttpEntity(bucketProps, headers); - restTemplate.put(defaultUri, entity, bucketName, ""); - return this; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakValue.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakValue.java deleted file mode 100644 index 4ea033da7..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/RiakValue.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class RiakValue implements KeyValueStoreValue { - - private Object delegate; - private KeyValueStoreMetaData metaData; - - public RiakValue(T delegate, KeyValueStoreMetaData metaData) { - this.delegate = delegate; - this.metaData = metaData; - } - - public KeyValueStoreMetaData getMetaData() { - return this.metaData; - } - - public T get() { - return (T) delegate; - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyPair.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyPair.java deleted file mode 100644 index d60a8b854..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyPair.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class SimpleBucketKeyPair implements BucketKeyPair, Comparable { - - private Object bucket; - private Object key; - - public SimpleBucketKeyPair(B bucket, K key) { - this.bucket = bucket; - this.key = key; - } - - public B getBucket() { - return (B) bucket; - } - - public K getKey() { - return (K) key; - } - - public int compareTo(Object o) { - if (o instanceof SimpleBucketKeyPair) { - SimpleBucketKeyPair pair = (SimpleBucketKeyPair) o; - if (pair.getBucket().equals(bucket) && pair.getKey().equals(key)) { - return 0; - } - } - return -1; - } - - @Override - public String toString() { - return String.format("{bucket=%s, key=%s}", bucket, key); - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyResolver.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyResolver.java deleted file mode 100644 index 5d5ea0419..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/SimpleBucketKeyResolver.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -import org.codehaus.groovy.runtime.GStringImpl; -import org.springframework.util.ClassUtils; - -import java.util.Map; -import java.util.regex.Pattern; - -/** - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class SimpleBucketKeyResolver implements BucketKeyResolver { - - private final boolean groovyPresent = ClassUtils.isPresent( - "org.codehaus.groovy.runtime.GStringImpl", - getClass().getClassLoader()); - - protected Pattern bucketColonKey = Pattern.compile("(.+):(.+)"); - - public boolean canResolve(V o) { - if (o instanceof String) { - return true; - } else if (o instanceof Map) { - Map m = (Map) o; - return (m.containsKey("bucket") && m.containsKey("key")); - } else if (o instanceof BucketKeyPair) { - return true; - } else if (groovyPresent && o instanceof GStringImpl) { - return true; - } - - return false; - } - - public BucketKeyPair resolve(V o) { - BucketKeyPair bucketKeyPair = null; - - if (o instanceof String) { - String[] s = ((String) o).split(":"); - bucketKeyPair = new SimpleBucketKeyPair((s.length == 1 ? null : s[0]), - (s.length == 1 ? s[0] : s[1])); - } else if (o instanceof Map) { - Map m = (Map) o; - Object bucket = m.get("bucket"); - Object key = m.get("key"); - bucketKeyPair = new SimpleBucketKeyPair((null != bucket ? bucket - .toString() : null), - (null != key ? key.toString() : null)); - } else if (o instanceof BucketKeyPair) { - bucketKeyPair = (BucketKeyPair) o; - } else if (groovyPresent && o instanceof GStringImpl) { - bucketKeyPair = resolve(o.toString()); - } - - return bucketKeyPair; - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakFile.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakFile.java deleted file mode 100644 index 1687172af..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakFile.java +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core.io; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.data.keyvalue.riak.DataStoreOperationException; -import org.springframework.data.keyvalue.riak.core.KeyValueStoreMetaData; -import org.springframework.data.keyvalue.riak.core.RiakTemplate; -import org.springframework.data.keyvalue.riak.core.RiakValue; - -import java.io.File; -import java.io.FileFilter; -import java.io.FilenameFilter; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * @author J. Brisbin - */ -public class RiakFile extends File { - - private static final long serialVersionUID = 1L; - protected final Log log = LogFactory.getLog(getClass()); - - private RiakTemplate riak; - private B bucket; - private K key; - - public RiakFile(RiakTemplate riak, B bucket, K key) throws URISyntaxException { - super(riak.getDefaultUri()); - this.riak = riak; - this.bucket = bucket; - this.key = key; - } - - public String getUriAsString(boolean includeKey) { - String protocol = riak.getDefaultUri().substring(0, riak.getDefaultUri().indexOf(":")); - String uri = String.format("%s://%s:%s%s/%s/%s", - protocol, - riak.getHost(), - riak.getPort(), - riak.getPrefix(), - bucket, - (includeKey ? key : "")); - return uri; - } - - public RiakTemplate getRiak() { - return riak; - } - - public void setRiak(RiakTemplate riak) { - this.riak = riak; - } - - public B getBucket() { - return bucket; - } - - public void setBucket(B bucket) { - this.bucket = bucket; - } - - public K getKey() { - return key; - } - - public void setKey(K key) { - this.key = key; - } - - @Override - public String getName() { - return getUriAsString(true); - } - - @Override - public String getParent() { - return getUriAsString(false); - } - - @SuppressWarnings({"unchecked"}) - @Override - public File getParentFile() { - try { - return new RiakFile(riak, bucket, ""); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - return null; - } - - @Override - public String getPath() { - return getUriAsString(true); - } - - @Override - public boolean isAbsolute() { - return true; - } - - @Override - public String getAbsolutePath() { - return getUriAsString(true); - } - - @Override - public File getAbsoluteFile() { - return this; - } - - @Override - public String getCanonicalPath() throws IOException { - return getUriAsString(true); - } - - @Override - public File getCanonicalFile() throws IOException { - return this; - } - - @SuppressWarnings({"deprecation"}) - @Override - public URL toURL() throws MalformedURLException { - return new URL(getUriAsString(true)); - } - - @Override - public URI toURI() { - try { - return new URI(getUriAsString(true)); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - return null; - } - - @Override - public boolean canRead() { - return true; - } - - @Override - public boolean canWrite() { - return true; - } - - @Override - public boolean exists() { - return riak.containsKey(bucket, key); - } - - @Override - public boolean isDirectory() { - return (key != null && "".equals(key)); - } - - @Override - public boolean isFile() { - return (key != null && !("".equals(key))); - } - - @Override - public boolean isHidden() { - return false; - } - - @Override - public long lastModified() { - KeyValueStoreMetaData meta = riak.getMetaData(bucket, key); - return (null != meta ? meta.getLastModified() : null); - } - - @Override - public long length() { - return riak.getAsBytes(bucket, key).length; - } - - @Override - public boolean createNewFile() throws IOException { - return true; - } - - @Override - public boolean delete() { - return riak.delete(bucket, key); - } - - @Override - public void deleteOnExit() { - // NO-OP - } - - @Override - public String[] list() { - if (isDirectory()) { - Map schema = riak.getBucketSchema(bucket, true); - String baseUri = getUriAsString(false); - List uris = new LinkedList(); - for (Object key : (List) ((Map) schema.get("props")).get("keys")) { - uris.add(baseUri + key); - } - return (String[]) uris.toArray(); - } - return new String[]{}; - } - - @Override - public String[] list(FilenameFilter filenameFilter) { - List uris = new LinkedList(); - for (String s : list()) { - if (filenameFilter.accept(this, s)) { - uris.add(s); - } - } - return (String[]) uris.toArray(); - } - - @SuppressWarnings({"unchecked"}) - @Override - public File[] listFiles() { - List uris = new LinkedList(); - for (String s : list()) { - try { - uris.add(new RiakFile(riak, bucket, s.substring(s.lastIndexOf("/")))); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - } - return (File[]) uris.toArray(); - } - - @SuppressWarnings({"unchecked"}) - @Override - public File[] listFiles(FilenameFilter filenameFilter) { - List uris = new LinkedList(); - for (String s : list(filenameFilter)) { - try { - uris.add(new RiakFile(riak, bucket, s.substring(s.lastIndexOf("/")))); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - } - return (File[]) uris.toArray(); - } - - @Override - public File[] listFiles(FileFilter fileFilter) { - return super.listFiles(fileFilter); //To change body of overridden methods use File | Settings | File Templates. - } - - @Override - public boolean mkdir() { - return true; - } - - @Override - public boolean mkdirs() { - return true; - } - - @SuppressWarnings({"unchecked"}) - @Override - public boolean renameTo(File file) { - if (file instanceof RiakFile) { - RiakFile f = (RiakFile) file; - RiakValue v = riak.getAsBytesWithMetaData(bucket, key); - try { - riak.setWithMetaData(f.getBucket(), f.getKey(), v.get(), - (Map) v.getMetaData()); - } catch (DataStoreOperationException e) { - log.error(e.getMessage(), e); - return false; - } - } else { - throw new IllegalArgumentException("Renaming to a non-Riak file is not yet supported."); - } - return true; - } - - @Override - public boolean setLastModified(long l) { - return false; - } - - @Override - public boolean setReadOnly() { - return false; - } - - @Override - public boolean setWritable(boolean b, boolean b1) { - return true; - } - - @Override - public boolean setWritable(boolean b) { - return true; - } - - @Override - public boolean setReadable(boolean b, boolean b1) { - return true; - } - - @Override - public boolean setReadable(boolean b) { - return true; - } - - @Override - public boolean setExecutable(boolean b, boolean b1) { - return false; - } - - @Override - public boolean setExecutable(boolean b) { - return false; - } - - @Override - public boolean canExecute() { - return false; - } - - @Override - public long getTotalSpace() { - return super.getTotalSpace(); - } - - @Override - public long getFreeSpace() { - return super.getFreeSpace(); - } - - @Override - public long getUsableSpace() { - return super.getUsableSpace(); - } - - @Override - public int compareTo(File file) { - if (file instanceof RiakFile) { - return 0; - } else { - return -1; - } - } - - @Override - public boolean equals(Object o) { - if (o instanceof RiakFile) { - RiakFile rf = (RiakFile) o; - return (rf.getBucket().equals(bucket) && rf.getKey().equals(key)); - } - return false; - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + getUriAsString(true); - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakInputStream.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakInputStream.java deleted file mode 100644 index 279b711f7..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakInputStream.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core.io; - -import org.springframework.data.keyvalue.riak.core.RiakTemplate; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * An {@link java.io.InputStream} implementation that is backed by a resource residing in Riak. - * - * @author J. Brisbin - */ -public class RiakInputStream extends InputStream { - - private RiakTemplate riak; - private B bucket; - private K key; - private ByteArrayInputStream in; - - public RiakInputStream(RiakTemplate riak, B bucket, K key) { - this.riak = riak; - this.bucket = bucket; - this.key = key; - this.in = new ByteArrayInputStream(riak.getAsBytes(bucket, key)); - } - - @Override - public int read(byte[] bytes) throws IOException { - return in.read(bytes); - } - - @Override - public int read(byte[] bytes, int i, int i1) throws IOException { - return in.read(bytes, i, i1); - } - - @Override - public long skip(long l) throws IOException { - return in.skip(l); - } - - @Override - public int available() throws IOException { - return in.available(); - } - - @Override - public void close() throws IOException { - in.close(); - } - - @Override - public void mark(int i) { - in.mark(i); - } - - @Override - public void reset() throws IOException { - in.reset(); - } - - @Override - public boolean markSupported() { - return in.markSupported(); - } - - @Override - public int read() throws IOException { - return in.read(); - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakOutputStream.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakOutputStream.java deleted file mode 100644 index bb82608a0..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakOutputStream.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core.io; - -import org.springframework.data.keyvalue.riak.core.RiakTemplate; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -/** - * @author J. Brisbin - */ -public class RiakOutputStream extends ByteArrayOutputStream { - - private RiakTemplate riak; - private B bucket; - private K key; - - public RiakOutputStream(RiakTemplate riak, B bucket, K key) { - this.riak = riak; - this.bucket = bucket; - this.key = key; - } - - @Override - public void flush() throws IOException { - super.flush(); - riak.setAsBytes(bucket, key, toByteArray()); - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakResource.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakResource.java deleted file mode 100644 index 7b34e0c8a..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/RiakResource.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core.io; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.core.io.Resource; -import org.springframework.core.io.UrlResource; -import org.springframework.data.keyvalue.riak.core.RiakTemplate; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; - -/** - * An implementation of {@link org.springframework.core.io.UrlResource} that is backed by a - * resource in Riak. - * - * @author J. Brisbin - */ -public class RiakResource extends UrlResource { - - protected final Log log = LogFactory.getLog(getClass()); - - private RiakTemplate riak; - private B bucket; - private K key; - private String description; - - public RiakResource(RiakTemplate riak, B bucket, K key) throws MalformedURLException { - super(riak.getDefaultUri()); - this.bucket = bucket; - this.key = key; - } - - public RiakTemplate getRiakTemplate() { - return this.riak; - } - - public B getBucket() { - return bucket; - } - - public K getKey() { - return key; - } - - @SuppressWarnings({"unchecked"}) - @Override - public URL getURL() throws IOException { - try { - return new URL(new RiakFile(riak, bucket, key).getUriAsString(true)); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - public URI getURI() throws IOException { - try { - return new RiakFile(riak, bucket, key).toURI(); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - public Resource createRelative(String relativePath) throws MalformedURLException { - if (relativePath.startsWith("../")) { - return new RiakResource(riak, bucket, relativePath.substring(3)); - } else if (!relativePath.startsWith("/")) { - return new RiakResource(riak, bucket, relativePath); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - public String getFilename() { - try { - return new RiakFile(riak, bucket, key).getUriAsString(true); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - return riak.getDefaultUri(); - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public String getDescription() { - return this.description; - } - - @SuppressWarnings({"unchecked"}) - @Override - public File getFile() throws IOException { - try { - return new RiakFile(riak, bucket, key); - } catch (URISyntaxException e) { - log.error(e.getMessage(), e); - } - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - public InputStream getInputStream() throws IOException { - return new RiakInputStream(riak, bucket, key); - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/overview.html b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/overview.html deleted file mode 100644 index e9d4adc0c..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/io/overview.html +++ /dev/null @@ -1,15 +0,0 @@ - - -

- Utilities for working with resources stored in Riak as standard java.io objects. Opening a RiakInputStream to a resource will allow code that doesn't - know anything about Key/Value datastores to access resources stored within them. -

- -

- Alternatively, writing data to a RiakOutputStream will - create a resources in Riak without exposing any of the underlying data access code to the - calling application. -

- - \ No newline at end of file diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/overview.html b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/overview.html deleted file mode 100644 index dc82cc087..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/core/overview.html +++ /dev/null @@ -1,7 +0,0 @@ - - -

- Root package for the core utilities that make up the Riak data access library. -

- - \ No newline at end of file diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakBuilder.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakBuilder.java deleted file mode 100644 index 381465e7d..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakBuilder.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.groovy; - -import groovy.lang.Closure; -import groovy.util.BuilderSupport; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.keyvalue.riak.DataStoreOperationException; -import org.springframework.data.keyvalue.riak.core.AsyncRiakTemplate; -import org.springframework.data.keyvalue.riak.core.RiakQosParameters; -import org.springframework.data.keyvalue.riak.core.SimpleBucketKeyPair; -import org.springframework.data.keyvalue.riak.mapreduce.*; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * A Groovy Builder that implements a powerful and syntactically succinct DSL for Riak datastore - * access using SDKV for Riak's {@link AsyncRiakTemplate}. - *

- * The DSL responds to most of the important methods from the AsyncRiakTemplate: - *

  • set
  • setAsBytes
  • put
  • get
  • getAsBytes
  • - *
  • getAsType
  • containsKey
  • delete
  • foreach
- *

- * An example of DSL usage (to delete all entries in a bucket): - *

riak.foreach(bucket: "test") {
- *   completed { v, meta ->
- *     delete(bucket: "test", key: meta.key)
- *   }
- * }
- * 
- * - * @author J. Brisbin - */ -public class RiakBuilder extends BuilderSupport { - - private static enum NodeName { - CALL, FOREACH, MAPREDUCE, QUERY, MAP, REDUCE, INPUTS, LANGUAGE, SOURCE, KEEP, ARG, COMPLETED, FAILED - } - - protected final Log log = LogFactory.getLog(getClass()); - @Autowired(required = false) - protected AsyncRiakTemplate riak; - @Autowired(required = false) - protected ExecutorService workerPool = Executors.newCachedThreadPool(); - protected String defaultBucketName; - protected List results = new LinkedList(); - - public RiakBuilder() { - } - - public RiakBuilder(AsyncRiakTemplate riak) { - this.riak = riak; - } - - public RiakBuilder(AsyncRiakTemplate riak, ExecutorService workerPool) { - this.riak = riak; - this.workerPool = workerPool; - } - - public RiakBuilder(BuilderSupport proxyBuilder, AsyncRiakTemplate riak) { - super(proxyBuilder); - this.riak = riak; - } - - public RiakBuilder(Closure nameMappingClosure, BuilderSupport proxyBuilder, - AsyncRiakTemplate riak) { - super(nameMappingClosure, proxyBuilder); - this.riak = riak; - } - - public AsyncRiakTemplate getAsyncTemplate() { - return riak; - } - - public void setAsyncTemplate(AsyncRiakTemplate riak) { - this.riak = riak; - } - - public ExecutorService getWorkerPool() { - return workerPool; - } - - public void setWorkerPool(ExecutorService workerPool) { - this.workerPool = workerPool; - } - - @Override - protected void setParent(Object parent, Object child) { -// log.debug("setParent/2 " + parent + " " + child); - } - - @SuppressWarnings({"unchecked"}) - @Override - protected Object createNode(Object name) { -// log.debug("createNode/1 " + name); - NodeName nodeName = null; - try { - nodeName = NodeName.valueOf(name.toString().toUpperCase()); - } catch (IllegalArgumentException e) { - // IGNORED - } - if (null != nodeName) { - QueryPhase p; - switch (nodeName) { - case CALL: - break; - case FOREACH: - RiakOperation op = new RiakOperation(riak, - RiakOperation.Type.FOREACH); - op.setBucket(defaultBucketName); - return op; - case MAPREDUCE: - return createMapReduceJob(); - case QUERY: - p = new QueryPhase(); - p.job = ((RiakMapReduceOperation) getCurrent()).getJob(); - return getCurrent(); - case REDUCE: - case MAP: - p = new QueryPhase(); - p.job = ((RiakMapReduceOperation) getCurrent()).getJob(); - p.phase = name.toString(); - return p; - } - } else { - defaultBucketName = name.toString(); - } - - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - protected Object createNode(Object name, Object value) { -// log.debug("createNode/2 " + name + " " + value); - NodeName nodeName = null; - try { - nodeName = NodeName.valueOf(name.toString().toUpperCase()); - } catch (IllegalArgumentException e) { - // IGNORED - } - if (null != nodeName) { - QueryPhase p; - switch (nodeName) { - case INPUTS: - AsyncRiakMapReduceJob job = ((RiakMapReduceOperation) getCurrent()).getJob(); - if (null != value && value instanceof String) { - List keys = new ArrayList(); - keys.add(value.toString()); - job.addInputs(keys); - } else if (value instanceof List) { - job.addInputs((List) value); - } - return job; - case LANGUAGE: - p = (QueryPhase) getCurrent(); - p.language = value.toString(); - return p; - case SOURCE: - p = (QueryPhase) getCurrent(); - p.source = value.toString(); - return p; - case KEEP: - p = (QueryPhase) getCurrent(); - p.keep = (value instanceof Boolean ? (Boolean) value : new Boolean(value.toString())); - return p; - case ARG: - p = (QueryPhase) getCurrent(); - p.arg = value; - return p; - } - } - - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - protected Object createNode(Object name, Map attributes) { -// log.debug("createNode/2 (Map) " + name + " " + attributes); - NodeName nodeName = null; - try { - nodeName = NodeName.valueOf(name.toString().toUpperCase()); - } catch (IllegalArgumentException e) { - // IGNORED - } - if (null != nodeName) { - switch (nodeName) { - case MAPREDUCE: - RiakMapReduceOperation oper = createMapReduceJob(); - // Set timeout - Object o = attributes.get("wait"); - if (null != o) { - if (o instanceof Long) { - oper.setTimeout((Long) o); - } else if (o instanceof String) { - oper.setTimeout(new Long(o.toString())); - } else if (o instanceof Integer) { - oper.setTimeout(new Long((Integer) o)); - } else { - throw new IllegalArgumentException( - "Timeout should be an Integer, a Long, or a String denoting milliseconds"); - } - } - return oper; - case MAP: - case REDUCE: - QueryPhase p = new QueryPhase(); - p.job = ((RiakMapReduceOperation) getCurrent()).getJob(); - p.phase = name.toString(); - // Set arg - p.arg = attributes.get("arg"); - return p; - } - } - - RiakOperation.Type type = null; - try { - type = RiakOperation.Type.valueOf(name.toString().toUpperCase()); - } catch (IllegalArgumentException ignored) { - // IGNORED - } - if (null != type) { - RiakOperation op = new RiakOperation(riak, type); - // Set a bucket name - Object o = attributes.get("bucket"); - if (null == o && null != defaultBucketName) { - op.setBucket(defaultBucketName); - } else { - op.setBucket((null != o ? o.toString() : null)); - } - // Set the object's key - o = attributes.get("key"); - op.setKey((null != o ? o.toString() : null)); - // Set the value - o = attributes.get("value"); - op.setValue(o); - // Set the type of object (for getAsType) - o = attributes.get("type"); - if (null != o) { - if (o instanceof Class) { - op.setRequiredType((Class) o); - } else if (o instanceof String) { - try { - op.setRequiredType(Class.forName((String) o)); - } catch (ClassNotFoundException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } - } else { - op.setRequiredType(o.getClass()); - } - } - // Set QOS parameters - o = attributes.get("qos"); - if (null != o) { - RiakQosParameters qos = new RiakQosParameters(); - Map qosParams = (Map) o; - if (qosParams.containsKey("dw")) { - qos.setDurableWriteThreshold(qosParams.get("dw")); - } - if (qosParams.containsKey("w")) { - qos.setWriteThreshold(qosParams.get("w")); - } - if (qosParams.containsKey("r")) { - qos.setReadThreshold(qosParams.get("r")); - } - op.setQosParameters(qos); - } - // Set timeout - o = attributes.get("wait"); - if (null != o) { - if (o instanceof Long) { - op.setTimeout((Long) o); - } else if (o instanceof String) { - op.setTimeout(new Long(o.toString())); - } else if (o instanceof Integer) { - op.setTimeout(new Long((Integer) o)); - } else { - throw new IllegalArgumentException( - "Timeout should be an Integer, a Long, or a String denoting milliseconds"); - } - } - - return op; - } - - return null; - } - - @Override - protected Object createNode(Object name, Map attributes, Object value) { -// log.debug("createNode/3"); - return null; - } - - @SuppressWarnings({"unchecked"}) - @Override - public Object invokeMethod(String methodName, Object arg) { -// if (log.isDebugEnabled()) { -// log.debug("invokeMethod/2: " + methodName + " " + arg); -// } - NodeName nodeName = null; - try { - nodeName = NodeName.valueOf(methodName.toString().toUpperCase()); - } catch (IllegalArgumentException e) { - // IGNORED - } - if (null != nodeName) { - switch (nodeName) { - case COMPLETED: - case FAILED: - if (getCurrent() instanceof RiakOperation) { - RiakOperation op = (RiakOperation) getCurrent(); - Object[] args = (Object[]) arg; - Map params; - Closure handler = null; - Closure guard = null; - for (Object o : args) { - if (o instanceof Map) { - params = (Map) o; - if (params.containsKey("when")) { - guard = (Closure) params.get("when"); - } - } else if (o instanceof Closure) { - handler = (Closure) o; - } - } - op.addHandler(methodName, handler, guard); - return op; - } else if (getCurrent() instanceof RiakMapReduceOperation) { - RiakMapReduceOperation oper = (RiakMapReduceOperation) getCurrent(); - Object[] args = (Object[]) arg; - if ("completed".equals(methodName)) { - oper.setCompleted((Closure) args[0]); - } else if ("failed".equals(methodName)) { - oper.setFailed((Closure) args[0]); - } - return oper; - } - break; - case CALL: - results.clear(); - defaultBucketName = null; - } - } - - // By default - return super.invokeMethod(methodName, arg); - } - - @SuppressWarnings({"unchecked"}) - @Override - protected void nodeCompleted(Object parent, Object node) { -// if (log.isDebugEnabled()) { -// log.debug("nodeCompleted: parent=" + parent + ", node=" + node); -// } - if (parent instanceof RiakMapReduceOperation && node instanceof QueryPhase) { - QueryPhase p = (QueryPhase) node; - MapReduceOperation oper = null; - if ("javascript".equals(p.language)) { - if (null != p.source) { - oper = new JavascriptMapReduceOperation(p.source); - } else if (null != p.bucket && null != p.key) { - oper = new JavascriptMapReduceOperation(new SimpleBucketKeyPair(p.bucket, p.key)); - } - } else { - oper = new ErlangMapReduceOperation(p.module, p.func); - } - if (null != oper) { - RiakMapReducePhase phase = new RiakMapReducePhase(p.phase, p.language, oper); - if (null != p.keep) { - phase.setKeepResults(p.keep); - } - phase.setArg(p.arg); - p.job.addPhase(phase); - } - } else { - super.nodeCompleted(parent, node); - } - } - - @SuppressWarnings({"unchecked"}) - @Override - protected Object postNodeCompletion(Object parent, Object node) { -// if (log.isDebugEnabled()) { -// log.debug("postNodeCompletion: " + parent + " " + node); -// } - if (node instanceof RiakOperation) { - RiakOperation op = (RiakOperation) node; - try { - Object o = op.call(); - if (null != o && !o.equals(results)) { - results.add(o); - } - return o; - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } else if (null == parent && node instanceof RiakMapReduceOperation) { - RiakMapReduceOperation oper = (RiakMapReduceOperation) node; - try { - Object o = oper.call(); - if (null != o) { - results.add(o); - } - return o; - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - - return super.postNodeCompletion(parent, node); - } - - protected RiakMapReduceOperation createMapReduceJob() { - AsyncRiakMapReduceJob job = new AsyncRiakMapReduceJob(riak); - if (null != defaultBucketName) { - List keys = new ArrayList(); - keys.add(defaultBucketName); - job.addInputs(keys); - } - return new RiakMapReduceOperation(riak, job); - } - - private class QueryPhase { - - AsyncRiakMapReduceJob job; - String phase; - String language = "javascript"; - String source = null; - String bucket = null; - String key = null; - String module = null; - String func = null; - Boolean keep = null; - Object arg = null; - - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakMapReduceOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakMapReduceOperation.java deleted file mode 100644 index 6690e94b1..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakMapReduceOperation.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.groovy; - -import groovy.lang.Closure; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.data.keyvalue.riak.core.AsyncKeyValueStoreOperation; -import org.springframework.data.keyvalue.riak.core.AsyncRiakTemplate; -import org.springframework.data.keyvalue.riak.core.KeyValueStoreMetaData; -import org.springframework.data.keyvalue.riak.mapreduce.AsyncRiakMapReduceJob; - -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -/** - * @author J. Brisbin - */ -public class RiakMapReduceOperation implements Callable { - - protected final Log log = LogFactory.getLog(getClass()); - - protected AsyncRiakTemplate riak; - protected AsyncRiakMapReduceJob job; - protected Long timeout = -1L; - protected Closure completed = null; - protected Closure failed = null; - - public RiakMapReduceOperation(AsyncRiakTemplate riak, AsyncRiakMapReduceJob job) { - this.riak = riak; - this.job = job; - } - - public AsyncRiakMapReduceJob getJob() { - return job; - } - - public void setJob(AsyncRiakMapReduceJob job) { - this.job = job; - } - - public Long getTimeout() { - return timeout; - } - - public void setTimeout(Long timeout) { - this.timeout = timeout; - } - - public Closure getCompleted() { - return completed; - } - - public void setCompleted(Closure completed) { - this.completed = completed; - } - - public Closure getFailed() { - return failed; - } - - public void setFailed(Closure failed) { - this.failed = failed; - } - - public Object call() throws Exception { - Future f = riak.execute(job, new AsyncKeyValueStoreOperation, Object>() { - public Object completed(KeyValueStoreMetaData meta, List result) { - if (null != completed) { - if (completed.getParameterTypes().length == 2) { - return completed.call(new Object[]{result, meta}); - } else { - return completed.call(result); - } - } else { - return new Object[]{result, meta}; - } - } - - public Object failed(Throwable error) { - if (null != failed) { - return failed.call(error); - } else { - throw new RuntimeException(error); - } - } - }); - - if (timeout == 0) { - return f; - } else if (timeout < 0) { - return f.get(); - } else { - return f.get(timeout, TimeUnit.MILLISECONDS); - } - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakOperation.java deleted file mode 100644 index 0ce166410..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/RiakOperation.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.groovy; - -import groovy.lang.Closure; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.data.keyvalue.riak.DataStoreOperationException; -import org.springframework.data.keyvalue.riak.core.AsyncKeyValueStoreOperation; -import org.springframework.data.keyvalue.riak.core.AsyncRiakTemplate; -import org.springframework.data.keyvalue.riak.core.KeyValueStoreMetaData; -import org.springframework.data.keyvalue.riak.core.QosParameters; - -import java.util.*; -import java.util.concurrent.*; - -/** - * @author J. Brisbin - */ -public class RiakOperation implements Callable { - - static enum Type { - SET, SETASBYTES, PUT, GET, GETASBYTES, GETASTYPE, CONTAINSKEY, DELETE, FOREACH - } - - static String COMPLETED = "completed"; - static String FAILED = "failed"; - - protected final Log log = LogFactory.getLog(getClass()); - - protected AsyncRiakTemplate riak; - protected Type type; - protected String bucket; - protected String key; - protected T value; - protected Class requiredType = null; - protected long timeout = -1L; - protected QosParameters qosParameters; - protected Map> callbacks = new LinkedHashMap>(); - protected ClosureInvokingCallback callbackInvoker = new ClosureInvokingCallback(); - - public RiakOperation(AsyncRiakTemplate riak, Type type) { - this.riak = riak; - this.type = type; - } - - public Type getType() { - return type; - } - - public Map> getCallbacks() { - return callbacks; - } - - public QosParameters getQosParameters() { - return qosParameters; - } - - public void setQosParameters(QosParameters qosParameters) { - this.qosParameters = qosParameters; - } - - public String getBucket() { - return bucket; - } - - public void setBucket(String bucket) { - this.bucket = bucket; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public T getValue() { - return value; - } - - public void setValue(T value) { - this.value = value; - } - - public Class getRequiredType() { - return requiredType; - } - - public void setRequiredType(Class requiredType) { - this.requiredType = requiredType; - } - - public long getTimeout() { - return timeout; - } - - public void setTimeout(long timeout) { - this.timeout = timeout; - } - - public void addHandler(String type, Closure handler, Closure guard) { - List guardedClosures = callbacks.get(type); - if (null == guardedClosures) { - guardedClosures = new ArrayList(); - callbacks.put(type, guardedClosures); - } - guardedClosures.add(new GuardedClosure(handler, guard)); - } - - @SuppressWarnings({"unchecked"}) - public Object call() throws Exception { - Future f = null; - switch (type) { - case GET: - f = riak.get(bucket, key, callbackInvoker); - break; - case GETASBYTES: - f = riak.getAsBytes(bucket, key, callbackInvoker); - break; - case GETASTYPE: - f = riak.getAsType(bucket, key, requiredType, callbackInvoker); - break; - case PUT: - f = riak.put(bucket, value, callbackInvoker); - break; - case SET: - f = riak.set(bucket, key, value, callbackInvoker); - break; - case SETASBYTES: - byte[] bytes; - if (value instanceof byte[]) { - bytes = (byte[]) value; - } else { - bytes = riak.getConversionService().convert(value, byte[].class); - } - f = riak.setAsBytes(bucket, key, bytes, callbackInvoker); - break; - case CONTAINSKEY: - f = riak.containsKey(bucket, key, callbackInvoker); - break; - case DELETE: - f = riak.delete(bucket, key, callbackInvoker); - break; - case FOREACH: - f = riak.getBucketSchema(bucket, - null, - new AsyncKeyValueStoreOperation, Object>() { - public Object completed(KeyValueStoreMetaData meta, Map result) { - List results = new LinkedList(); - List keys = (List) result.get("keys"); - for (String key : keys) { - try { - Future getFut = riak.get(bucket, key, callbackInvoker); - if (timeout > 0) { - Object o = getFut.get(timeout, TimeUnit.MILLISECONDS); - if (null != o) { - results.add(o); - } - } else if (timeout < 0) { - Object o = getFut.get(); - if (null != o) { - results.add(o); - } - } else { - results.add(getFut); - } - } catch (InterruptedException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } catch (ExecutionException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } catch (TimeoutException e) { - throw new DataStoreOperationException(e.getMessage(), e); - } - } - return (results.size() > 0 ? results : null); - } - - public Object failed(Throwable error) { - throw new RuntimeException(error); - } - }); - break; - } - - if (null != f) { - if (timeout > 0) { - // Block until finished or timeout - return f.get(timeout, TimeUnit.MILLISECONDS); - } else if (timeout < 0) { - // Block indefinitely - return f.get(); - } - } - - return f; - } - - class GuardedClosure { - - private Closure delegate; - private Closure guard; - - GuardedClosure(Closure delegate, Closure guard) { - this.delegate = delegate; - this.guard = guard; - } - - public Closure getDelegate() { - return delegate; - } - - public Closure getGuard() { - return guard; - } - - } - - class ClosureInvokingCallback implements AsyncKeyValueStoreOperation { - - public Object completed(KeyValueStoreMetaData meta, Object result) { - if (!callbacks.containsKey(COMPLETED)) { - return new Object[]{result, meta}; - } - for (GuardedClosure cl : callbacks.get(COMPLETED)) { - boolean execute = true; - - Closure guardExpr = cl.getGuard(); - if (null != guardExpr) { - int noOfParams = guardExpr.getParameterTypes().length; - Object guardResult; - if (noOfParams == 2) { - guardResult = guardExpr.call(new Object[]{result, meta}); - } else { - guardResult = guardExpr.call(result); - } - if (null != guardResult) { - if (guardResult instanceof Boolean) { - execute = (Boolean) guardResult; - } else { - execute = true; - } - } - } - - if (execute) { - Closure callback = cl.getDelegate(); - if (callback.getParameterTypes().length == 2) { - return callback.call(new Object[]{result, meta}); - } else { - return callback.call(result); - } - } - } - return null; - } - - public Object failed(Throwable error) { - if (!callbacks.containsKey(FAILED)) { - throw new RuntimeException(error); - } - for (GuardedClosure cl : callbacks.get(FAILED)) { - boolean execute = true; - Closure guardExpr = cl.getGuard(); - if (null != guardExpr) { - Object guardResult = guardExpr.call(error); - if (null != guardResult) { - if (guardResult instanceof Boolean) { - execute = (Boolean) guardResult; - } else { - execute = true; - } - } - } - - if (execute) { - Closure callback = cl.getDelegate(); - return callback.call(error); - } - } - return null; - } - - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/overview.html b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/overview.html deleted file mode 100644 index d7856cbe9..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/groovy/overview.html +++ /dev/null @@ -1,8 +0,0 @@ - - -

- Utilities for making Riak data access easier in Groovy. The RiakBuilder - provides a Groovy DSL for interacting with Riak. -

- - \ No newline at end of file diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AbstractRiakMapReduceJob.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AbstractRiakMapReduceJob.java deleted file mode 100644 index 9ce6b664a..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AbstractRiakMapReduceJob.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codehaus.jackson.JsonFactory; -import org.codehaus.jackson.JsonGenerator; -import org.codehaus.jackson.map.ObjectMapper; -import org.springframework.data.keyvalue.riak.core.BucketKeyPair; - -import java.io.IOException; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * An implementation of {@link MapReduceJob} for the Riak data store. - * - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public abstract class AbstractRiakMapReduceJob implements MapReduceJob { - - protected final Log log = LogFactory.getLog(getClass()); - protected List inputs = new LinkedList(); - protected List phases = new ArrayList(); - - public List getInputs() { - return this.inputs; - } - - public MapReduceJob addInputs(List keys) { - inputs.addAll(keys); - return this; - } - - public MapReduceJob addPhase(MapReducePhase phase) { - phases.add(phase); - return this; - } - - public List getPhases() { - return this.phases; - } - - public String toJson() { - StringWriter out = new StringWriter(); - try { - JsonGenerator json = new JsonFactory().createJsonGenerator(out); - json.setCodec(new ObjectMapper()); - json.writeStartObject(); - - // Inputs - json.writeFieldName("inputs"); - if (1 == inputs.size() && !(inputs.get(0) instanceof List)) { - json.writeString(inputs.get(0).toString()); - } else if (inputs.size() > 0) { - json.writeStartArray(); - for (Object obj : inputs) { - List pair = (List) obj; - json.writeStartArray(); - json.writeString(pair.get(0).toString()); - json.writeString(pair.get(1).toString()); - json.writeEndArray(); - } - json.writeEndArray(); - } - - // Query - json.writeFieldName("query"); - json.writeStartArray(); - for (MapReducePhase phase : phases) { - json.writeStartObject(); - switch (phase.getPhase()) { - case MAP: - json.writeFieldName("map"); - break; - case REDUCE: - json.writeFieldName("reduce"); - break; - case LINK: - json.writeFieldName("link"); - } - - json.writeStartObject(); - json.writeStringField("language", phase.getLanguage()); - Object repr = phase.getOperation().getRepresentation(); - if (repr instanceof String) { - // Using source - json.writeStringField("source", - String.format("%s", phase.getOperation().getRepresentation())); - } else if (repr instanceof BucketKeyPair) { - BucketKeyPair pair = (BucketKeyPair) repr; - json.writeStringField("bucket", - String.format("%s", pair.getBucket())); - json.writeStringField("key", String.format("%s", pair.getKey())); - } else if (repr instanceof Map) { - for (Map.Entry entry : ((Map) repr).entrySet()) { - json.writeStringField(entry.getKey().toString(), - entry.getValue().toString()); - } - } - if (phase.getKeepResults()) { - json.writeBooleanField("keep", true); - } - // Arg - if (null != phase.getArg()) { - json.writeObjectField("arg", phase.getArg()); - } - - json.writeEndObject(); - json.writeEndObject(); - } - json.writeEndArray(); - - json.writeEndObject(); - json.flush(); - - } catch (IOException e) { - log.error(e.getMessage(), e); - } - return out.toString(); - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncMapReduceOperations.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncMapReduceOperations.java deleted file mode 100644 index fffc52c14..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncMapReduceOperations.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import org.springframework.data.keyvalue.riak.core.AsyncKeyValueStoreOperation; - -import java.util.List; -import java.util.concurrent.Future; - -/** - * Generic interface to Map/Reduce in data stores that support it. - * - * @author J. Brisbin - */ -public interface AsyncMapReduceOperations { - - /** - * Execute a {@link MapReduceJob} synchronously. - * - * @param job - * @return - */ - Future execute(MapReduceJob job, AsyncKeyValueStoreOperation, R> callback); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncRiakMapReduceJob.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncRiakMapReduceJob.java deleted file mode 100644 index 0679c6222..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/AsyncRiakMapReduceJob.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import org.springframework.data.keyvalue.riak.core.AsyncRiakTemplate; - -/** - * An implementation of {@link MapReduceJob} for the Riak data store. - * - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class AsyncRiakMapReduceJob extends AbstractRiakMapReduceJob { - - protected AsyncRiakTemplate riakTemplate; - - public AsyncRiakMapReduceJob(AsyncRiakTemplate riakTemplate) { - this.riakTemplate = riakTemplate; - } - - public AsyncRiakTemplate getAsyncRiakTemplate() { - return riakTemplate; - } - - public void setAsyncRiakTemplate(AsyncRiakTemplate riakTemplate) { - this.riakTemplate = riakTemplate; - } - - public Object call() throws Exception { - return riakTemplate.execute(this, null); - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/ErlangMapReduceOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/ErlangMapReduceOperation.java deleted file mode 100644 index 072bad831..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/ErlangMapReduceOperation.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperation} - * to represent an Erlang M/R function, which must be already defined inside the - * Riak server. - * - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class ErlangMapReduceOperation implements MapReduceOperation { - - protected String language = "erlang"; - protected Map moduleFunction = new LinkedHashMap(); - - public ErlangMapReduceOperation() { - } - - public ErlangMapReduceOperation(String module, String function) { - setModule(module); - setFunction(function); - } - - /** - * Set the Erlang module this function is defined in. - * - * @param module - */ - public void setModule(String module) { - moduleFunction.put("module", module); - } - - /** - * Set the name of this Erlang function. - * - * @param function - */ - public void setFunction(String function) { - moduleFunction.put("function", function); - } - - public Object getRepresentation() { - return moduleFunction; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/JavascriptMapReduceOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/JavascriptMapReduceOperation.java deleted file mode 100644 index b941e4a80..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/JavascriptMapReduceOperation.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import org.springframework.data.keyvalue.riak.core.BucketKeyPair; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceOperation} - * to describe a Javascript language M/R function. - * - * @author J. Brisbin - */ -public class JavascriptMapReduceOperation implements MapReduceOperation { - - protected String source; - protected BucketKeyPair bucketKeyPair; - - public JavascriptMapReduceOperation(String source) { - this.source = source; - } - - public JavascriptMapReduceOperation(BucketKeyPair bucketKeyPair) { - this.bucketKeyPair = bucketKeyPair; - } - - public String getSource() { - return source; - } - - /** - * Set the anonymous source to use for the M/R function. - * - * @param source - */ - public void setSource(String source) { - this.source = source; - } - - public BucketKeyPair getBucketKeyPair() { - return bucketKeyPair; - } - - /** - * Set the {@link org.springframework.data.keyvalue.riak.core.BucketKeyPair} to - * point to for the Javascript to use in this M/R function. - * - * @param bucketKeyPair - */ - public void setBucketKeyPair(BucketKeyPair bucketKeyPair) { - this.bucketKeyPair = bucketKeyPair; - } - - public Object getRepresentation() { - return (null != bucketKeyPair ? bucketKeyPair : source); - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceJob.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceJob.java deleted file mode 100644 index 19ceebd6f..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceJob.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import java.util.List; -import java.util.concurrent.Callable; - -/** - * A generic interface to representing a Map/Reduce job to a data store that supports that - * operation. - * - * @author J. Brisbin - */ -public interface MapReduceJob extends Callable { - - /** - * Get the list of inputs for this job. - * - * @return - */ - List getInputs(); - - /** - * Set the list of inputs for this job. - * - * @param keys - * @param - * @return - */ - MapReduceJob addInputs(List keys); - - /** - * Add a phase to this operation. - * - * @param phase - * @return - */ - MapReduceJob addPhase(MapReducePhase phase); - - /** - * Get the list of phases for this job. - * - * @return - */ - List getPhases(); - - /** - * Convert this job into the appropriate JSON to send to the server. - * - * @return - */ - String toJson(); -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceLinkOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceLinkOperation.java deleted file mode 100644 index 844628d63..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceLinkOperation.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.springframework.data.keyvalue.riak.mapreduce; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * @author J. Brisbin - */ -public class MapReduceLinkOperation implements MapReduceOperation { - - protected String bucket = null; - protected String key; - - public MapReduceLinkOperation(String bucket, String key) { - this.bucket = bucket; - this.key = key; - } - - public Object getRepresentation() { - Map repr = new LinkedHashMap(); - repr.put("bucket", (null != bucket ? bucket : "_")); - repr.put("key", (null != key ? key : "_")); - return repr; - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperation.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperation.java deleted file mode 100644 index feacc40f4..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperation.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -/** - * A generic interface to a Map/Reduce operation. - * - * @author J. Brisbin - */ -public interface MapReduceOperation { - - /** - * Get the implementation-specific representation of a Map/Reduce operation. - * - * @return - */ - Object getRepresentation(); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperations.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperations.java deleted file mode 100644 index 12b32e02b..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReduceOperations.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import java.util.List; -import java.util.concurrent.Future; - -/** - * Generic interface to Map/Reduce in data stores that support it. - * - * @author J. Brisbin - */ -public interface MapReduceOperations { - - /** - * Execute a {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob} - * synchronously. - * - * @param job - * @return - */ - Object execute(MapReduceJob job); - - /** - * Execute a MapReduceJob synchronously, converting the result into the given - * type. - * - * @param job - * @param targetType - * @return The converted value. - */ - T execute(MapReduceJob job, Class targetType); - - /** - * Submit the job to run asynchronously. - * - * @param job - * @return The Future representing the submitted job. - */ - Future> submit(MapReduceJob job); - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReducePhase.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReducePhase.java deleted file mode 100644 index 0eadb4b0f..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/MapReducePhase.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -/** - * A generic interface to the phases of Map/Reduce jobs. - * - * @author J. Brisbin - */ -public interface MapReducePhase { - - public static enum Phase { - MAP, REDUCE, LINK - } - - /** - * The bucket pattern to match on link phases. - * - * @return - */ - String getBucket(); - - /** - * Set the bucket pattern to match on link phases. - * - * @param bucket - */ - void setBucket(String bucket); - - Phase getPhase(); - - /** - * The language this phase is described in. - * - * @return - */ - String getLanguage(); - - /** - * Whether or not to keep the result of this phase. - * - * @return - */ - boolean getKeepResults(); - - /** - * Get the operation this phase will execute. - * - * @return - */ - MapReduceOperation getOperation(); - - /** - * Set the static argument for this job. - * - * @param arg - */ - void setArg(Object arg); - - /** - * Get the static argument for this phase. - * - * @return - */ - Object getArg(); -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReduceJob.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReduceJob.java deleted file mode 100644 index 424a4dad6..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReduceJob.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -import org.springframework.data.keyvalue.riak.core.RiakTemplate; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob} - * for the Riak data store. - * - * @author J. Brisbin - */ -@SuppressWarnings({"unchecked"}) -public class RiakMapReduceJob extends AbstractRiakMapReduceJob { - - protected RiakTemplate riakTemplate; - - public RiakMapReduceJob(RiakTemplate riakTemplate) { - this.riakTemplate = riakTemplate; - } - - public RiakTemplate getRiakTemplate() { - return riakTemplate; - } - - public void setRiakTemplate(RiakTemplate riakTemplate) { - this.riakTemplate = riakTemplate; - } - - public Object call() throws Exception { - return riakTemplate.execute(this); - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReducePhase.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReducePhase.java deleted file mode 100644 index 3e5ca4b87..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/RiakMapReducePhase.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.mapreduce; - -/** - * An implementation of {@link org.springframework.data.keyvalue.riak.mapreduce.MapReducePhase} - * for the Riak data store. - * - * @author J. Brisbin - */ -public class RiakMapReducePhase implements MapReducePhase { - - protected Phase phase; - protected String bucket; - protected String language; - protected MapReduceOperation operation; - protected boolean keepResults = false; - protected Object arg; - - public RiakMapReducePhase(String phase, String language, MapReduceOperation oper) { - this.phase = Phase.valueOf(phase.toUpperCase()); - this.language = language; - this.operation = oper; - } - - public RiakMapReducePhase(Phase phase, String language, MapReduceOperation oper) { - this.phase = phase; - this.language = language; - this.operation = oper; - } - - public String getBucket() { - return this.bucket; - } - - public void setBucket(String bucket) { - this.bucket = bucket; - } - - public Phase getPhase() { - return phase; - } - - public String getLanguage() { - return language; - } - - public MapReduceOperation getOperation() { - return this.operation; - } - - public boolean getKeepResults() { - return this.keepResults; - } - - public void setKeepResults(boolean keepResults) { - this.keepResults = keepResults; - } - - public void setOperation(MapReduceOperation oper) { - - this.operation = oper; - } - - public Object getArg() { - return arg; - } - - public void setArg(Object arg) { - this.arg = arg; - } -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/overview.html b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/overview.html deleted file mode 100644 index e9362f9de..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/mapreduce/overview.html +++ /dev/null @@ -1,7 +0,0 @@ - - -

- Root package for -

- - \ No newline at end of file diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/overview.html b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/overview.html deleted file mode 100644 index 4d1677397..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/overview.html +++ /dev/null @@ -1,8 +0,0 @@ - - -

- Root package for integrating Riak with Spring - concepts. -

- - \ No newline at end of file diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/Ignore404sErrorHandler.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/Ignore404sErrorHandler.java deleted file mode 100644 index 8e7bf5aac..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/Ignore404sErrorHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2011 by J. Brisbin - * Portions (c) 2011 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.util; - -import org.springframework.http.HttpStatus; -import org.springframework.http.client.ClientHttpResponse; -import org.springframework.web.client.DefaultResponseErrorHandler; - -import java.io.IOException; - -/** - * @author J. Brisbin - */ -public class Ignore404sErrorHandler extends DefaultResponseErrorHandler { - - @Override - protected boolean hasError(HttpStatus statusCode) { - if (statusCode != HttpStatus.NOT_FOUND) { - return super.hasError(statusCode); - } else { - return false; - } - } - - @Override - public void handleError(ClientHttpResponse response) throws IOException { - // Ignore 404s entirely - if (response.getStatusCode() != HttpStatus.NOT_FOUND) { - super.handleError(response); - } - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassFileLoader.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassFileLoader.java deleted file mode 100644 index 42ee23072..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassFileLoader.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2011 by J. Brisbin - * Portions (c) 2011 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.util; - -import org.apache.commons.cli.*; -import org.springframework.data.keyvalue.riak.core.RiakTemplate; - -import java.io.*; -import java.net.URLEncoder; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -/** - * @author J. Brisbin - */ -public class RiakClassFileLoader { - - static Options opts = new Options(); - - static { - opts.addOption("v", false, "Verbose output"); - opts.addOption("u", - true, - "URL to Riak (defaults to: 'http://localhost:8098/riak/{bucket}/{key}')"); - opts.addOption("b", true, "Bucket to load class files into"); - opts.addOption("k", true, "Key under which to store an individual class file"); - opts.addOption("j", true, "JAR file to load into Riak"); - opts.addOption("c", true, "Class file to load into Riak"); - opts.addOption("d", true, "Directory from which to load all JAR files into Riak"); - } - - public static void main(String[] args) { - Parser p = new BasicParser(); - CommandLine cl = null; - try { - cl = p.parse(opts, args); - } catch (ParseException e) { - System.err.println("Error parsing command line: " + e.getMessage()); - } - - if (null != cl) { - boolean verbose = cl.hasOption('v'); - RiakTemplate riak = new RiakTemplate(); - riak.getRestTemplate().setErrorHandler(new Ignore404sErrorHandler()); - if (cl.hasOption('u')) { - riak.setDefaultUri(cl.getOptionValue('u')); - } - try { - riak.afterPropertiesSet(); - } catch (Exception e) { - System.err.println("Error creating RiakTemplate: " + e.getMessage()); - } - String[] files = cl.getOptionValues('j'); - if (null != files) { - for (String file : files) { - if (verbose) { - System.out.println(String.format("Loading JAR file %s into Riak...", file)); - } - try { - File zfile = new File(file); - ZipInputStream zin = new ZipInputStream(new FileInputStream(zfile)); - ZipEntry entry; - while (null != (entry = zin.getNextEntry())) { - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - byte[] buff = new byte[16384]; - for (int bytesRead = zin.read(buff); bytesRead > 0; bytesRead = zin.read(buff)) { - bout.write(buff, 0, bytesRead); - } - - if (entry.getName().endsWith(".class")) { - String name = entry.getName().replaceAll("/", "."); - name = URLEncoder.encode(name.substring(0, name.length() - 6), "UTF-8"); - String bucket; - if (cl.hasOption('b')) { - bucket = cl.getOptionValue('b'); - } else { - bucket = URLEncoder.encode(zfile.getCanonicalFile().getName(), "UTF-8"); - } - if (verbose) { - System.out.println(String.format("Uploading to %s/%s", bucket, name)); - } - - // Load these bytes into Riak - riak.setAsBytes(bucket, name, bout.toByteArray()); - } - } - } catch (FileNotFoundException e) { - System.err.println("Error reading JAR file: " + e.getMessage()); - } catch (IOException e) { - System.err.println("Error reading JAR file: " + e.getMessage()); - } - } - } - - String[] classFiles = cl.getOptionValues('c'); - if (null != classFiles) { - for (String classFile : classFiles) { - try { - FileInputStream fin = new FileInputStream(classFile); - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - byte[] buff = new byte[16384]; - for (int bytesRead = fin.read(buff); bytesRead > 0; bytesRead = fin.read(buff)) { - bout.write(buff, 0, bytesRead); - } - - String name; - if (cl.hasOption('k')) { - name = cl.getOptionValue('k'); - } else { - throw new IllegalStateException( - "Must specify a Riak key in which to store the data if loading individual class files."); - } - String bucket; - if (cl.hasOption('b')) { - bucket = cl.getOptionValue('b'); - } else { - throw new IllegalStateException( - "Must specify a Riak bucket in which to store the data if loading individual class files."); - } - if (verbose) { - System.out.println(String.format("Uploading to %s/%s", bucket, name)); - } - - // Load these bytes into Riak - riak.setAsBytes(bucket, name, bout.toByteArray()); - - } catch (FileNotFoundException e) { - System.err.println("Error reading class file: " + e.getMessage()); - } catch (IOException e) { - System.err.println("Error reading class file: " + e.getMessage()); - } - } - } - } - } - -} diff --git a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassLoader.java b/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassLoader.java deleted file mode 100644 index bc1f8a82f..000000000 --- a/spring-data-riak/src/main/java/org/springframework/data/keyvalue/riak/util/RiakClassLoader.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2011 by J. Brisbin - * Portions (c) 2011 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.util; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.data.keyvalue.riak.core.RiakTemplate; -import org.springframework.http.HttpInputMessage; -import org.springframework.http.HttpOutputMessage; -import org.springframework.http.MediaType; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.http.converter.HttpMessageNotWritableException; -import org.springframework.web.client.RestTemplate; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -/** - * @author J. Brisbin - */ -public class RiakClassLoader extends ClassLoader { - - protected final Log log = LogFactory.getLog(getClass()); - protected Set buckets = new LinkedHashSet(); - protected RiakTemplate riakTemplate; - protected String defaultBucket = null; - - public RiakClassLoader(ClassLoader classLoader, RiakTemplate riakTemplate) { - super(classLoader); - init(riakTemplate); - loadBucketsFromClassPath(); - } - - public RiakClassLoader(RiakTemplate riakTemplate) { - init(riakTemplate); - loadBucketsFromClassPath(); - } - - public Set getBuckets() { - return buckets; - } - - public void setBuckets(Set buckets) { - this.buckets = buckets; - } - - public RiakTemplate getRiakTemplate() { - return riakTemplate; - } - - public void setRiakTemplate(RiakTemplate riakTemplate) { - this.riakTemplate = riakTemplate; - } - - public String getDefaultBucket() { - return defaultBucket; - } - - public void setDefaultBucket(String defaultBucket) { - this.defaultBucket = defaultBucket; - } - - @Override - protected Class findClass(String s) throws ClassNotFoundException { - Class c; - try { - c = super.findClass(s); - if (log.isDebugEnabled()) { - log.debug(String.format("Found class '%s' locally defined.", s)); - } - } catch (Throwable t) { - // Class not defined in this ClassLoader yet - } - - Set buckets = new LinkedHashSet(this.buckets); - if (null != defaultBucket) { - buckets.add(defaultBucket); - } - for (String bucket : buckets) { - if (bucket.indexOf("/") < 0) { - try { - if (log.isDebugEnabled()) { - log.debug(String.format("Class '%s' not locally defined, trying Riak.", s)); - } - byte[] buff = riakTemplate.getAsBytes(URLEncoder.encode(bucket, "UTF-8"), s); - c = defineClass(s, buff, 0, buff.length); - if (null != c) { - return c; - } - } catch (ClassFormatError ignored) { - } catch (UnsupportedEncodingException e) { - log.error(e.getMessage(), e); - } - } - } - - // Nothing found - throw new ClassNotFoundException("Class not found: " + s); - } - - - protected void loadBucketsFromClassPath() { - String classPath = System.getProperty("java.class.path"); - String pathSep = System.getProperty("path.separator", ":"); - if (null != classPath) { - String[] paths = classPath.split(pathSep); - for (String p : paths) { - buckets.add(p); - } - } - } - - protected void init(RiakTemplate riakTemplate) { - this.riakTemplate = riakTemplate; - RestTemplate tmpl = this.riakTemplate.getRestTemplate(); - tmpl.getMessageConverters().add(0, new JavaSerializationMessageHandler()); - tmpl.setErrorHandler(new Ignore404sErrorHandler()); - } - - private class JavaSerializationMessageHandler implements HttpMessageConverter { - - public boolean canRead(Class clazz, MediaType mediaType) { - return MediaType.APPLICATION_OCTET_STREAM.equals(mediaType); - } - - public boolean canWrite(Class clazz, MediaType mediaType) { - return null != clazz; - } - - public List getSupportedMediaTypes() { - List types = new ArrayList(1); - types.add(MediaType.APPLICATION_OCTET_STREAM); - return types; - } - - public Object read(java.lang.Class clazz, HttpInputMessage inputMessage) throws - IOException, - HttpMessageNotReadableException { - ObjectInputStream oin = new ObjectInputStream(inputMessage.getBody()); - try { - Class c = (Class) oin.readObject(); - if (log.isDebugEnabled()) { - log.debug("Loaded class: " + c); - } - return c; - } catch (ClassNotFoundException e) { - throw new IllegalStateException(e.getMessage(), e); - } - } - - public void write(Object o, MediaType contentType, HttpOutputMessage outputMessage) throws - IOException, - HttpMessageNotWritableException { - outputMessage.getHeaders().setContentType(MediaType.APPLICATION_OCTET_STREAM); - ObjectOutputStream oout = new ObjectOutputStream(outputMessage.getBody()); - oout.writeObject(o); - oout.flush(); - } - - } - -} diff --git a/spring-data-riak/src/main/resources/META-INF/spring/app-context.xml b/spring-data-riak/src/main/resources/META-INF/spring/app-context.xml deleted file mode 100644 index 7210563d2..000000000 --- a/spring-data-riak/src/main/resources/META-INF/spring/app-context.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Example configuration to get you started. - - diff --git a/spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.class b/spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.class deleted file mode 100644 index 5a576518a5fa757a49c68212e40499ace35b3e35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 639 zcmbtRO;5r=5Pb`j@=+BL5J^1X2{3Wv(V$#NJT-d2a9_$=3#Bz}!T7H<(U^Gf2l%6m zv!#9nxq0a9%M^8S?IA(?{+OU!rsK(r`D`SED=~88Vc!z&Py~*ulV&EmaYBYO(+_MO z-YUxLfVA%XV9LiL5_~G}7s8!OPIFUk`GMqpSA?PIi!pJ_Fd`4SEu)LrVx`qyXHpNp z0M*vtd*!<@@aKUg&mHBpvLbP$_BN11o;F*#GmwSO(EY~-45goky&O%X6`@J*uhB1I z^pOC?H09)gVu7j?q~g0`=LM`&PCX<2NbMAg6bp0$b)sm%pv+i8v4KshXa|%M8cwH@ z&^k{@KTxtH$i~h6U&Gq>@HWcHaF5VRDBC$)Bi|(d2Qfo!iAosMK58Q+yb~){J^{%F BgVX>3 diff --git a/spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.java b/spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.java deleted file mode 100644 index b8cd0896d..000000000 --- a/spring-data-riak/src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2011 by J. Brisbin - * Portions (c) 2011 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * @author J. Brisbin - */ -public class ClassLoaderTest { - - String name = "ClassLoaderTest"; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplateSpec.groovy b/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplateSpec.groovy deleted file mode 100644 index 4d24c5eb9..000000000 --- a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/AsyncRiakTemplateSpec.groovy +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core - -import java.util.concurrent.Future -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.context.ApplicationContext -import org.springframework.test.context.ContextConfiguration -import spock.lang.Specification - -/** - * @author J. Brisbin - */ -@ContextConfiguration(locations = "/org/springframework/data/AsyncRiakTemplateTests.xml") -class AsyncRiakTemplateSpec extends Specification { - - @Autowired - ApplicationContext appCtx - @Autowired - AsyncRiakTemplate riak - - def "Test async setWithMetaData"() { - - given: - def obj = [test: "value", integer: 12] - def success = false - def failure = false - def testValue = "bad value" - def callback = [ - completed: { v -> - success = true - testValue = v.get().test - }, - failed: { e -> - failure = true - } - ] as AsyncKeyValueStoreOperation - - when: - Future future = riak.setWithMetaData("test", "test", obj, null, null, callback) - println "Waiting for result: ${future.get()}" - - then: - success && !failure - "value" == testValue - - } - - def "Test async getWithMetaData"() { - - given: - def result = null - def callback = [ - completed: { meta, v -> - println "got value: $meta $v" - result = v - }, - failed: { e -> - println "got error: $e" - } - ] as AsyncKeyValueStoreOperation - - when: - riak.getWithMetaData("test", "test", Map, callback).get() - - then: - null != result - - } - -} diff --git a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakBuilderSpec.groovy b/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakBuilderSpec.groovy deleted file mode 100644 index f7efc4f8a..000000000 --- a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakBuilderSpec.groovy +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core - -import java.util.concurrent.Future -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.context.ApplicationContext -import org.springframework.data.keyvalue.riak.groovy.RiakBuilder -import org.springframework.test.context.ContextConfiguration -import spock.lang.Specification - -/** - * @author J. Brisbin - */ -@ContextConfiguration(locations = "/org/springframework/data/AsyncRiakTemplateTests.xml") -class RiakBuilderSpec extends Specification { - - @Autowired - ApplicationContext appCtx - @Autowired - AsyncRiakTemplate riakTemplate - - def "Test builder set"() { - - given: - def obj = [test: "value", integer: 12] - def riak = new RiakBuilder(riakTemplate) - def result = null - - when: - riak { - set(bucket: "test", key: "test", qos: [dw: "all"], value: obj) { - completed(when: { it.integer == 12 }) { result = it.test } - completed { result = "otherwise" } - failed { it.printStackTrace() } - } - } - - then: - "value" == result - - } - - def "Test builder get"() { - - given: - def riak = new RiakBuilder(riakTemplate) - def result = null - - when: - riak.get(bucket: "test", key: "test") { - completed(when: { it.integer == 12 }) { result = it.test } - completed { result = "otherwise" } - failed { it.printStackTrace() } - } - - then: - null != result - "value" == result - - } - - def "Test builder async get"() { - - given: - def riak = new RiakBuilder(riakTemplate) - def result = null - - when: - def f = riak.get(bucket: "test", key: "test", wait: 0) { - completed(when: { it.integer == 12 }) { result = it.test } - completed { result = "otherwise" } - failed { it.printStackTrace() } - } - - then: - f instanceof Future - null != f.get() - - } - - def "Test builder getAsType"() { - - given: - def riak = new RiakBuilder(riakTemplate) - def result = null - - when: - riak.getAsType(bucket: "test", key: "test", type: Map) { - completed(when: { it instanceof Map }) { result = it.test } - completed { result = "otherwise" } - failed { it.printStackTrace() } - } - - then: - "value" == result - - } - - def "Test builder setAsBytes"() { - - given: - def obj = "test bytes".bytes - def riak = new RiakBuilder(riakTemplate) - def result = null - - when: - riak.setAsBytes(bucket: "test", key: "test", value: obj, qos: [dw: "all"]) { - completed { result = "success" } - failed { it.printStackTrace() } - } - - then: - null != result - "success" == result - - } - - def "Test builder get with bytes"() { - - given: - def riak = new RiakBuilder(riakTemplate) - - when: - def result = riak.get(bucket: "test", key: "test") { - failed { it.printStackTrace() } - } - - then: - null != result - "test bytes".bytes == result[0] - - } - - def "Test builder put"() { - - given: - def obj = [test: "value", integer: 12] - def riak = new RiakBuilder(riakTemplate) - - when: - def id = riak.put(bucket: "test", qos: [dw: "all"], value: obj) { - completed { v, meta -> meta.key } - failed { it.printStackTrace() } - } - - then: - null != id - - } - - def "Test builder foreach"() { - - given: - def riak = new RiakBuilder(riakTemplate) - def idCnt = 0 - - when: - riak.foreach(bucket: "test") { - completed { idCnt++ } - failed { it.printStackTrace() } - } - - then: - idCnt > 0 - - } - - def "Test builder batch operations"() { - - given: - def riak = new RiakBuilder(riakTemplate) - def ids = [] - - when: - riak { - test { - put(value: [test: "value 1"]) - put(value: [test: "value 2"]) - put(value: [test: "value 3"]) - - foreach { - completed { v, meta -> ids << meta.key } - failed { it.printStackTrace() } - } - } - } - - then: - null != ids - 3 <= ids.size() - - } - - def "Test builder bucket as node"() { - - given: - def riak = new RiakBuilder(riakTemplate) - def ids = [] - - when: - riak { - "test" { - put(value: [test: "value 1"]) - put(value: [test: "value 2"]) - put(value: [test: "value 3"]) - - foreach { - completed { v, meta -> ids << meta.key } - failed { it.printStackTrace() } - } - } - } - - then: - null != ids - 3 <= ids.size() - - } - - def "Test builder Map/Reduce"() { - - given: - def riak = new RiakBuilder(riakTemplate) - - when: - riak { - mapreduce { - inputs "test" - query { - map(arg: [test: "arg", alist: [1, 2, 3, 4]]) { - source "function(v, keyInfo, arg){ return [1]; }" - } - reduce { - source "function(v){ return Riak.reduceSum(v); }" - } - } - completed { it } - failed { it.printStackTrace() } - } - } - - then: - null != riak.results - 1 <= riak.results.size() - - } - - def "Test builder delete"() { - - given: - def riak = new RiakBuilder(riakTemplate) - - when: - riak { - "test" { - foreach { - completed { v, meta -> delete(key: meta.key) } - failed { deleted = false } - } - } - } - - then: - !riak.results.find { !it } - - } - -} diff --git a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakClassLoaderSpec.groovy b/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakClassLoaderSpec.groovy deleted file mode 100644 index 43a410793..000000000 --- a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakClassLoaderSpec.groovy +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2011 by J. Brisbin - * Portions (c) 2011 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core - -import org.springframework.data.keyvalue.riak.util.RiakClassFileLoader -import org.springframework.data.keyvalue.riak.util.RiakClassLoader -import spock.lang.Shared -import spock.lang.Specification - -/** - * @author J. Brisbin - */ -class RiakClassLoaderSpec extends Specification { - - @Shared RiakTemplate riakTemplate = new RiakTemplate() - - def setupSpec() { - RiakQosParameters qos = new RiakQosParameters() - qos.durableWriteThreshold = "all" - riakTemplate.defaultQosParameters = qos - riakTemplate.ignoreNotFound = true - riakTemplate.afterPropertiesSet() - } - - def "Test load class file into Riak"() { - - when: - def args = [ - "-c", "src/test/classes/org/springframework/data/keyvalue/riak/core/ClassLoaderTest.class", - "-b", "test", - "-k", "org.springframework.data.keyvalue.riak.core.ClassLoaderTest" - ].toArray(new String[6]) - RiakClassFileLoader.main(args) - - then: - true - - } - - def "Test find class previously loaded into Riak"() { - - given: - RiakClassLoader classLoader = new RiakClassLoader(riakTemplate) - classLoader.defaultBucket = "test" - - when: - def clazz = Class.forName("org.springframework.data.keyvalue.riak.core.ClassLoaderTest", false, classLoader) - def inst = clazz?.newInstance() - - then: - null != clazz - null != inst - inst.name == "ClassLoaderTest" - - } - -} diff --git a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplateSpec.groovy b/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplateSpec.groovy deleted file mode 100644 index 25fcb48d6..000000000 --- a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakKeyValueTemplateSpec.groovy +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.keyvalue.riak.core - -import org.springframework.data.keyvalue.riak.mapreduce.JavascriptMapReduceOperation -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob -import org.springframework.data.keyvalue.riak.mapreduce.RiakMapReducePhase -import org.springframework.data.keyvalue.riak.util.Ignore404sErrorHandler -import spock.lang.Shared -import spock.lang.Specification - -/** - * @author J. Brisbin - */ -class RiakKeyValueTemplateSpec extends Specification { - - @Shared RiakKeyValueTemplate riak = new RiakKeyValueTemplate() - int run = 1 - @Shared def riakBin = System.properties["bamboo.RIAK_BIN"] ?: "/usr/sbin/riak" - @Shared def p - - def setupSpec() { - RiakQosParameters qos = new RiakQosParameters() - qos.setDurableWriteThreshold("all") - riak.setDefaultQosParameters(qos) - riak.getRestTemplate().setErrorHandler(new Ignore404sErrorHandler()) - - if (!riak.get("status", "")) { - p = "$riakBin start".execute() - p.waitFor() - shutdown = true - Thread.sleep(2000) - } - - riak.getBucketSchema("test", true).keys.each { - riak.delete("test", it) - } - riak.getBucketSchema(TestObject.name, true).keys.each { - riak.delete("test", it) - } - } - - def cleanupSpec() { - if (shutdown) { - p = "$riakBin stop".execute() - p.waitFor() - } - } - - def "Test Map object"() { - - given: - def val = "value" - def objIn = [test: val, integer: 12] - riak.set("test:test", objIn) - - when: - def objOut = riak.get("test:test") - - then: - objOut.test == val - - } - - def "Test custom object"() { - - given: - TestObject objIn = new TestObject() - riak.set("${TestObject.name}:test", objIn) - - when: - TestObject objOut = riak.get("${TestObject.name}:test") - - then: - objOut.test == "value" - - } - - def "Test getting bucket schema"() { - - when: - def schema = riak.getBucketSchema("test", true) - - then: - "test" == schema.props.name - - } - - def "Test updating bucket schema"() { - - when: - def schema = riak.updateBucketSchema("test", [n_val: 2]).getBucketSchema("test") - - then: - 2 == schema.props.n_val - - } - - def "Test get with metadata"() { - - when: - def val = riak.getWithMetaData([bucket: "test", key: "test"], LinkedHashMap) - - then: - val.metaData.properties["Server"].contains("WebMachine") - - } - - def "Test setting QosParameters"() { - - given: - def obj = riak.get("test:test") - - when: - def qos = new RiakQosParameters() - qos.durableWriteThreshold = "all" - riak.set("test:test", obj, qos) - - then: - true - - } - - def "Test containsKey"() { - - when: - def containsKey = riak.containsKey([bucket: "test", key: "test"]) - - then: - true == containsKey - - } - - def "Test linking"() { - - given: - riak.link("${TestObject.name}:test", "test:test", "test") - - when: - def val = riak.getWithMetaData("test:test", Map) - def result = val.metaData.properties["Link"].find { it.contains("riaktag=\"test\"") } - - then: - null != result - - } - - def "Test link walking"() { - - when: - def val = riak.linkWalk("test:test", "test") - - then: - null != val - 1 == val.size() - val.get(0) instanceof TestObject - - } - - def "Test multiple get"() { - - when: - def objs = riak.getValues([ - new SimpleBucketKeyPair("test", "test"), - new SimpleBucketKeyPair(TestObject.name, "test") - ]) - - then: - 2 == objs.size() - - } - - def "Test getAndSet with Map"() { - - given: - def i = run++ - def newObj = [test: "value $i", integer: 12] - - when: - def oldObj = riak.getAndSet("test:test", newObj) - - then: - "value" == oldObj.test - - } - - def "Test setMultipleIfKeysNonExistent with Map"() { - - given: - def testKey = new SimpleBucketKeyPair("test", "test") - def testKey2 = new SimpleBucketKeyPair(TestObject.name, "test") - def newObj = [:] - newObj[testKey] = [test: "value", integer: 12] - newObj[testKey2] = [test: "value", integer: 12] - - when: - def secondObj = riak.setMultipleIfKeysNonExistent(newObj).get(testKey2) - secondObj.test = "newValue" - def updObj = [:] - updObj[testKey2] = secondObj - def thirdObj = riak.setMultipleIfKeysNonExistent(updObj).get(testKey2) - - then: - "value" == thirdObj.test - - } - - def "Test Map/Reduce returning Integer"() { - - given: - MapReduceJob job = riak.createMapReduceJob() - def mapJs = new JavascriptMapReduceOperation("function(v){ var o=Riak.mapValuesJson(v); return [1]; }") - def mapPhase = new RiakMapReducePhase("map", "javascript", mapJs) - - def reduceJs = new JavascriptMapReduceOperation("function(v){ var s=Riak.reduceSum(v); return s; }") - def reducePhase = new RiakMapReducePhase("reduce", "javascript", reduceJs) - - job.addInputs(["test"]). - addPhase(mapPhase). - addPhase(reducePhase) - println job.toJson() - - when: - def result = riak.execute(job, Integer) - - then: - 1 == result - - } - - def "Test Map/Reduce returning List"() { - - given: - MapReduceJob job = riak.createMapReduceJob() - def mapJs = new JavascriptMapReduceOperation("function(v){ ejsLog('/tmp/mapred.log', 'map v: '+JSON.stringify(v)); var o=Riak.mapValuesJson(v); return [1]; }") - def mapPhase = new RiakMapReducePhase("map", "javascript", mapJs) - - def reduceJs = new JavascriptMapReduceOperation("function(v){ ejsLog('/tmp/mapred.log', 'red v: '+JSON.stringify(v)); var s=Riak.reduceSum(v); return s; }") - def reducePhase = new RiakMapReducePhase("reduce", "javascript", reduceJs) - - job.addInputs(["test"]). - addPhase(mapPhase). - addPhase(reducePhase) - - when: - def result = riak.execute(job) - - then: - 1 == result.size() - 1 == result[0] - - } - - def "Test deleteKeys"() { - - given: - def testKey = new SimpleBucketKeyPair("test", "test") - def testKey2 = new SimpleBucketKeyPair(TestObject.name, "test") - - when: - def deleted = riak.deleteKeys(testKey, testKey2) - - then: - true == deleted - - } - -} \ No newline at end of file diff --git a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakTemplateSpec.groovy b/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakTemplateSpec.groovy deleted file mode 100644 index e6988c764..000000000 --- a/spring-data-riak/src/test/groovy/org/springframework/data/keyvalue/riak/core/RiakTemplateSpec.groovy +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * Portions (c) 2010 by NPC International, Inc. or the - * original author(s). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.keyvalue.riak.core - -import org.springframework.data.keyvalue.riak.core.io.RiakFile -import org.springframework.data.keyvalue.riak.mapreduce.JavascriptMapReduceOperation -import org.springframework.data.keyvalue.riak.mapreduce.MapReduceJob -import org.springframework.data.keyvalue.riak.mapreduce.RiakMapReduceJob -import org.springframework.data.keyvalue.riak.mapreduce.RiakMapReducePhase -import spock.lang.Shared -import spock.lang.Specification - -/** - * @author J. Brisbin - */ -class RiakTemplateSpec extends Specification { - - @Shared RiakTemplate riak = new RiakTemplate() - int run = 1 - @Shared def riakBin = System.properties["bamboo.RIAK_BIN"] ?: "/usr/sbin/riak" - @Shared def p - @Shared def id - @Shared boolean shutdown = false - - def setupSpec() { - RiakQosParameters qos = new RiakQosParameters() - qos.setDurableWriteThreshold("all") - riak.setDefaultQosParameters(qos) - riak.ignoreNotFound = true - - if (!riak.get("status", "")) { - p = "$riakBin start".execute() - p.waitFor() - shutdown = true - Thread.sleep(2000) - } - - riak.getBucketSchema("test", true).keys.each { - riak.delete("test", it) - } - riak.getBucketSchema(TestObject.name, true).keys.each { - riak.delete("test", it) - } - } - - def cleanupSpec() { - if (shutdown) { - p = "$riakBin stop".execute() - p.waitFor() - } - } - - def "Test Map object"() { - - given: - def val = "value" - def objIn = [test: val, integer: 12] - riak.set("test", "test", objIn) - - when: - def objOut = riak.get("test", "test") - - then: - objOut.test == val - - } - - def "Test generating ID for object"() { - - given: - def val = "value" - def objIn = [test: val, integer: 12] - - when: - id = riak.put("test", objIn, null) - - then: - null != id - - } - - def "Test custom object"() { - - given: - TestObject objIn = new TestObject() - riak.set(TestObject.name, "test", objIn) - - when: - TestObject objOut = riak.getAsType(TestObject.name, "test", TestObject) - - then: - objOut.test == "value" - - } - - def "Test convert custom object from bytes"() { - - given: - def qos = new RiakQosParameters() - qos.durableWriteThreshold = "all" - riak.setAsBytes(TestObject.name, "test", "{\"test\":\"string data\",\"integer\":1}".bytes, qos) - - when: - def objOut = riak.getAsType(TestObject.name, "test", TestObject) - //riak.delete(TestObject.name, "test") - - then: - objOut instanceof TestObject - objOut.test == "string data" - - } - - def "Test getting bucket schema"() { - - when: - def schema = riak.getBucketSchema("test", true) - - then: - "test" == schema.props.name - - } - - def "Test updating bucket schema"() { - - when: - def schema = riak.updateBucketSchema("test", [n_val: 2]).getBucketSchema("test") - - then: - 2 == schema.props.n_val - - } - - def "Test get with metadata"() { - - when: - def val = riak.getWithMetaData("test", "test", LinkedHashMap) - - then: - val.metaData.properties["Server"].contains("WebMachine") - - } - - def "Test setting QosParameters"() { - - given: - def obj = riak.get("test", "test") - - when: - def qos = new RiakQosParameters() - qos.durableWriteThreshold = "all" - riak.set("test", "test", obj, qos) - - then: - true - - } - - def "Test containsKey"() { - - when: - def containsKey = riak.containsKey("test", "test") - - then: - true == containsKey - - } - - def "Test linking"() { - - given: - def qos = new RiakQosParameters() - qos.durableWriteThreshold = "all" - riak.set(TestObject.name, "test", new TestObject(), qos) - riak.link(TestObject.name, "test", "test", "test", "test") - - when: - def val = riak.getWithMetaData("test", "test", Map) - def result = val.metaData.properties["Link"].find { it.contains("riaktag=\"test\"") } - - then: - null != result - - } - - def "Test link walking"() { - - when: - def val = riak.linkWalk("test", "test", "test") - - then: - null != val - 1 == val.size() - val.get(0) instanceof TestObject - - } - - def "Test link walking as type"() { - - when: - def val = riak.linkWalkAsType("test", "test", "test", Map) - - then: - null != val - 1 == val.size() - val.get(0) instanceof Map - - } - - def "Test getAndSet with Map"() { - - given: - def i = run++ - def newObj = [test: "value $i".toString(), integer: 12] - - when: - def oldObj = riak.getAndSet("test", "test", newObj) - - then: - "value" == oldObj.test - - } - - def "Test Map/Reduce returning Integer"() { - - given: - MapReduceJob job = new RiakMapReduceJob(riak) - def uuid = UUID.randomUUID().toString() - def mapJs = new JavascriptMapReduceOperation("function(v){ var uuid='$uuid'; ejsLog('/tmp/mapred.log', 'map input: '+JSON.stringify(v)); var o=Riak.mapValuesJson(v); return [1]; }") - def mapPhase = new RiakMapReducePhase("map", "javascript", mapJs) - - def reduceJs = new JavascriptMapReduceOperation("function(v){ var uuid='$uuid'; ejsLog('/tmp/mapred.log', 'reduce input: '+JSON.stringify(v)); var s=Riak.reduceSum(v); ejsLog('/tmp/mapred.log', 'reduce output: '+JSON.stringify(s)); return s; }") - def reducePhase = new RiakMapReducePhase("reduce", "javascript", reduceJs) - - job.addInputs(["test"]). - addPhase(mapPhase). - addPhase(reducePhase) - println job.toJson() - - when: - def result = riak.execute(job, Integer) - - then: - 2 == result - - } - - def "Test Map/Reduce returning List"() { - - given: - MapReduceJob job = new RiakMapReduceJob(riak) - def uuid = UUID.randomUUID().toString() - def mapJs = new JavascriptMapReduceOperation("function(v){ var uuid='$uuid'; ejsLog('/tmp/mapred.log', 'map input: '+JSON.stringify(v)); var o=Riak.mapValuesJson(v); return [1]; }") - def mapPhase = new RiakMapReducePhase("map", "javascript", mapJs) - - def reduceJs = new JavascriptMapReduceOperation("function(v){ var uuid='$uuid'; ejsLog('/tmp/mapred.log', 'reduce input: '+JSON.stringify(v)); var s=Riak.reduceSum(v); ejsLog('/tmp/mapred.log', 'reduce output: '+JSON.stringify(s)); return s; }") - def reducePhase = new RiakMapReducePhase("reduce", "javascript", reduceJs) - - job.addInputs(["test"]). - addPhase(mapPhase). - addPhase(reducePhase) - - when: - def result = riak.execute(job) - - then: - 1 == result.size() - 2 == result[0] - - } - - def "Test RiakFile"() { - - given: - def file = new RiakFile(riak, "test", "test") - - when: - def exists = file.exists() - - then: - exists - - when: - def content = file.toURI().toURL().openConnection().getContent() - - then: - null != content - - } - - def "Test delete key"() { - - when: - def deleted = riak.deleteKeys("test:test", "${TestObject.name}:test", "test:$id") - - then: - true == deleted - - } - -} \ No newline at end of file diff --git a/spring-data-riak/src/test/java/org/springframework/data/keyvalue/riak/core/TestObject.java b/spring-data-riak/src/test/java/org/springframework/data/keyvalue/riak/core/TestObject.java deleted file mode 100644 index ee9d5eb04..000000000 --- a/spring-data-riak/src/test/java/org/springframework/data/keyvalue/riak/core/TestObject.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2010 by J. Brisbin - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.data.keyvalue.riak.core; - -/** - * @author J. Brisbin - */ -public class TestObject { - String test = "value"; - Integer integer = 12; - - public String getTest() { - return test; - } - - public void setTest(String test) { - this.test = test; - } - - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } -} diff --git a/spring-data-riak/src/test/resources/log4j.properties b/spring-data-riak/src/test/resources/log4j.properties deleted file mode 100644 index 002fb5bcf..000000000 --- a/spring-data-riak/src/test/resources/log4j.properties +++ /dev/null @@ -1,14 +0,0 @@ -log4j.rootCategory=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n - -log4j.category.org.apache.activemq=ERROR -log4j.category.org.springframework.batch=DEBUG -log4j.category.org.springframework.transaction=INFO -log4j.category.org.springframework.data=DEBUG - -log4j.category.org.hibernate.SQL=DEBUG -# for debugging datasource initialization -# log4j.category.test.jdbc=DEBUG diff --git a/spring-data-riak/src/test/resources/org/springframework/data/AsyncRiakTemplateTests.xml b/spring-data-riak/src/test/resources/org/springframework/data/AsyncRiakTemplateTests.xml deleted file mode 100644 index 7fab17ab0..000000000 --- a/spring-data-riak/src/test/resources/org/springframework/data/AsyncRiakTemplateTests.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/spring-data-riak/template.mf b/spring-data-riak/template.mf deleted file mode 100644 index a7eae64c5..000000000 --- a/spring-data-riak/template.mf +++ /dev/null @@ -1,31 +0,0 @@ -Bundle-SymbolicName: org.springframework.data.keyvalue.riak -Bundle-Name: Spring Data Riak Support -Bundle-Vendor: SpringSource -Bundle-ManifestVersion: 2 -Import-Package: - sun.reflect;version="0";resolution:=optional -Import-Template: - org.springframework.beans.*;version="[3.0.0, 4.0.0)", - org.springframework.core.*;version="[3.0.0, 4.0.0)", - org.springframework.dao.*;version="[3.0.0, 4.0.0)", - org.springframework.http.*;version="[3.0.0, 4.0.0)", - org.springframework.http.client.*;version="[3.0.0, 4.0.0)", - org.springframework.web.*;version="[3.0.0, 4.0.0)", - org.springframework.web.client.*;version="[3.0.0, 4.0.0)", - org.springframework.util.*;version="[3.0.0, 4.0.0)", - org.springframework.data.core.*;version="[1.0.0, 2.0.0)", - org.springframework.data.core.*;version="[1.0.0, 2.0.0)", - org.springframework.data.*;version="[1.0.0, 2.0.0)", - org.springframework.data.persistence.*;version="[1.0.0, 2.0.0)", - org.springframework.data.document.*;version="[1.0.0, 2.0.0)", - org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional, - org.apache.commons.logging.*;version="[1.1.1, 2.0.0)", - org.w3c.dom.*;version="0", - org.codehaus.jackson.*;version="[1.5.6, 1.5.6)", - org.codehaus.jackson.map.*;version="[1.5.6, 1.5.6)", - org.codehaus.groovy.runtime.*;version="[1.7.5, 2.0.0)", - groovy.lang.*;version="[1.7.5, 2.0.0)", - groovy.util.*;version="[1.7.5, 2.0.0)", - javax.activation.*;version="[1.1, 2.0)", - javax.mail.*;version="[1.4.0, 2.0.0)", - org.apache.commons.cli.*;version="[1.2, 2.0)", \ No newline at end of file diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/RedisConnectionFailureException.java b/src/main/java/org/springframework/data/redis/RedisConnectionFailureException.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/RedisConnectionFailureException.java rename to src/main/java/org/springframework/data/redis/RedisConnectionFailureException.java index 4a49658cb..35a460b61 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/RedisConnectionFailureException.java +++ b/src/main/java/org/springframework/data/redis/RedisConnectionFailureException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; import org.springframework.dao.DataAccessResourceFailureException; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/RedisSystemException.java b/src/main/java/org/springframework/data/redis/RedisSystemException.java similarity index 80% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/RedisSystemException.java rename to src/main/java/org/springframework/data/redis/RedisSystemException.java index b72123868..baae5ade0 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/RedisSystemException.java +++ b/src/main/java/org/springframework/data/redis/RedisSystemException.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; -import org.springframework.data.keyvalue.UncategorizedKeyvalueStoreException; +import org.springframework.dao.UncategorizedDataAccessException; /** * Exception thrown when we can't classify a Redis exception into one of Spring generic data access exceptions. * * @author Costin Leau */ -public class RedisSystemException extends UncategorizedKeyvalueStoreException { +public class RedisSystemException extends UncategorizedDataAccessException { public RedisSystemException(String msg, Throwable cause) { super(msg, cause); diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisCollectionParser.java b/src/main/java/org/springframework/data/redis/config/RedisCollectionParser.java similarity index 91% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisCollectionParser.java rename to src/main/java/org/springframework/data/redis/config/RedisCollectionParser.java index c806f8dcb..bd0fecb5c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisCollectionParser.java +++ b/src/main/java/org/springframework/data/redis/config/RedisCollectionParser.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.config; +package org.springframework.data.redis.config; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; -import org.springframework.data.keyvalue.redis.support.collections.RedisCollectionFactoryBean; +import org.springframework.data.redis.support.collections.RedisCollectionFactoryBean; import org.springframework.util.StringUtils; import org.w3c.dom.Element; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisListenerContainerParser.java b/src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java similarity index 91% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisListenerContainerParser.java rename to src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java index 8dca98e68..d28f5ba77 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisListenerContainerParser.java +++ b/src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.config; +package org.springframework.data.redis.config; import java.util.ArrayList; import java.util.Collection; @@ -24,11 +24,11 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.ManagedMap; import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.data.keyvalue.redis.listener.ChannelTopic; -import org.springframework.data.keyvalue.redis.listener.PatternTopic; -import org.springframework.data.keyvalue.redis.listener.RedisMessageListenerContainer; -import org.springframework.data.keyvalue.redis.listener.Topic; -import org.springframework.data.keyvalue.redis.listener.adapter.MessageListenerAdapter; +import org.springframework.data.redis.listener.ChannelTopic; +import org.springframework.data.redis.listener.PatternTopic; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; +import org.springframework.data.redis.listener.Topic; +import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; import org.springframework.util.Assert; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisNamespaceHandler.java b/src/main/java/org/springframework/data/redis/config/RedisNamespaceHandler.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisNamespaceHandler.java rename to src/main/java/org/springframework/data/redis/config/RedisNamespaceHandler.java index 2a136f377..c9cf6d13a 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/config/RedisNamespaceHandler.java +++ b/src/main/java/org/springframework/data/redis/config/RedisNamespaceHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.config; +package org.springframework.data.redis.config; import org.springframework.beans.factory.xml.NamespaceHandler; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DataType.java b/src/main/java/org/springframework/data/redis/connection/DataType.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DataType.java rename to src/main/java/org/springframework/data/redis/connection/DataType.java index f1db9881e..7e03c5ea4 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DataType.java +++ b/src/main/java/org/springframework/data/redis/connection/DataType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.EnumSet; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultMessage.java b/src/main/java/org/springframework/data/redis/connection/DefaultMessage.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultMessage.java rename to src/main/java/org/springframework/data/redis/connection/DefaultMessage.java index 1fd622577..a32242964 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultMessage.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultMessage.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultSortParameters.java b/src/main/java/org/springframework/data/redis/connection/DefaultSortParameters.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultSortParameters.java rename to src/main/java/org/springframework/data/redis/connection/DefaultSortParameters.java index 62a34bba1..198b23760 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultSortParameters.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultSortParameters.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.ArrayList; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringRedisConnection.java rename to src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java index 61b973ed3..da018c541 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.Collection; import java.util.LinkedHashMap; @@ -23,10 +23,10 @@ import java.util.Map; import java.util.Properties; import java.util.Set; -import org.springframework.data.keyvalue.redis.RedisSystemException; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.SerializationUtils; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationUtils; +import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.util.Assert; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringTuple.java b/src/main/java/org/springframework/data/redis/connection/DefaultStringTuple.java similarity index 85% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringTuple.java rename to src/main/java/org/springframework/data/redis/connection/DefaultStringTuple.java index 9ed234216..fbd5c6586 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultStringTuple.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultStringTuple.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Tuple; -import org.springframework.data.keyvalue.redis.connection.StringRedisConnection.StringTuple; +import org.springframework.data.redis.connection.RedisZSetCommands.Tuple; +import org.springframework.data.redis.connection.StringRedisConnection.StringTuple; /** * Default implementation for {@link StringTuple} interface. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultTuple.java b/src/main/java/org/springframework/data/redis/connection/DefaultTuple.java similarity index 88% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultTuple.java rename to src/main/java/org/springframework/data/redis/connection/DefaultTuple.java index e9c366fda..11c10e511 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/DefaultTuple.java +++ b/src/main/java/org/springframework/data/redis/connection/DefaultTuple.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Tuple; +import org.springframework.data.redis.connection.RedisZSetCommands.Tuple; /** * Default implementation for {@link Tuple} interface. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/Message.java b/src/main/java/org/springframework/data/redis/connection/Message.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/Message.java rename to src/main/java/org/springframework/data/redis/connection/Message.java index 0a1b17010..74ef7c917 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/Message.java +++ b/src/main/java/org/springframework/data/redis/connection/Message.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.io.Serializable; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/MessageListener.java b/src/main/java/org/springframework/data/redis/connection/MessageListener.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/MessageListener.java rename to src/main/java/org/springframework/data/redis/connection/MessageListener.java index 6e75495f0..e80d3eaa3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/MessageListener.java +++ b/src/main/java/org/springframework/data/redis/connection/MessageListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; /** * Listener of messages published in Redis. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisCommands.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisCommands.java index 072439633..507d6faee 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisCommands.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java b/src/main/java/org/springframework/data/redis/connection/RedisConnection.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java rename to src/main/java/org/springframework/data/redis/connection/RedisConnection.java index 6f9f0a2fd..5e23602ef 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisConnection.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java similarity index 93% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java index f3a3ac104..89c709c8a 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/RedisConnectionFactory.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java rename to src/main/java/org/springframework/data/redis/connection/RedisConnectionFactory.java index e7ff2beff..9a3b7fd65 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisConnectionFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import org.springframework.dao.support.PersistenceExceptionTranslator; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java index 6437627f9..327d2d718 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisHashCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisInvalidSubscriptionException.java b/src/main/java/org/springframework/data/redis/connection/RedisInvalidSubscriptionException.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisInvalidSubscriptionException.java rename to src/main/java/org/springframework/data/redis/connection/RedisInvalidSubscriptionException.java index 485a87bae..12e8aedb4 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisInvalidSubscriptionException.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisInvalidSubscriptionException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import org.springframework.dao.InvalidDataAccessResourceUsageException; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisKeyCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java index 41d047c35..79cd80102 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisKeyCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisListCommands.java index deee6298e..bfda3587f 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisListCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisPubSubCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisPubSubCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java index 64772fe0d..52497d927 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisPubSubCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisPubSubCommands.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; /** * PubSub-specific Redis commands. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisServerCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java index 09e236225..6e9ba0a42 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; import java.util.Properties; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java index b7ef2401e..f3ec271ef 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java index d763774ae..e23924055 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSubscribedConnectionException.java b/src/main/java/org/springframework/data/redis/connection/RedisSubscribedConnectionException.java similarity index 90% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSubscribedConnectionException.java rename to src/main/java/org/springframework/data/redis/connection/RedisSubscribedConnectionException.java index bcc93bab7..c9cd7b761 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisSubscribedConnectionException.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisSubscribedConnectionException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import org.springframework.dao.InvalidDataAccessApiUsageException; @@ -22,7 +22,7 @@ import org.springframework.dao.InvalidDataAccessApiUsageException; * for events. * * @author Costin Leau - * @see org.springframework.data.keyvalue.redis.connection.RedisPubSubCommands + * @see org.springframework.data.redis.connection.RedisPubSubCommands */ public class RedisSubscribedConnectionException extends InvalidDataAccessApiUsageException { diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java similarity index 93% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java index 73f82f600..e84a5e46a 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisZSetCommands.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java rename to src/main/java/org/springframework/data/redis/connection/RedisZSetCommands.java index ff6073b8c..accb02795 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisZSetCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisZSetCommands.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java b/src/main/java/org/springframework/data/redis/connection/SortParameters.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java rename to src/main/java/org/springframework/data/redis/connection/SortParameters.java index ca69f3315..e8ad91996 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java +++ b/src/main/java/org/springframework/data/redis/connection/SortParameters.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; /** * Entity containing the parameters for the SORT operation. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/StringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/StringRedisConnection.java rename to src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java index fc7c170aa..a3edf9984 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/StringRedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; -import org.springframework.data.keyvalue.redis.core.RedisCallback; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; /** * Convenience extension of {@link RedisConnection} that accepts and returns {@link String}s instead of diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/Subscription.java b/src/main/java/org/springframework/data/redis/connection/Subscription.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/Subscription.java rename to src/main/java/org/springframework/data/redis/connection/Subscription.java index bdad9ae35..17e825a4c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/Subscription.java +++ b/src/main/java/org/springframework/data/redis/connection/Subscription.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import java.util.Collection; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java rename to src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java index 363e7c920..281adef27 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; import java.io.IOException; import java.lang.reflect.Field; @@ -25,13 +25,13 @@ import java.util.Properties; import java.util.Set; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.UncategorizedKeyvalueStoreException; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisSubscribedConnectionException; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.Subscription; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisSubscribedConnectionException; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.Subscription; import org.springframework.util.ReflectionUtils; import redis.clients.jedis.BinaryJedis; @@ -116,7 +116,7 @@ public class JedisConnection implements RedisConnection { return JedisUtils.convertJedisAccessException((IOException) ex); } - return new UncategorizedKeyvalueStoreException("Unknown jedis exception", ex); + return new RedisSystemException("Unknown jedis exception", ex); } @Override diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java rename to src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java index 1f41fbb6b..a5bd088e9 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -22,8 +22,8 @@ import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessResourceFailureException; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisMessageListener.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisMessageListener.java similarity index 88% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisMessageListener.java rename to src/main/java/org/springframework/data/redis/connection/jedis/JedisMessageListener.java index 92151968a..e9f373c06 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisMessageListener.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisMessageListener.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; -import org.springframework.data.keyvalue.redis.connection.DefaultMessage; -import org.springframework.data.keyvalue.redis.connection.MessageListener; +import org.springframework.data.redis.connection.DefaultMessage; +import org.springframework.data.redis.connection.MessageListener; import org.springframework.util.Assert; import redis.clients.jedis.BinaryJedisPubSub; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisSubscription.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisSubscription.java similarity index 88% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisSubscription.java rename to src/main/java/org/springframework/data/redis/connection/jedis/JedisSubscription.java index a2be1371a..b512a6057 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisSubscription.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisSubscription.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.util.AbstractSubscription; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.util.AbstractSubscription; import redis.clients.jedis.BinaryJedisPubSub; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisUtils.java similarity index 89% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java rename to src/main/java/org/springframework/data/redis/connection/jedis/JedisUtils.java index f02e30fd8..7bbeaab01 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisUtils.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; import java.io.IOException; import java.io.StringReader; @@ -30,15 +30,15 @@ import java.util.concurrent.TimeoutException; import org.springframework.dao.DataAccessException; import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.keyvalue.redis.RedisConnectionFailureException; -import org.springframework.data.keyvalue.redis.RedisSystemException; -import org.springframework.data.keyvalue.redis.connection.DefaultTuple; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.RedisListCommands.Position; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Tuple; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; +import org.springframework.data.redis.RedisConnectionFailureException; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.data.redis.connection.DefaultTuple; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.RedisListCommands.Position; +import org.springframework.data.redis.connection.RedisZSetCommands.Tuple; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; import org.springframework.util.Assert; import redis.clients.jedis.BinaryJedisPubSub; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/package-info.java b/src/main/java/org/springframework/data/redis/connection/jedis/package-info.java similarity index 59% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/package-info.java rename to src/main/java/org/springframework/data/redis/connection/jedis/package-info.java index 40ce7c10d..9bac91781 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/package-info.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/package-info.java @@ -1,5 +1,5 @@ /** * Connection package for Jedis library. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java rename to src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java index 00433eee2..debbe8599 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jredis; +package org.springframework.data.redis.connection.jredis; import java.util.Arrays; import java.util.Collections; @@ -25,18 +25,17 @@ import java.util.Set; import org.jredis.ClientRuntimeException; import org.jredis.JRedis; +import org.jredis.Query.Support; import org.jredis.RedisException; import org.jredis.Sort; -import org.jredis.Query.Support; import org.jredis.ri.alphazero.JRedisService; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.UncategorizedKeyvalueStoreException; -import org.springframework.data.keyvalue.redis.RedisSystemException; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.Subscription; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.Subscription; import org.springframework.util.Assert; /** @@ -71,7 +70,7 @@ public class JredisConnection implements RedisConnection { return JredisUtils.convertJredisAccessException((ClientRuntimeException) ex); } - return new UncategorizedKeyvalueStoreException("Unknown JRedis exception", ex); + return new RedisSystemException("Unknown JRedis exception", ex); } @Override diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnectionFactory.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java rename to src/main/java/org/springframework/data/redis/connection/jredis/JredisConnectionFactory.java index a52d377a1..873314b61 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/jredis/JredisConnectionFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jredis; +package org.springframework.data.redis.connection.jredis; import org.jredis.ClientRuntimeException; import org.jredis.connector.Connection; @@ -25,8 +25,8 @@ import org.jredis.ri.alphazero.connection.DefaultConnectionSpec; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisUtils.java b/src/main/java/org/springframework/data/redis/connection/jredis/JredisUtils.java similarity index 89% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisUtils.java rename to src/main/java/org/springframework/data/redis/connection/jredis/JredisUtils.java index 9cb3dc146..2e392c1bd 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisUtils.java +++ b/src/main/java/org/springframework/data/redis/connection/jredis/JredisUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jredis; +package org.springframework.data.redis.connection.jredis; import java.util.Collection; import java.util.Map; @@ -28,11 +28,11 @@ import org.jredis.Sort; import org.springframework.dao.DataAccessException; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.dao.InvalidDataAccessResourceUsageException; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; -import org.springframework.data.keyvalue.redis.connection.util.DecodeUtils; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; +import org.springframework.data.redis.connection.util.DecodeUtils; /** * Helper class featuring methods for JRedis connection handling, providing support for exception translation. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/package-info.java b/src/main/java/org/springframework/data/redis/connection/jredis/package-info.java similarity index 59% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/package-info.java rename to src/main/java/org/springframework/data/redis/connection/jredis/package-info.java index 0affe42a0..b90c9520c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/package-info.java +++ b/src/main/java/org/springframework/data/redis/connection/jredis/package-info.java @@ -1,5 +1,5 @@ /** * Connection package for JRedis library. */ -package org.springframework.data.keyvalue.redis.connection.jredis; +package org.springframework.data.redis.connection.jredis; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/package-info.java b/src/main/java/org/springframework/data/redis/connection/package-info.java similarity index 79% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/package-info.java rename to src/main/java/org/springframework/data/redis/connection/package-info.java index 72c48c6b4..4107c3fb3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/package-info.java +++ b/src/main/java/org/springframework/data/redis/connection/package-info.java @@ -4,5 +4,5 @@ * *

Performs exception translation between the underlying library exceptions to Spring's DAO hierarchy. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/CloseSuppressingRjcConnection.java b/src/main/java/org/springframework/data/redis/connection/rjc/CloseSuppressingRjcConnection.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/CloseSuppressingRjcConnection.java rename to src/main/java/org/springframework/data/redis/connection/rjc/CloseSuppressingRjcConnection.java index f5adba611..7effba6fc 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/CloseSuppressingRjcConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/CloseSuppressingRjcConnection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import java.io.IOException; import java.net.UnknownHostException; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnection.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnection.java rename to src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java index 1176fc57d..198fddaf8 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import java.util.Collections; import java.util.List; @@ -29,13 +29,13 @@ import org.idevlab.rjc.SortingParams; import org.idevlab.rjc.ZParams; import org.idevlab.rjc.message.RedisNodeSubscriber; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.UncategorizedKeyvalueStoreException; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisSubscribedConnectionException; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.Subscription; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisSubscribedConnectionException; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.Subscription; /** * {@code RedisConnection} implementation on top of rjc library. @@ -73,7 +73,7 @@ public class RjcConnection implements RedisConnection { if (ex instanceof RedisException) { return RjcUtils.convertRjcAccessException((RedisException) ex); } - return new UncategorizedKeyvalueStoreException("Unknown rjc exception", ex); + return new RedisSystemException("Unknown rjc exception", ex); } @Override diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnectionFactory.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java rename to src/main/java/org/springframework/data/redis/connection/rjc/RjcConnectionFactory.java index 641c9c61f..96a087615 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcConnectionFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -24,9 +24,9 @@ import org.idevlab.rjc.protocol.Protocol; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.util.Assert; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcMessageListener.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcMessageListener.java similarity index 79% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcMessageListener.java rename to src/main/java/org/springframework/data/redis/connection/rjc/RjcMessageListener.java index c16a2040f..995f6ecb2 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcMessageListener.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcMessageListener.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import org.idevlab.rjc.message.MessageListener; import org.idevlab.rjc.message.PMessageListener; -import org.springframework.data.keyvalue.redis.connection.DefaultMessage; +import org.springframework.data.redis.connection.DefaultMessage; /** * Message listener adapter for RJC library. @@ -26,9 +26,9 @@ import org.springframework.data.keyvalue.redis.connection.DefaultMessage; */ class RjcMessageListener implements MessageListener, PMessageListener { - private final org.springframework.data.keyvalue.redis.connection.MessageListener listener; + private final org.springframework.data.redis.connection.MessageListener listener; - RjcMessageListener(org.springframework.data.keyvalue.redis.connection.MessageListener messageListener) { + RjcMessageListener(org.springframework.data.redis.connection.MessageListener messageListener) { this.listener = messageListener; } diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcSubscription.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcSubscription.java similarity index 88% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcSubscription.java rename to src/main/java/org/springframework/data/redis/connection/rjc/RjcSubscription.java index 78c5f2277..a9882fb76 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcSubscription.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcSubscription.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import org.idevlab.rjc.message.RedisNodeSubscriber; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.util.AbstractSubscription; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.util.AbstractSubscription; /** * Message subscription on top of RJC. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcUtils.java b/src/main/java/org/springframework/data/redis/connection/rjc/RjcUtils.java similarity index 87% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcUtils.java rename to src/main/java/org/springframework/data/redis/connection/rjc/RjcUtils.java index e373fe469..935486413 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcUtils.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/RjcUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import java.io.StringReader; import java.util.Arrays; @@ -32,16 +32,16 @@ import org.idevlab.rjc.ZParams; import org.idevlab.rjc.Client.LIST_POSITION; import org.springframework.dao.DataAccessException; import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.keyvalue.redis.RedisSystemException; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.DefaultTuple; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.RedisListCommands.Position; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Aggregate; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Tuple; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; -import org.springframework.data.keyvalue.redis.connection.util.DecodeUtils; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.DefaultTuple; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.RedisListCommands.Position; +import org.springframework.data.redis.connection.RedisZSetCommands.Aggregate; +import org.springframework.data.redis.connection.RedisZSetCommands.Tuple; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; +import org.springframework.data.redis.connection.util.DecodeUtils; import org.springframework.util.ObjectUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/SingleDataSource.java b/src/main/java/org/springframework/data/redis/connection/rjc/SingleDataSource.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/SingleDataSource.java rename to src/main/java/org/springframework/data/redis/connection/rjc/SingleDataSource.java index db152b72c..9fae4baa4 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/SingleDataSource.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/SingleDataSource.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import org.idevlab.rjc.ds.DataSource; import org.idevlab.rjc.ds.RedisConnection; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/package-info.java b/src/main/java/org/springframework/data/redis/connection/rjc/package-info.java similarity index 59% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/package-info.java rename to src/main/java/org/springframework/data/redis/connection/rjc/package-info.java index 66a90b8ae..f53b7c985 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/package-info.java +++ b/src/main/java/org/springframework/data/redis/connection/rjc/package-info.java @@ -1,5 +1,5 @@ /** * Connection package for RJC library. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/AbstractSubscription.java b/src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/AbstractSubscription.java rename to src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java index 6d20a8bf5..10eb6f4c3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/AbstractSubscription.java +++ b/src/main/java/org/springframework/data/redis/connection/util/AbstractSubscription.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.util; +package org.springframework.data.redis.connection.util; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.atomic.AtomicBoolean; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.RedisInvalidSubscriptionException; -import org.springframework.data.keyvalue.redis.connection.Subscription; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisInvalidSubscriptionException; +import org.springframework.data.redis.connection.Subscription; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/Base64.java b/src/main/java/org/springframework/data/redis/connection/util/Base64.java similarity index 99% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/Base64.java rename to src/main/java/org/springframework/data/redis/connection/util/Base64.java index 3e99472d6..c001e2d91 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/Base64.java +++ b/src/main/java/org/springframework/data/redis/connection/util/Base64.java @@ -1,4 +1,4 @@ -package org.springframework.data.keyvalue.redis.connection.util; +package org.springframework.data.redis.connection.util; import java.util.Arrays; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/ByteArrayWrapper.java b/src/main/java/org/springframework/data/redis/connection/util/ByteArrayWrapper.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/ByteArrayWrapper.java rename to src/main/java/org/springframework/data/redis/connection/util/ByteArrayWrapper.java index 7c708192b..4f074b665 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/ByteArrayWrapper.java +++ b/src/main/java/org/springframework/data/redis/connection/util/ByteArrayWrapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.util; +package org.springframework.data.redis.connection.util; import java.util.Arrays; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/DecodeUtils.java b/src/main/java/org/springframework/data/redis/connection/util/DecodeUtils.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/DecodeUtils.java rename to src/main/java/org/springframework/data/redis/connection/util/DecodeUtils.java index b40867607..5e4ccf4b7 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/DecodeUtils.java +++ b/src/main/java/org/springframework/data/redis/connection/util/DecodeUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.util; +package org.springframework.data.redis.connection.util; import java.util.ArrayList; import java.util.Collection; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/package-info.java b/src/main/java/org/springframework/data/redis/connection/util/package-info.java similarity index 60% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/package-info.java rename to src/main/java/org/springframework/data/redis/connection/util/package-info.java index c8f07d8ce..e24d76afa 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/util/package-info.java +++ b/src/main/java/org/springframework/data/redis/connection/util/package-info.java @@ -1,5 +1,5 @@ /** * Internal utility package for encoding/decoding Strings to byte[] (using Base64) library. */ -package org.springframework.data.keyvalue.redis.connection.util; +package org.springframework.data.redis.connection.util; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/AbstractOperations.java b/src/main/java/org/springframework/data/redis/core/AbstractOperations.java similarity index 92% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/AbstractOperations.java rename to src/main/java/org/springframework/data/redis/core/AbstractOperations.java index 1b15b4747..2a0e27433 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/AbstractOperations.java +++ b/src/main/java/org/springframework/data/redis/core/AbstractOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.LinkedHashMap; @@ -22,11 +22,11 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Tuple; -import org.springframework.data.keyvalue.redis.core.ZSetOperations.TypedTuple; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.SerializationUtils; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisZSetCommands.Tuple; +import org.springframework.data.redis.core.ZSetOperations.TypedTuple; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationUtils; import org.springframework.util.Assert; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java b/src/main/java/org/springframework/data/redis/core/BoundHashOperations.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java rename to src/main/java/org/springframework/data/redis/core/BoundHashOperations.java index d559ed00d..3fda99286 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundHashOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundHashOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundKeyOperations.java b/src/main/java/org/springframework/data/redis/core/BoundKeyOperations.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundKeyOperations.java rename to src/main/java/org/springframework/data/redis/core/BoundKeyOperations.java index d6791ea0f..b5d3642a4 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundKeyOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundKeyOperations.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Date; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; +import org.springframework.data.redis.connection.DataType; /** * Operations over a Redis key. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java b/src/main/java/org/springframework/data/redis/core/BoundListOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java rename to src/main/java/org/springframework/data/redis/core/BoundListOperations.java index 5701587ba..5e82bfa37 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundListOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundListOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java b/src/main/java/org/springframework/data/redis/core/BoundSetOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java rename to src/main/java/org/springframework/data/redis/core/BoundSetOperations.java index e13520885..a977edad3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundSetOperations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java b/src/main/java/org/springframework/data/redis/core/BoundValueOperations.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java rename to src/main/java/org/springframework/data/redis/core/BoundValueOperations.java index ae6267bf9..bc3e3e7c3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundValueOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.concurrent.TimeUnit; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java b/src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java similarity index 93% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java rename to src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java index 162e9dd51..fe6bd33c9 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BoundZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/BoundZSetOperations.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Set; -import org.springframework.data.keyvalue.redis.core.ZSetOperations.TypedTuple; +import org.springframework.data.redis.core.ZSetOperations.TypedTuple; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BulkMapper.java b/src/main/java/org/springframework/data/redis/core/BulkMapper.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BulkMapper.java rename to src/main/java/org/springframework/data/redis/core/BulkMapper.java index 97d37998a..743a7e674 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/BulkMapper.java +++ b/src/main/java/org/springframework/data/redis/core/BulkMapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/CloseSuppressingInvocationHandler.java b/src/main/java/org/springframework/data/redis/core/CloseSuppressingInvocationHandler.java similarity index 93% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/CloseSuppressingInvocationHandler.java rename to src/main/java/org/springframework/data/redis/core/CloseSuppressingInvocationHandler.java index a44527cb4..77eefd048 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/CloseSuppressingInvocationHandler.java +++ b/src/main/java/org/springframework/data/redis/core/CloseSuppressingInvocationHandler.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnection; /** * Invocation handler that suppresses close calls on {@link RedisConnection}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundHashOperations.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultBoundHashOperations.java index c8e6a531e..6e5acb8d7 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundHashOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundHashOperations.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Map; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.DataType; +import org.springframework.data.redis.connection.DataType; /** * Default implementation for {@link HashOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundKeyOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundKeyOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundKeyOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultBoundKeyOperations.java index b3ac53db4..ec0f8d43e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundKeyOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundKeyOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Date; import java.util.concurrent.TimeUnit; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundListOperations.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultBoundListOperations.java index 45a34511c..117816bf1 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundListOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundListOperations.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.List; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; +import org.springframework.data.redis.connection.DataType; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundSetOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultBoundSetOperations.java index d0010b63a..0bfc7d9dd 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundSetOperations.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.DataType; +import org.springframework.data.redis.connection.DataType; /** * Default implementation for {@link BoundSetOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundValueOperations.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultBoundValueOperations.java index b9ec6b168..b5030c330 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundValueOperations.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; +import org.springframework.data.redis.connection.DataType; /** * @author Costin Leau diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java index 60f847bc5..5763abc98 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultBoundZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultBoundZSetOperations.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.ZSetOperations.TypedTuple; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.ZSetOperations.TypedTuple; /** * Default implementation for {@link BoundZSetOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultHashOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultHashOperations.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultHashOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultHashOperations.java index afe1def4f..5a7a49f42 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultHashOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultHashOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Collections; @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnection; /** * Default implementation of {@link HashOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultListOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultListOperations.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultListOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultListOperations.java index 2349f58ec..37aef6419 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultListOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultListOperations.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.List; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisListCommands.Position; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisListCommands.Position; import org.springframework.util.CollectionUtils; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultSetOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java index a4893104f..6159ee92d 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultSetOperations.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Collections; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnection; /** * Default implementation of {@link SetOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultTypedTuple.java b/src/main/java/org/springframework/data/redis/core/DefaultTypedTuple.java similarity index 89% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultTypedTuple.java rename to src/main/java/org/springframework/data/redis/core/DefaultTypedTuple.java index fc23e6d79..d8f85a435 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultTypedTuple.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultTypedTuple.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; -import org.springframework.data.keyvalue.redis.core.ZSetOperations.TypedTuple; +import org.springframework.data.redis.core.ZSetOperations.TypedTuple; /** * Default implementation of TypedTuple. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultValueOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultValueOperations.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultValueOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultValueOperations.java index bc2c13d0d..89300952a 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultValueOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Collections; @@ -23,7 +23,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnection; /** * Default implementation of {@link ValueOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultZSetOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultZSetOperations.java rename to src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java index c0198d010..e34080377 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/DefaultZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultZSetOperations.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Collections; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisZSetCommands.Tuple; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisZSetCommands.Tuple; /** * Default implementation of {@link ZSetOperations}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java b/src/main/java/org/springframework/data/redis/core/HashOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java rename to src/main/java/org/springframework/data/redis/core/HashOperations.java index 67d1d7e28..c2a545f4b 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperations.java +++ b/src/main/java/org/springframework/data/redis/core/HashOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperationsEditor.java b/src/main/java/org/springframework/data/redis/core/HashOperationsEditor.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperationsEditor.java rename to src/main/java/org/springframework/data/redis/core/HashOperationsEditor.java index 2cb2b509d..6afaac283 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/HashOperationsEditor.java +++ b/src/main/java/org/springframework/data/redis/core/HashOperationsEditor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.beans.PropertyEditorSupport; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java b/src/main/java/org/springframework/data/redis/core/ListOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java rename to src/main/java/org/springframework/data/redis/core/ListOperations.java index 9521b6d60..c31704b8e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ListOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperationsEditor.java b/src/main/java/org/springframework/data/redis/core/ListOperationsEditor.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperationsEditor.java rename to src/main/java/org/springframework/data/redis/core/ListOperationsEditor.java index 9b1ebb663..3f0a60368 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ListOperationsEditor.java +++ b/src/main/java/org/springframework/data/redis/core/ListOperationsEditor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.beans.PropertyEditorSupport; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisAccessor.java b/src/main/java/org/springframework/data/redis/core/RedisAccessor.java similarity index 92% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisAccessor.java rename to src/main/java/org/springframework/data/redis/core/RedisAccessor.java index 39bb33f49..9832cc001 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisAccessor.java +++ b/src/main/java/org/springframework/data/redis/core/RedisAccessor.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.util.Assert; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisCallback.java b/src/main/java/org/springframework/data/redis/core/RedisCallback.java similarity index 91% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisCallback.java rename to src/main/java/org/springframework/data/redis/core/RedisCallback.java index 6de76002e..e7a29f300 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisCallback.java +++ b/src/main/java/org/springframework/data/redis/core/RedisCallback.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnection; /** * Callback interface for Redis 'low level' code. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisConnectionUtils.java b/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisConnectionUtils.java rename to src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java index b0799b82a..6bd9844c7 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisConnectionUtils.java +++ b/src/main/java/org/springframework/data/redis/core/RedisConnectionUtils.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.transaction.support.ResourceHolder; import org.springframework.transaction.support.ResourceHolderSynchronization; import org.springframework.transaction.support.TransactionSynchronizationManager; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisOperations.java b/src/main/java/org/springframework/data/redis/core/RedisOperations.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisOperations.java rename to src/main/java/org/springframework/data/redis/core/RedisOperations.java index 57e51fd1e..2bfd79629 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisOperations.java +++ b/src/main/java/org/springframework/data/redis/core/RedisOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Date; @@ -21,9 +21,9 @@ import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.query.SortQuery; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.query.SortQuery; +import org.springframework.data.redis.serializer.RedisSerializer; /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java b/src/main/java/org/springframework/data/redis/core/RedisTemplate.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java rename to src/main/java/org/springframework/data/redis/core/RedisTemplate.java index cdf6f4364..7c351bfd4 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/RedisTemplate.java +++ b/src/main/java/org/springframework/data/redis/core/RedisTemplate.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.lang.reflect.Proxy; import java.util.ArrayList; @@ -25,16 +25,16 @@ import java.util.Set; import java.util.concurrent.TimeUnit; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.core.query.QueryUtils; -import org.springframework.data.keyvalue.redis.core.query.SortQuery; -import org.springframework.data.keyvalue.redis.serializer.JdkSerializationRedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.SerializationUtils; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.core.query.QueryUtils; +import org.springframework.data.redis.core.query.SortQuery; +import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationUtils; +import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SessionCallback.java b/src/main/java/org/springframework/data/redis/core/SessionCallback.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SessionCallback.java rename to src/main/java/org/springframework/data/redis/core/SessionCallback.java index 8af247965..9f777a398 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SessionCallback.java +++ b/src/main/java/org/springframework/data/redis/core/SessionCallback.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import org.springframework.dao.DataAccessException; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SetOperations.java b/src/main/java/org/springframework/data/redis/core/SetOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SetOperations.java rename to src/main/java/org/springframework/data/redis/core/SetOperations.java index a8145f30c..b8a078bec 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/SetOperations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SetOperationsEditor.java b/src/main/java/org/springframework/data/redis/core/SetOperationsEditor.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SetOperationsEditor.java rename to src/main/java/org/springframework/data/redis/core/SetOperationsEditor.java index 2cc6704af..7aa0eaafd 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/SetOperationsEditor.java +++ b/src/main/java/org/springframework/data/redis/core/SetOperationsEditor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.beans.PropertyEditorSupport; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/StringRedisTemplate.java b/src/main/java/org/springframework/data/redis/core/StringRedisTemplate.java similarity index 79% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/StringRedisTemplate.java rename to src/main/java/org/springframework/data/redis/core/StringRedisTemplate.java index 29db41807..e042d7dcd 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/StringRedisTemplate.java +++ b/src/main/java/org/springframework/data/redis/core/StringRedisTemplate.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; -import org.springframework.data.keyvalue.redis.connection.DefaultStringRedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.StringRedisConnection; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.DefaultStringRedisConnection; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.StringRedisConnection; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; /** * String-focused extension of RedisTemplate. Since most operations against Redis are String based, diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperations.java b/src/main/java/org/springframework/data/redis/core/ValueOperations.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperations.java rename to src/main/java/org/springframework/data/redis/core/ValueOperations.java index 133922952..8ee199af3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ValueOperations.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperationsEditor.java b/src/main/java/org/springframework/data/redis/core/ValueOperationsEditor.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperationsEditor.java rename to src/main/java/org/springframework/data/redis/core/ValueOperationsEditor.java index 325683483..f8654628c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ValueOperationsEditor.java +++ b/src/main/java/org/springframework/data/redis/core/ValueOperationsEditor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.beans.PropertyEditorSupport; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ZSetOperations.java b/src/main/java/org/springframework/data/redis/core/ZSetOperations.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ZSetOperations.java rename to src/main/java/org/springframework/data/redis/core/ZSetOperations.java index 87bf0784c..fb7fce04e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ZSetOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ZSetOperations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.util.Collection; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ZSetOperationsEditor.java b/src/main/java/org/springframework/data/redis/core/ZSetOperationsEditor.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ZSetOperationsEditor.java rename to src/main/java/org/springframework/data/redis/core/ZSetOperationsEditor.java index 902ba495e..6c410a138 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/ZSetOperationsEditor.java +++ b/src/main/java/org/springframework/data/redis/core/ZSetOperationsEditor.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import java.beans.PropertyEditorSupport; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/package-info.java b/src/main/java/org/springframework/data/redis/core/package-info.java similarity index 77% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/package-info.java rename to src/main/java/org/springframework/data/redis/core/package-info.java index 2b41724e0..c22cee49c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/package-info.java +++ b/src/main/java/org/springframework/data/redis/core/package-info.java @@ -3,5 +3,5 @@ * *

Provides template support and callback for low-level access. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/DefaultSortCriterion.java b/src/main/java/org/springframework/data/redis/core/query/DefaultSortCriterion.java similarity index 89% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/DefaultSortCriterion.java rename to src/main/java/org/springframework/data/redis/core/query/DefaultSortCriterion.java index 242a7af6e..2902de563 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/DefaultSortCriterion.java +++ b/src/main/java/org/springframework/data/redis/core/query/DefaultSortCriterion.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core.query; +package org.springframework.data.redis.core.query; import java.util.ArrayList; import java.util.List; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; /** * Default implementation for {@link SortCriterion}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/DefaultSortQuery.java b/src/main/java/org/springframework/data/redis/core/query/DefaultSortQuery.java similarity index 88% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/DefaultSortQuery.java rename to src/main/java/org/springframework/data/redis/core/query/DefaultSortQuery.java index 4348e2fa2..84576ba61 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/DefaultSortQuery.java +++ b/src/main/java/org/springframework/data/redis/core/query/DefaultSortQuery.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core.query; +package org.springframework.data.redis.core.query; import java.util.List; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; /** * Default SortQuery implementation. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/QueryUtils.java b/src/main/java/org/springframework/data/redis/core/query/QueryUtils.java similarity index 84% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/QueryUtils.java rename to src/main/java/org/springframework/data/redis/core/query/QueryUtils.java index a8b08ee42..6d3a71bfc 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/QueryUtils.java +++ b/src/main/java/org/springframework/data/redis/core/query/QueryUtils.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core.query; +package org.springframework.data.redis.core.query; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.springframework.data.keyvalue.redis.connection.DefaultSortParameters; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; +import org.springframework.data.redis.connection.DefaultSortParameters; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.serializer.RedisSerializer; /** * Utilities for {@link SortQuery} implementations. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortCriterion.java b/src/main/java/org/springframework/data/redis/core/query/SortCriterion.java similarity index 82% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortCriterion.java rename to src/main/java/org/springframework/data/redis/core/query/SortCriterion.java index 50929b04d..0e93ce86d 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortCriterion.java +++ b/src/main/java/org/springframework/data/redis/core/query/SortCriterion.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core.query; +package org.springframework.data.redis.core.query; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; /** * Internal interface part of the Sort DSL. Exposes generic operations. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortQuery.java b/src/main/java/org/springframework/data/redis/core/query/SortQuery.java similarity index 79% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortQuery.java rename to src/main/java/org/springframework/data/redis/core/query/SortQuery.java index 27643c962..8d522bcdf 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortQuery.java +++ b/src/main/java/org/springframework/data/redis/core/query/SortQuery.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core.query; +package org.springframework.data.redis.core.query; import java.util.List; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.SortParameters; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Order; -import org.springframework.data.keyvalue.redis.connection.SortParameters.Range; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.SortParameters; +import org.springframework.data.redis.connection.SortParameters.Order; +import org.springframework.data.redis.connection.SortParameters.Range; +import org.springframework.data.redis.core.RedisTemplate; /** * High-level abstraction over a Redis SORT (generified equivalent of {@link SortParameters}). To be used with {@link RedisTemplate} diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortQueryBuilder.java b/src/main/java/org/springframework/data/redis/core/query/SortQueryBuilder.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortQueryBuilder.java rename to src/main/java/org/springframework/data/redis/core/query/SortQueryBuilder.java index 588d80694..7c293bf67 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/core/query/SortQueryBuilder.java +++ b/src/main/java/org/springframework/data/redis/core/query/SortQueryBuilder.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core.query; +package org.springframework.data.redis.core.query; /** diff --git a/src/main/java/org/springframework/data/redis/core/query/package-info.java b/src/main/java/org/springframework/data/redis/core/query/package-info.java new file mode 100644 index 000000000..d2c434a6d --- /dev/null +++ b/src/main/java/org/springframework/data/redis/core/query/package-info.java @@ -0,0 +1,5 @@ +/** + * Query package for Redis template. + */ +package org.springframework.data.redis.core.query; + diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/BeanUtilsHashMapper.java b/src/main/java/org/springframework/data/redis/hash/BeanUtilsHashMapper.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/BeanUtilsHashMapper.java rename to src/main/java/org/springframework/data/redis/hash/BeanUtilsHashMapper.java index 1283eb26e..d0385f74e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/BeanUtilsHashMapper.java +++ b/src/main/java/org/springframework/data/redis/hash/BeanUtilsHashMapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.hash; +package org.springframework.data.redis.hash; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/DecoratingStringHashMapper.java b/src/main/java/org/springframework/data/redis/hash/DecoratingStringHashMapper.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/DecoratingStringHashMapper.java rename to src/main/java/org/springframework/data/redis/hash/DecoratingStringHashMapper.java index 378203134..c447dfa47 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/DecoratingStringHashMapper.java +++ b/src/main/java/org/springframework/data/redis/hash/DecoratingStringHashMapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.hash; +package org.springframework.data.redis.hash; import java.util.LinkedHashMap; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/HashMapper.java b/src/main/java/org/springframework/data/redis/hash/HashMapper.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/HashMapper.java rename to src/main/java/org/springframework/data/redis/hash/HashMapper.java index e1bafcbc9..c71776c57 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/HashMapper.java +++ b/src/main/java/org/springframework/data/redis/hash/HashMapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.hash; +package org.springframework.data.redis.hash; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/JacksonHashMapper.java b/src/main/java/org/springframework/data/redis/hash/JacksonHashMapper.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/JacksonHashMapper.java rename to src/main/java/org/springframework/data/redis/hash/JacksonHashMapper.java index 1f4d0d105..84075c7d0 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/JacksonHashMapper.java +++ b/src/main/java/org/springframework/data/redis/hash/JacksonHashMapper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.hash; +package org.springframework.data.redis.hash; import java.util.Map; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/package-info.java b/src/main/java/org/springframework/data/redis/hash/package-info.java similarity index 69% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/package-info.java rename to src/main/java/org/springframework/data/redis/hash/package-info.java index 3209d57ca..48420b78c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/hash/package-info.java +++ b/src/main/java/org/springframework/data/redis/hash/package-info.java @@ -3,5 +3,5 @@ * * Provides mapping of objects to hashes/maps (and vice versa). */ -package org.springframework.data.keyvalue.redis.hash; +package org.springframework.data.redis.hash; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/ChannelTopic.java b/src/main/java/org/springframework/data/redis/listener/ChannelTopic.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/ChannelTopic.java rename to src/main/java/org/springframework/data/redis/listener/ChannelTopic.java index 17ebda41a..0a05c235e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/ChannelTopic.java +++ b/src/main/java/org/springframework/data/redis/listener/ChannelTopic.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; /** * Channel topic implementation (maps to a Redis channel). diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/PatternTopic.java b/src/main/java/org/springframework/data/redis/listener/PatternTopic.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/PatternTopic.java rename to src/main/java/org/springframework/data/redis/listener/PatternTopic.java index f5bbcc9e7..d67fb9876 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/PatternTopic.java +++ b/src/main/java/org/springframework/data/redis/listener/PatternTopic.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; /** * Pattern topic (matching multiple channels). diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/RedisMessageListenerContainer.java b/src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/RedisMessageListenerContainer.java rename to src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java index 0691b8363..7a574381b 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/RedisMessageListenerContainer.java +++ b/src/main/java/org/springframework/data/redis/listener/RedisMessageListenerContainer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; import java.util.ArrayList; import java.util.Collection; @@ -33,14 +33,14 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.context.SmartLifecycle; import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.core.task.TaskExecutor; -import org.springframework.data.keyvalue.redis.connection.Message; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.Subscription; -import org.springframework.data.keyvalue.redis.connection.util.ByteArrayWrapper; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.Subscription; +import org.springframework.data.redis.connection.util.ByteArrayWrapper; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.scheduling.SchedulingAwareRunnable; import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/Topic.java b/src/main/java/org/springframework/data/redis/listener/Topic.java similarity index 93% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/Topic.java rename to src/main/java/org/springframework/data/redis/listener/Topic.java index 351257469..b030f50ed 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/Topic.java +++ b/src/main/java/org/springframework/data/redis/listener/Topic.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; /** * Topic for a Redis message. Acts a high-level abstraction on top diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/MessageListenerAdapter.java b/src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/MessageListenerAdapter.java rename to src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java index 8def8aa52..38cdec9bf 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/MessageListenerAdapter.java +++ b/src/main/java/org/springframework/data/redis/listener/adapter/MessageListenerAdapter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; import java.lang.reflect.InvocationTargetException; @@ -21,11 +21,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.dao.DataAccessException; import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.keyvalue.redis.connection.Message; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.serializer.JdkSerializationRedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.util.Assert; import org.springframework.util.MethodInvoker; import org.springframework.util.ObjectUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisListenerExecutionFailedException.java b/src/main/java/org/springframework/data/redis/listener/adapter/RedisListenerExecutionFailedException.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisListenerExecutionFailedException.java rename to src/main/java/org/springframework/data/redis/listener/adapter/RedisListenerExecutionFailedException.java index 8f94a7a95..bb0192d2d 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisListenerExecutionFailedException.java +++ b/src/main/java/org/springframework/data/redis/listener/adapter/RedisListenerExecutionFailedException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; import org.springframework.dao.InvalidDataAccessApiUsageException; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/package-info.java b/src/main/java/org/springframework/data/redis/listener/adapter/package-info.java similarity index 77% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/package-info.java rename to src/main/java/org/springframework/data/redis/listener/adapter/package-info.java index 69f9d096a..50806356e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/adapter/package-info.java +++ b/src/main/java/org/springframework/data/redis/listener/adapter/package-info.java @@ -3,5 +3,5 @@ * The adapter delegates to target listener methods, converting messages to appropriate message content types * (such as String or byte array) that get passed into listener methods. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/package-info.java b/src/main/java/org/springframework/data/redis/listener/package-info.java similarity index 58% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/package-info.java rename to src/main/java/org/springframework/data/redis/listener/package-info.java index a074feaa6..855cc5f5b 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/listener/package-info.java +++ b/src/main/java/org/springframework/data/redis/listener/package-info.java @@ -1,5 +1,5 @@ /** * Base package for Redis message listener / pubsub container facility */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/package-info.java b/src/main/java/org/springframework/data/redis/package-info.java similarity index 82% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/package-info.java rename to src/main/java/org/springframework/data/redis/package-info.java index 96920cf44..73e9cec80 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/package-info.java +++ b/src/main/java/org/springframework/data/redis/package-info.java @@ -4,5 +4,5 @@ * Provides Redis specific exception hierarchy on top of the {@code org.springframework.dao} package. * */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/GenericToStringSerializer.java b/src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/GenericToStringSerializer.java rename to src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java index b53387366..0ca76fa11 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/GenericToStringSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/GenericToStringSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import java.nio.charset.Charset; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/JacksonJsonRedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/JacksonJsonRedisSerializer.java similarity index 98% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/JacksonJsonRedisSerializer.java rename to src/main/java/org/springframework/data/redis/serializer/JacksonJsonRedisSerializer.java index c858cfcb2..6c76f11eb 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/JacksonJsonRedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/JacksonJsonRedisSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import java.nio.charset.Charset; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/JdkSerializationRedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/JdkSerializationRedisSerializer.java rename to src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java index fe6de7886..8a5a56d4e 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/JdkSerializationRedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/JdkSerializationRedisSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import org.springframework.core.convert.converter.Converter; import org.springframework.core.serializer.support.DeserializingConverter; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/OxmSerializer.java b/src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/OxmSerializer.java rename to src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java index b1a2354f8..23f5f41b7 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/OxmSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/OxmSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/RedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/RedisSerializer.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/RedisSerializer.java rename to src/main/java/org/springframework/data/redis/serializer/RedisSerializer.java index 18543c579..47ba43152 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/RedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/RedisSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; /** * Basic interface serialization and deserialization of Objects to byte arrays (binary data). diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/SerializationException.java b/src/main/java/org/springframework/data/redis/serializer/SerializationException.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/SerializationException.java rename to src/main/java/org/springframework/data/redis/serializer/SerializationException.java index 215b8ece1..b9e894f99 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/SerializationException.java +++ b/src/main/java/org/springframework/data/redis/serializer/SerializationException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import org.springframework.core.NestedRuntimeException; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/SerializationUtils.java b/src/main/java/org/springframework/data/redis/serializer/SerializationUtils.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/SerializationUtils.java rename to src/main/java/org/springframework/data/redis/serializer/SerializationUtils.java index fab0120d8..572196150 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/SerializationUtils.java +++ b/src/main/java/org/springframework/data/redis/serializer/SerializationUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import java.util.ArrayList; import java.util.Collection; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/StringRedisSerializer.java b/src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/StringRedisSerializer.java rename to src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java index d0b361ba1..4ca4d7f01 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/StringRedisSerializer.java +++ b/src/main/java/org/springframework/data/redis/serializer/StringRedisSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import java.nio.charset.Charset; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/package-info.java b/src/main/java/org/springframework/data/redis/serializer/package-info.java similarity index 62% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/package-info.java rename to src/main/java/org/springframework/data/redis/serializer/package-info.java index 244b70323..3956423a5 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/serializer/package-info.java +++ b/src/main/java/org/springframework/data/redis/serializer/package-info.java @@ -1,5 +1,5 @@ /** * Serialization/Deserialization package for converting Object to (and from) binary data. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicInteger.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java similarity index 89% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicInteger.java rename to src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java index ca33798ba..1032e38c3 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicInteger.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicInteger.java @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.atomic; +package org.springframework.data.redis.support.atomic; import java.io.Serializable; import java.util.Collections; import java.util.Date; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; -import org.springframework.data.keyvalue.redis.core.BoundKeyOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.core.SessionCallback; -import org.springframework.data.keyvalue.redis.core.ValueOperations; -import org.springframework.data.keyvalue.redis.serializer.GenericToStringSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.BoundKeyOperations; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SessionCallback; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.serializer.GenericToStringSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; /** * Atomic integer backed by Redis. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicLong.java b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java similarity index 89% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicLong.java rename to src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java index 36502c489..63633bab8 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicLong.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/RedisAtomicLong.java @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.atomic; +package org.springframework.data.redis.support.atomic; import java.io.Serializable; import java.util.Collections; import java.util.Date; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; -import org.springframework.data.keyvalue.redis.core.BoundKeyOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.core.SessionCallback; -import org.springframework.data.keyvalue.redis.core.ValueOperations; -import org.springframework.data.keyvalue.redis.serializer.GenericToStringSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.BoundKeyOperations; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SessionCallback; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.serializer.GenericToStringSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; /** * Atomic long backed by Redis. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/package-info.java b/src/main/java/org/springframework/data/redis/support/atomic/package-info.java similarity index 56% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/package-info.java rename to src/main/java/org/springframework/data/redis/support/atomic/package-info.java index 82425f787..78604ece8 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/atomic/package-info.java +++ b/src/main/java/org/springframework/data/redis/support/atomic/package-info.java @@ -1,4 +1,4 @@ /** * Small toolkit mirroring the {@code java.util.atomic} package in Redis. */ -package org.springframework.data.keyvalue.redis.support.atomic; +package org.springframework.data.redis.support.atomic; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisCollection.java b/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisCollection.java rename to src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java index cb7c0c5df..e668cc73b 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisCollection.java +++ b/src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.AbstractCollection; import java.util.Collection; import java.util.Date; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisOperations; /** * Base implementation for {@link RedisCollection}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/CollectionUtils.java b/src/main/java/org/springframework/data/redis/support/collections/CollectionUtils.java similarity index 93% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/CollectionUtils.java rename to src/main/java/org/springframework/data/redis/support/collections/CollectionUtils.java index 1e4ee5fea..534143652 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/CollectionUtils.java +++ b/src/main/java/org/springframework/data/redis/support/collections/CollectionUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.ArrayList; import java.util.Arrays; @@ -21,8 +21,8 @@ import java.util.Collection; import java.util.List; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.core.RedisOperations; -import org.springframework.data.keyvalue.redis.core.SessionCallback; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.SessionCallback; /** * Utility class used mainly for type conversion by the default collection implementations. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisList.java b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisList.java similarity index 97% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisList.java rename to src/main/java/org/springframework/data/redis/support/collections/DefaultRedisList.java index 6149838c4..40f05bf6f 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisList.java +++ b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisList.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; import java.util.Collections; @@ -23,9 +23,9 @@ import java.util.ListIterator; import java.util.NoSuchElementException; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.BoundListOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.BoundListOperations; +import org.springframework.data.redis.core.RedisOperations; /** * Default implementation for {@link RedisList}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisMap.java b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisMap.java rename to src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java index 291b6b00c..0e18b90ab 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisMap.java +++ b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; import java.util.Collections; @@ -24,9 +24,9 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.BoundHashOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.BoundHashOperations; +import org.springframework.data.redis.core.RedisOperations; /** * Default implementation for {@link RedisMap}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisSet.java b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisSet.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisSet.java rename to src/main/java/org/springframework/data/redis/support/collections/DefaultRedisSet.java index 368d7c204..15d74f23d 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisSet.java +++ b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisSet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; import java.util.Collections; @@ -21,9 +21,9 @@ import java.util.Iterator; import java.util.Set; import java.util.UUID; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.BoundSetOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.RedisOperations; /** * Default implementation for {@link RedisSet}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisZSet.java b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisZSet.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisZSet.java rename to src/main/java/org/springframework/data/redis/support/collections/DefaultRedisZSet.java index 3da68a34d..e00806e6c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/DefaultRedisZSet.java +++ b/src/main/java/org/springframework/data/redis/support/collections/DefaultRedisZSet.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Set; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.BoundZSetOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; -import org.springframework.data.keyvalue.redis.core.ZSetOperations.TypedTuple; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.BoundZSetOperations; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.ZSetOperations.TypedTuple; /** * Default implementation for {@link RedisZSet}. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollection.java b/src/main/java/org/springframework/data/redis/support/collections/RedisCollection.java similarity index 92% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollection.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisCollection.java index 2bc2b3f8c..acd56d0e9 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollection.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisCollection.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollectionFactoryBean.java b/src/main/java/org/springframework/data/redis/support/collections/RedisCollectionFactoryBean.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollectionFactoryBean.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisCollectionFactoryBean.java index 2ea8086f2..6884f1339 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollectionFactoryBean.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisCollectionFactoryBean.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisIterator.java b/src/main/java/org/springframework/data/redis/support/collections/RedisIterator.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisIterator.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisIterator.java index 8ad15edf7..9aaf6e818 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisIterator.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisIterator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Iterator; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisList.java b/src/main/java/org/springframework/data/redis/support/collections/RedisList.java similarity index 94% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisList.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisList.java index 846454fb5..42d671e82 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisList.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisList.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Deque; import java.util.List; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisMap.java b/src/main/java/org/springframework/data/redis/support/collections/RedisMap.java similarity index 92% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisMap.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisMap.java index 1645d5c25..1dbea0701 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisMap.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisMap.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.concurrent.ConcurrentMap; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisProperties.java b/src/main/java/org/springframework/data/redis/support/collections/RedisProperties.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisProperties.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisProperties.java index 0fec1d1b9..905318bb8 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisProperties.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisProperties.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.io.IOException; import java.io.OutputStream; @@ -28,9 +28,9 @@ import java.util.Set; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; -import org.springframework.data.keyvalue.redis.connection.DataType; -import org.springframework.data.keyvalue.redis.core.BoundHashOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.BoundHashOperations; +import org.springframework.data.redis.core.RedisOperations; /** * {@link Properties} extension for a Redis back-store. Useful for reading (and storing) properties diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisSet.java b/src/main/java/org/springframework/data/redis/support/collections/RedisSet.java similarity index 95% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisSet.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisSet.java index 78cde802b..2a2e217ea 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisSet.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisSet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; import java.util.Set; diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisStore.java b/src/main/java/org/springframework/data/redis/support/collections/RedisStore.java similarity index 83% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisStore.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisStore.java index d3c9205d8..c9deef9d8 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisStore.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisStore.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; -import org.springframework.data.keyvalue.redis.core.BoundKeyOperations; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.core.BoundKeyOperations; +import org.springframework.data.redis.core.RedisOperations; /** * Basic interface for Redis-based collections. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisZSet.java b/src/main/java/org/springframework/data/redis/support/collections/RedisZSet.java similarity index 96% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisZSet.java rename to src/main/java/org/springframework/data/redis/support/collections/RedisZSet.java index 437fa5f09..9d07471db 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/collections/RedisZSet.java +++ b/src/main/java/org/springframework/data/redis/support/collections/RedisZSet.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Collection; import java.util.Comparator; @@ -21,7 +21,7 @@ import java.util.NoSuchElementException; import java.util.Set; import java.util.SortedSet; -import org.springframework.data.keyvalue.redis.core.ZSetOperations.TypedTuple; +import org.springframework.data.redis.core.ZSetOperations.TypedTuple; /** * Redis ZSet (or sorted set (by weight)). Acts as a {@link SortedSet} based on the given priorities or weights associated with each item. diff --git a/src/main/java/org/springframework/data/redis/support/collections/package-info.java b/src/main/java/org/springframework/data/redis/support/collections/package-info.java new file mode 100644 index 000000000..a87ab4c74 --- /dev/null +++ b/src/main/java/org/springframework/data/redis/support/collections/package-info.java @@ -0,0 +1,12 @@ +/** + * Package providing implementations for most of the {@code java.util} collections on top of Redis. + *

+ * For indexed collections, such as {@link java.util.List}, {@link java.util.Queue} or {@link java.util.Deque} + * consider {@link org.springframework.data.redis.support.collections.RedisList}.

+ * For collections without duplicates the obvious candidate is {@link org.springframework.data.redis.support.collections.RedisSet}. Use + * {@link org.springframework.data.redis.support.collections.RedisZSet} if a + * certain order is required.

+ * Lastly, for key/value associations {@link org.springframework.data.redis.support.collections.RedisMap} providing a Map-like abstraction on top of a Redis hash. + */ +package org.springframework.data.redis.support.collections; + diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/package-info.java b/src/main/java/org/springframework/data/redis/support/package-info.java similarity index 61% rename from spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/package-info.java rename to src/main/java/org/springframework/data/redis/support/package-info.java index cb235e463..6635f4edc 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/support/package-info.java +++ b/src/main/java/org/springframework/data/redis/support/package-info.java @@ -1,5 +1,5 @@ /** * Classes supporting the Redis packages, such as collection or atomic counters. */ -package org.springframework.data.keyvalue.redis.support; +package org.springframework.data.redis.support; diff --git a/spring-data-redis/src/main/resources/META-INF/spring.handlers b/src/main/resources/META-INF/spring.handlers similarity index 56% rename from spring-data-redis/src/main/resources/META-INF/spring.handlers rename to src/main/resources/META-INF/spring.handlers index eebc89b3f..e54bb18c9 100644 --- a/spring-data-redis/src/main/resources/META-INF/spring.handlers +++ b/src/main/resources/META-INF/spring.handlers @@ -1 +1 @@ -http\://www.springframework.org/schema/redis=org.springframework.data.keyvalue.redis.config.RedisNamespaceHandler +http\://www.springframework.org/schema/redis=org.springframework.data.redis.config.RedisNamespaceHandler diff --git a/src/main/resources/META-INF/spring.schemas b/src/main/resources/META-INF/spring.schemas new file mode 100644 index 000000000..57b1a20eb --- /dev/null +++ b/src/main/resources/META-INF/spring.schemas @@ -0,0 +1,2 @@ +http\://www.springframework.org/schema/redis/spring-redis-1.0.xsd=org/springframework/data/redis/config/spring-redis-1.0.xsd +http\://www.springframework.org/schema/redis/spring-redis.xsd=org/springframework/data/redis/config/spring-redis-1.0.xsd \ No newline at end of file diff --git a/spring-data-redis/src/main/resources/META-INF/spring.tooling b/src/main/resources/META-INF/spring.tooling similarity index 82% rename from spring-data-redis/src/main/resources/META-INF/spring.tooling rename to src/main/resources/META-INF/spring.tooling index e0504f46e..9fefa6996 100644 --- a/spring-data-redis/src/main/resources/META-INF/spring.tooling +++ b/src/main/resources/META-INF/spring.tooling @@ -1,4 +1,4 @@ # Tooling related information for the jms namespace http\://www.springframework.org/schema/redis@name=redis Namespace http\://www.springframework.org/schema/redis@prefix=redis -http\://www.springframework.org/schema/redis@icon=org/springframework/data/keyvalue/redis/config/spring-redis.gif +http\://www.springframework.org/schema/redis@icon=org/springframework/data/redis/config/spring-redis.gif diff --git a/spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd b/src/main/resources/org/springframework/data/redis/config/spring-redis-1.0.xsd similarity index 94% rename from spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd rename to src/main/resources/org/springframework/data/redis/config/spring-redis-1.0.xsd index 59c815d6e..285039a64 100644 --- a/spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis-1.0.xsd +++ b/src/main/resources/org/springframework/data/redis/config/spring-redis-1.0.xsd @@ -24,7 +24,7 @@ Container of Redis listeners. All listeners will be hosted by the same container ]]> - + @@ -40,7 +40,7 @@ Default is "redisConnectionFactory". ]]> - + @@ -79,7 +79,7 @@ serialized format. Default is a StringRedisSerializer. ]]> - + @@ -136,7 +136,7 @@ listener method arguments. Default is a StringRedisSerializer. ]]> - + @@ -150,7 +150,7 @@ Factory creating collections on top of Redis keys. ]]> - + @@ -175,7 +175,7 @@ A reference to a RedisTemplate bean.Default is "redisTemplate". ]]> - + diff --git a/spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis.gif b/src/main/resources/org/springframework/data/redis/config/spring-redis.gif similarity index 100% rename from spring-data-redis/src/main/resources/org/springframework/data/keyvalue/redis/config/spring-redis.gif rename to src/main/resources/org/springframework/data/redis/config/spring-redis.gif diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/Address.java b/src/test/java/org/springframework/data/redis/Address.java similarity index 97% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/Address.java rename to src/test/java/org/springframework/data/redis/Address.java index 1967c29c5..ffeda9fd6 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/Address.java +++ b/src/test/java/org/springframework/data/redis/Address.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; import java.io.Serializable; diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/ConnectionFactoryTracker.java b/src/test/java/org/springframework/data/redis/ConnectionFactoryTracker.java similarity index 92% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/ConnectionFactoryTracker.java rename to src/test/java/org/springframework/data/redis/ConnectionFactoryTracker.java index 634d3448a..d56b6af91 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/ConnectionFactoryTracker.java +++ b/src/test/java/org/springframework/data/redis/ConnectionFactoryTracker.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; import java.util.LinkedHashSet; import java.util.Set; import org.springframework.beans.factory.DisposableBean; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnectionFactory; /** * Basic utility to help with the destruction of {@link RedisConnectionFactory} inside JUnit 4 tests. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/Person.java b/src/test/java/org/springframework/data/redis/Person.java similarity index 98% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/Person.java rename to src/test/java/org/springframework/data/redis/Person.java index b161c4740..b602d584a 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/Person.java +++ b/src/test/java/org/springframework/data/redis/Person.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; import java.io.Serializable; diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/PropertyEditorsTest.java b/src/test/java/org/springframework/data/redis/PropertyEditorsTest.java similarity index 89% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/PropertyEditorsTest.java rename to src/test/java/org/springframework/data/redis/PropertyEditorsTest.java index 5c886e8e4..c2c5aa5d3 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/PropertyEditorsTest.java +++ b/src/test/java/org/springframework/data/redis/PropertyEditorsTest.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; -import static org.junit.Assert.*; +import static org.junit.Assert.assertSame; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.data.keyvalue.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisOperations; /** * @author Costin Leau @@ -32,7 +32,7 @@ public class PropertyEditorsTest { @Before public void setUp() { - ctx = new GenericXmlApplicationContext("/org/springframework/data/keyvalue/redis/pe.xml"); + ctx = new GenericXmlApplicationContext("/org/springframework/data/redis/pe.xml"); } @After diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/RedisViewPE.java b/src/test/java/org/springframework/data/redis/RedisViewPE.java similarity index 82% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/RedisViewPE.java rename to src/test/java/org/springframework/data/redis/RedisViewPE.java index 3282ef2e3..daf0f34bd 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/RedisViewPE.java +++ b/src/test/java/org/springframework/data/redis/RedisViewPE.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; -import org.springframework.data.keyvalue.redis.core.HashOperations; -import org.springframework.data.keyvalue.redis.core.ListOperations; -import org.springframework.data.keyvalue.redis.core.SetOperations; -import org.springframework.data.keyvalue.redis.core.ValueOperations; -import org.springframework.data.keyvalue.redis.core.ZSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.ListOperations; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.core.ZSetOperations; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/SettingsUtils.java b/src/test/java/org/springframework/data/redis/SettingsUtils.java similarity index 92% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/SettingsUtils.java rename to src/test/java/org/springframework/data/redis/SettingsUtils.java index f6697b632..83eddb605 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/SettingsUtils.java +++ b/src/test/java/org/springframework/data/redis/SettingsUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis; +package org.springframework.data.redis; import java.util.Properties; @@ -31,7 +31,7 @@ public abstract class SettingsUtils { SETTINGS = new Properties(DEFAULTS); try { - SETTINGS.load(SettingsUtils.class.getResourceAsStream("/org/springframework/data/keyvalue/redis/test.properties")); + SETTINGS.load(SettingsUtils.class.getResourceAsStream("/org/springframework/data/redis/test.properties")); } catch (Exception e) { throw new IllegalArgumentException("Cannot read settings"); } diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/config/NamespaceTest.java b/src/test/java/org/springframework/data/redis/config/NamespaceTest.java similarity index 86% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/config/NamespaceTest.java rename to src/test/java/org/springframework/data/redis/config/NamespaceTest.java index 46b9016f3..1cedef1d3 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/config/NamespaceTest.java +++ b/src/test/java/org/springframework/data/redis/config/NamespaceTest.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.config; +package org.springframework.data.redis.config; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.util.concurrent.TimeUnit; @@ -23,8 +24,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.listener.RedisMessageListenerContainer; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; /** * @author Costin Leau @@ -35,7 +36,7 @@ public class NamespaceTest { @Before public void setUp() { - ctx = new GenericXmlApplicationContext("/org/springframework/data/keyvalue/redis/config/namespace.xml"); + ctx = new GenericXmlApplicationContext("/org/springframework/data/redis/config/namespace.xml"); } @After diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/config/StubErrorHandler.java b/src/test/java/org/springframework/data/redis/config/StubErrorHandler.java similarity index 94% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/config/StubErrorHandler.java rename to src/test/java/org/springframework/data/redis/config/StubErrorHandler.java index a9f83609d..965d36d58 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/config/StubErrorHandler.java +++ b/src/test/java/org/springframework/data/redis/config/StubErrorHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.config; +package org.springframework.data.redis.config; import java.util.concurrent.BlockingDeque; import java.util.concurrent.LinkedBlockingDeque; diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/AbstractConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java similarity index 90% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/AbstractConnectionIntegrationTests.java rename to src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java index 79266a5ec..91bb6f6b8 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/AbstractConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection; +package org.springframework.data.redis.connection; import static org.junit.Assert.*; @@ -31,13 +31,19 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.Address; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.Person; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.serializer.JdkSerializationRedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.Address; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.connection.DefaultStringRedisConnection; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.StringRedisConnection; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; public abstract class AbstractConnectionIntegrationTests { diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/jedis/JedisConnectionIntegrationTests.java similarity index 87% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionIntegrationTests.java rename to src/test/java/org/springframework/data/redis/connection/jedis/JedisConnectionIntegrationTests.java index 302a94e49..040257dfe 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/jedis/JedisConnectionIntegrationTests.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jedis; +package org.springframework.data.redis.connection.jedis; import org.junit.Test; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.AbstractConnectionIntegrationTests; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.AbstractConnectionIntegrationTests; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import redis.clients.jedis.BinaryJedis; import redis.clients.jedis.Transaction; diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/jredis/JRedisConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/jredis/JRedisConnectionIntegrationTests.java similarity index 85% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/jredis/JRedisConnectionIntegrationTests.java rename to src/test/java/org/springframework/data/redis/connection/jredis/JRedisConnectionIntegrationTests.java index ed92f9f63..1f2ca6c19 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/jredis/JRedisConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/jredis/JRedisConnectionIntegrationTests.java @@ -14,14 +14,15 @@ * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.jredis; +package org.springframework.data.redis.connection.jredis; import org.jredis.JRedis; import org.junit.Ignore; import org.junit.Test; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.AbstractConnectionIntegrationTests; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.AbstractConnectionIntegrationTests; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.jredis.JredisConnectionFactory; public class JRedisConnectionIntegrationTests extends AbstractConnectionIntegrationTests { diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/rjc/RjcConnectionIntegrationTests.java similarity index 80% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionIntegrationTests.java rename to src/test/java/org/springframework/data/redis/connection/rjc/RjcConnectionIntegrationTests.java index 4fa5b3ed8..b5528c237 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/rjc/RjcConnectionIntegrationTests.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.connection.rjc; +package org.springframework.data.redis.connection.rjc; import org.idevlab.rjc.Session; import org.junit.Test; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.AbstractConnectionIntegrationTests; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.AbstractConnectionIntegrationTests; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.rjc.RjcConnectionFactory; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/SessionTest.java b/src/test/java/org/springframework/data/redis/core/SessionTest.java similarity index 78% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/SessionTest.java rename to src/test/java/org/springframework/data/redis/core/SessionTest.java index f550facfb..9066bfeff 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/SessionTest.java +++ b/src/test/java/org/springframework/data/redis/core/SessionTest.java @@ -13,15 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import static org.junit.Assert.*; import static org.mockito.Mockito.*; import org.junit.Test; import org.springframework.dao.DataAccessException; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SessionCallback; +import org.springframework.data.redis.core.StringRedisTemplate; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/SortTest.java b/src/test/java/org/springframework/data/redis/core/SortTest.java similarity index 87% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/SortTest.java rename to src/test/java/org/springframework/data/redis/core/SortTest.java index df6fd0b95..d3340c622 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/SortTest.java +++ b/src/test/java/org/springframework/data/redis/core/SortTest.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import org.junit.After; import org.junit.Before; -import org.springframework.data.keyvalue.redis.core.query.SortQueryBuilder; +import org.springframework.data.redis.core.query.SortQueryBuilder; public class SortTest { diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/TemplateTest.java b/src/test/java/org/springframework/data/redis/core/TemplateTest.java similarity index 82% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/TemplateTest.java rename to src/test/java/org/springframework/data/redis/core/TemplateTest.java index 96cf1d05c..a515edf17 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/core/TemplateTest.java +++ b/src/test/java/org/springframework/data/redis/core/TemplateTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.core; +package org.springframework.data.redis.core; import static org.junit.Assert.*; @@ -24,9 +24,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.support.collections.CollectionTestParams; -import org.springframework.data.keyvalue.redis.support.collections.ObjectFactory; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.CollectionTestParams; +import org.springframework.data.redis.support.collections.ObjectFactory; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/PubSubTestParams.java b/src/test/java/org/springframework/data/redis/listener/PubSubTestParams.java similarity index 75% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/PubSubTestParams.java rename to src/test/java/org/springframework/data/redis/listener/PubSubTestParams.java index bac0d731b..fc8325c50 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/PubSubTestParams.java +++ b/src/test/java/org/springframework/data/redis/listener/PubSubTestParams.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; import java.util.Arrays; import java.util.Collection; -import org.springframework.data.keyvalue.redis.Person; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.rjc.RjcConnectionFactory; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.support.collections.ObjectFactory; -import org.springframework.data.keyvalue.redis.support.collections.PersonObjectFactory; -import org.springframework.data.keyvalue.redis.support.collections.StringObjectFactory; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.rjc.RjcConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.support.collections.ObjectFactory; +import org.springframework.data.redis.support.collections.PersonObjectFactory; +import org.springframework.data.redis.support.collections.StringObjectFactory; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/PubSubTests.java b/src/test/java/org/springframework/data/redis/listener/PubSubTests.java similarity index 88% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/PubSubTests.java rename to src/test/java/org/springframework/data/redis/listener/PubSubTests.java index a61f923f0..46728a6aa 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/PubSubTests.java +++ b/src/test/java/org/springframework/data/redis/listener/PubSubTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener; +package org.springframework.data.redis.listener; import static org.junit.Assert.*; @@ -32,10 +32,12 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.listener.adapter.MessageListenerAdapter; -import org.springframework.data.keyvalue.redis.support.collections.ObjectFactory; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.listener.ChannelTopic; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; +import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; +import org.springframework.data.redis.support.collections.ObjectFactory; /** * Base test class for PubSub integration tests diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ContainerXmlSetupTest.java b/src/test/java/org/springframework/data/redis/listener/adapter/ContainerXmlSetupTest.java similarity index 80% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ContainerXmlSetupTest.java rename to src/test/java/org/springframework/data/redis/listener/adapter/ContainerXmlSetupTest.java index 8b180ea3e..9d7f4f953 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ContainerXmlSetupTest.java +++ b/src/test/java/org/springframework/data/redis/listener/adapter/ContainerXmlSetupTest.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.context.support.GenericXmlApplicationContext; -import org.springframework.data.keyvalue.redis.listener.RedisMessageListenerContainer; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; /** * @author Costin Leau @@ -29,7 +29,7 @@ public class ContainerXmlSetupTest { @Test public void testContainerSetup() throws Exception { GenericXmlApplicationContext ctx = new GenericXmlApplicationContext( - "/org/springframework/data/keyvalue/redis/listener/container.xml"); + "/org/springframework/data/redis/listener/container.xml"); RedisMessageListenerContainer container = ctx.getBean("redisContainer", RedisMessageListenerContainer.class); assertTrue(container.isRunning()); } diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/MessageListenerTest.java b/src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerTest.java similarity index 85% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/MessageListenerTest.java rename to src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerTest.java index 4fec13737..ad8d91e5a 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/MessageListenerTest.java +++ b/src/test/java/org/springframework/data/redis/listener/adapter/MessageListenerTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; import static org.junit.Assert.*; import static org.mockito.Mockito.*; @@ -22,11 +22,12 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.springframework.data.keyvalue.redis.connection.DefaultMessage; -import org.springframework.data.keyvalue.redis.connection.Message; -import org.springframework.data.keyvalue.redis.connection.MessageListener; -import org.springframework.data.keyvalue.redis.serializer.RedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.StringRedisSerializer; +import org.springframework.data.redis.connection.DefaultMessage; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; /** * Unit test for MessageListenerAdapter. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisMDP.java b/src/test/java/org/springframework/data/redis/listener/adapter/RedisMDP.java similarity index 93% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisMDP.java rename to src/test/java/org/springframework/data/redis/listener/adapter/RedisMDP.java index f47a62693..c7441bb54 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/RedisMDP.java +++ b/src/test/java/org/springframework/data/redis/listener/adapter/RedisMDP.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ThrowableMessageListener.java b/src/test/java/org/springframework/data/redis/listener/adapter/ThrowableMessageListener.java similarity index 81% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ThrowableMessageListener.java rename to src/test/java/org/springframework/data/redis/listener/adapter/ThrowableMessageListener.java index 2f2903e22..433fd4010 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/listener/adapter/ThrowableMessageListener.java +++ b/src/test/java/org/springframework/data/redis/listener/adapter/ThrowableMessageListener.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.listener.adapter; +package org.springframework.data.redis.listener.adapter; -import org.springframework.data.keyvalue.redis.connection.Message; -import org.springframework.data.keyvalue.redis.connection.MessageListener; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; /** * diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/AbstractHashMapperTest.java b/src/test/java/org/springframework/data/redis/mapping/AbstractHashMapperTest.java similarity index 84% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/AbstractHashMapperTest.java rename to src/test/java/org/springframework/data/redis/mapping/AbstractHashMapperTest.java index 6a6823987..9b5fac2ef 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/AbstractHashMapperTest.java +++ b/src/test/java/org/springframework/data/redis/mapping/AbstractHashMapperTest.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.mapping; +package org.springframework.data.redis.mapping; import static org.junit.Assert.*; import java.util.Map; import org.junit.Test; -import org.springframework.data.keyvalue.redis.Address; -import org.springframework.data.keyvalue.redis.Person; -import org.springframework.data.keyvalue.redis.hash.HashMapper; +import org.springframework.data.redis.Address; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.hash.HashMapper; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/BeanUtilsHashMapperTest.java b/src/test/java/org/springframework/data/redis/mapping/BeanUtilsHashMapperTest.java similarity index 83% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/BeanUtilsHashMapperTest.java rename to src/test/java/org/springframework/data/redis/mapping/BeanUtilsHashMapperTest.java index bb094c2ca..0aeb339e5 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/BeanUtilsHashMapperTest.java +++ b/src/test/java/org/springframework/data/redis/mapping/BeanUtilsHashMapperTest.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.mapping; +package org.springframework.data.redis.mapping; import org.junit.Test; -import org.springframework.data.keyvalue.redis.hash.BeanUtilsHashMapper; -import org.springframework.data.keyvalue.redis.hash.HashMapper; +import org.springframework.data.redis.hash.BeanUtilsHashMapper; +import org.springframework.data.redis.hash.HashMapper; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/JacksonHashMapperTest.java b/src/test/java/org/springframework/data/redis/mapping/JacksonHashMapperTest.java similarity index 80% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/JacksonHashMapperTest.java rename to src/test/java/org/springframework/data/redis/mapping/JacksonHashMapperTest.java index 18b8d5951..7ce7aa74b 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/mapping/JacksonHashMapperTest.java +++ b/src/test/java/org/springframework/data/redis/mapping/JacksonHashMapperTest.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.mapping; +package org.springframework.data.redis.mapping; -import org.springframework.data.keyvalue.redis.hash.HashMapper; -import org.springframework.data.keyvalue.redis.hash.JacksonHashMapper; +import org.springframework.data.redis.hash.HashMapper; +import org.springframework.data.redis.hash.JacksonHashMapper; public class JacksonHashMapperTest extends AbstractHashMapperTest { diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/serializer/SimpleRedisSerializerTests.java b/src/test/java/org/springframework/data/redis/serializer/SimpleRedisSerializerTests.java similarity index 91% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/serializer/SimpleRedisSerializerTests.java rename to src/test/java/org/springframework/data/redis/serializer/SimpleRedisSerializerTests.java index 01f767ecb..b81de9dda 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/serializer/SimpleRedisSerializerTests.java +++ b/src/test/java/org/springframework/data/redis/serializer/SimpleRedisSerializerTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.serializer; +package org.springframework.data.redis.serializer; import static org.junit.Assert.*; @@ -23,8 +23,12 @@ import java.util.UUID; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.springframework.data.keyvalue.redis.Address; -import org.springframework.data.keyvalue.redis.Person; +import org.springframework.data.redis.Address; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.serializer.JacksonJsonRedisSerializer; +import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; +import org.springframework.data.redis.serializer.OxmSerializer; +import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.oxm.xstream.XStreamMarshaller; diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/BoundKeyOperationsTest.java b/src/test/java/org/springframework/data/redis/support/BoundKeyOperationsTest.java similarity index 87% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/BoundKeyOperationsTest.java rename to src/test/java/org/springframework/data/redis/support/BoundKeyOperationsTest.java index a7626125f..a3020f311 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/BoundKeyOperationsTest.java +++ b/src/test/java/org/springframework/data/redis/support/BoundKeyOperationsTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support; +package org.springframework.data.redis.support; import static org.junit.Assert.*; @@ -26,10 +26,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.core.BoundKeyOperations; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.support.collections.ObjectFactory; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.core.BoundKeyOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.ObjectFactory; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/BoundKeyParams.java b/src/test/java/org/springframework/data/redis/support/BoundKeyParams.java similarity index 68% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/BoundKeyParams.java rename to src/test/java/org/springframework/data/redis/support/BoundKeyParams.java index df2156509..a889cc483 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/BoundKeyParams.java +++ b/src/test/java/org/springframework/data/redis/support/BoundKeyParams.java @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support; +package org.springframework.data.redis.support; import java.util.Arrays; import java.util.Collection; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.jredis.JredisConnectionFactory; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.support.atomic.RedisAtomicInteger; -import org.springframework.data.keyvalue.redis.support.atomic.RedisAtomicLong; -import org.springframework.data.keyvalue.redis.support.collections.DefaultRedisList; -import org.springframework.data.keyvalue.redis.support.collections.DefaultRedisMap; -import org.springframework.data.keyvalue.redis.support.collections.DefaultRedisSet; -import org.springframework.data.keyvalue.redis.support.collections.RedisList; -import org.springframework.data.keyvalue.redis.support.collections.StringObjectFactory; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.jredis.JredisConnectionFactory; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.support.atomic.RedisAtomicInteger; +import org.springframework.data.redis.support.atomic.RedisAtomicLong; +import org.springframework.data.redis.support.collections.DefaultRedisList; +import org.springframework.data.redis.support.collections.DefaultRedisMap; +import org.springframework.data.redis.support.collections.DefaultRedisSet; +import org.springframework.data.redis.support.collections.RedisList; +import org.springframework.data.redis.support.collections.StringObjectFactory; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/atomic/AtomicCountersParam.java b/src/test/java/org/springframework/data/redis/support/atomic/AtomicCountersParam.java similarity index 87% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/atomic/AtomicCountersParam.java rename to src/test/java/org/springframework/data/redis/support/atomic/AtomicCountersParam.java index babd1948f..da25d26a7 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/atomic/AtomicCountersParam.java +++ b/src/test/java/org/springframework/data/redis/support/atomic/AtomicCountersParam.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.atomic; +package org.springframework.data.redis.support.atomic; import java.util.Arrays; import java.util.Collection; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicTests.java b/src/test/java/org/springframework/data/redis/support/atomic/RedisAtomicTests.java similarity index 88% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicTests.java rename to src/test/java/org/springframework/data/redis/support/atomic/RedisAtomicTests.java index d69d19add..a321c1783 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/atomic/RedisAtomicTests.java +++ b/src/test/java/org/springframework/data/redis/support/atomic/RedisAtomicTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.atomic; +package org.springframework.data.redis.support.atomic; import static org.junit.Assert.*; @@ -25,9 +25,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.support.atomic.RedisAtomicInteger; +import org.springframework.data.redis.support.atomic.RedisAtomicLong; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisCollectionTests.java b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisCollectionTests.java similarity index 94% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisCollectionTests.java rename to src/test/java/org/springframework/data/redis/support/collections/AbstractRedisCollectionTests.java index 291f60665..ad4aa6064 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisCollectionTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisCollectionTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import static org.hamcrest.CoreMatchers.*; @@ -33,10 +33,12 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.core.RedisCallback; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.AbstractRedisCollection; +import org.springframework.data.redis.support.collections.RedisStore; /** diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisListTests.java b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java similarity index 97% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisListTests.java rename to src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java index 4078e5a15..87a721c01 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisListTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisListTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import static org.junit.Assert.*; import static org.junit.matchers.JUnitMatchers.*; @@ -26,7 +26,9 @@ import java.util.NoSuchElementException; import org.junit.Before; import org.junit.Test; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.DefaultRedisList; +import org.springframework.data.redis.support.collections.RedisList; /** * Integration test for RedisList diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisMapTests.java b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisMapTests.java similarity index 94% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisMapTests.java rename to src/test/java/org/springframework/data/redis/support/collections/AbstractRedisMapTests.java index f9d266355..45b1c8337 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisMapTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisMapTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -37,11 +37,14 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.core.RedisCallback; -import org.springframework.data.keyvalue.redis.core.RedisOperations; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.DefaultRedisMap; +import org.springframework.data.redis.support.collections.RedisMap; +import org.springframework.data.redis.support.collections.RedisStore; /** * Integration test for Redis Map. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisSetTests.java b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisSetTests.java similarity index 94% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisSetTests.java rename to src/test/java/org/springframework/data/redis/support/collections/AbstractRedisSetTests.java index b06c1b139..51e71288f 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisSetTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisSetTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -27,8 +27,10 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; -import org.springframework.data.keyvalue.redis.core.BoundSetOperations; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.DefaultRedisSet; +import org.springframework.data.redis.support.collections.RedisSet; /** * Integration test for Redis set. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisZSetTest.java b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisZSetTest.java similarity index 96% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisZSetTest.java rename to src/test/java/org/springframework/data/redis/support/collections/AbstractRedisZSetTest.java index 6a96f001c..31ade1788 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/AbstractRedisZSetTest.java +++ b/src/test/java/org/springframework/data/redis/support/collections/AbstractRedisZSetTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import static org.junit.Assert.*; import static org.junit.Assume.*; @@ -26,8 +26,10 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; -import org.springframework.data.keyvalue.redis.core.BoundZSetOperations; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.core.BoundZSetOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.DefaultRedisZSet; +import org.springframework.data.redis.support.collections.RedisZSet; /** * Integration test for Redis ZSet. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/CollectionTestParams.java b/src/test/java/org/springframework/data/redis/support/collections/CollectionTestParams.java similarity index 89% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/CollectionTestParams.java rename to src/test/java/org/springframework/data/redis/support/collections/CollectionTestParams.java index 4464c94ae..9462b269d 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/CollectionTestParams.java +++ b/src/test/java/org/springframework/data/redis/support/collections/CollectionTestParams.java @@ -13,20 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Arrays; import java.util.Collection; -import org.springframework.data.keyvalue.redis.Person; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.jredis.JredisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.rjc.RjcConnectionFactory; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.serializer.JacksonJsonRedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.OxmSerializer; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.jredis.JredisConnectionFactory; +import org.springframework.data.redis.connection.rjc.RjcConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.serializer.JacksonJsonRedisSerializer; +import org.springframework.data.redis.serializer.OxmSerializer; import org.springframework.oxm.xstream.XStreamMarshaller; /** diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/ObjectFactory.java b/src/test/java/org/springframework/data/redis/support/collections/ObjectFactory.java similarity index 91% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/ObjectFactory.java rename to src/test/java/org/springframework/data/redis/support/collections/ObjectFactory.java index 78848f127..417a26be5 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/ObjectFactory.java +++ b/src/test/java/org/springframework/data/redis/support/collections/ObjectFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; /** * Simple object factory. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/PersonObjectFactory.java b/src/test/java/org/springframework/data/redis/support/collections/PersonObjectFactory.java similarity index 83% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/PersonObjectFactory.java rename to src/test/java/org/springframework/data/redis/support/collections/PersonObjectFactory.java index 6e4dfe931..49e62c7d8 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/PersonObjectFactory.java +++ b/src/test/java/org/springframework/data/redis/support/collections/PersonObjectFactory.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.UUID; -import org.springframework.data.keyvalue.redis.Address; -import org.springframework.data.keyvalue.redis.Person; +import org.springframework.data.redis.Address; +import org.springframework.data.redis.Person; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollectionFactoryBeanTests.java b/src/test/java/org/springframework/data/redis/support/collections/RedisCollectionFactoryBeanTests.java similarity index 76% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollectionFactoryBeanTests.java rename to src/test/java/org/springframework/data/redis/support/collections/RedisCollectionFactoryBeanTests.java index 3f6742d40..997c5af5a 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisCollectionFactoryBeanTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/RedisCollectionFactoryBeanTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -21,13 +21,19 @@ import static org.junit.Assert.*; import org.junit.After; import org.junit.AfterClass; import org.junit.Test; -import org.springframework.data.keyvalue.redis.ConnectionFactoryTracker; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.RedisConnection; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.keyvalue.redis.core.RedisCallback; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.support.collections.RedisCollectionFactoryBean.CollectionType; +import org.springframework.data.redis.ConnectionFactoryTracker; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.support.collections.DefaultRedisList; +import org.springframework.data.redis.support.collections.DefaultRedisMap; +import org.springframework.data.redis.support.collections.DefaultRedisSet; +import org.springframework.data.redis.support.collections.RedisCollectionFactoryBean; +import org.springframework.data.redis.support.collections.RedisProperties; +import org.springframework.data.redis.support.collections.RedisStore; +import org.springframework.data.redis.support.collections.RedisCollectionFactoryBean.CollectionType; /** * @author Costin Leau diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisListTests.java b/src/test/java/org/springframework/data/redis/support/collections/RedisListTests.java similarity index 76% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisListTests.java rename to src/test/java/org/springframework/data/redis/support/collections/RedisListTests.java index d6361bed4..51a38acec 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisListTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/RedisListTests.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection; -import org.springframework.data.keyvalue.redis.support.collections.DefaultRedisList; -import org.springframework.data.keyvalue.redis.support.collections.RedisStore; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.AbstractRedisCollection; +import org.springframework.data.redis.support.collections.DefaultRedisList; +import org.springframework.data.redis.support.collections.RedisStore; /** * Parameterized instance of Redis tests. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisMapTests.java b/src/test/java/org/springframework/data/redis/support/collections/RedisMapTests.java similarity index 89% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisMapTests.java rename to src/test/java/org/springframework/data/redis/support/collections/RedisMapTests.java index e9807ef68..c0896de9f 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisMapTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/RedisMapTests.java @@ -13,20 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Arrays; import java.util.Collection; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.Person; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.jredis.JredisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.rjc.RjcConnectionFactory; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.serializer.JacksonJsonRedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.OxmSerializer; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.jredis.JredisConnectionFactory; +import org.springframework.data.redis.connection.rjc.RjcConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.JacksonJsonRedisSerializer; +import org.springframework.data.redis.serializer.OxmSerializer; +import org.springframework.data.redis.support.collections.DefaultRedisMap; +import org.springframework.data.redis.support.collections.RedisMap; import org.springframework.oxm.xstream.XStreamMarshaller; /** diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisPropertiesTests.java b/src/test/java/org/springframework/data/redis/support/collections/RedisPropertiesTests.java similarity index 91% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisPropertiesTests.java rename to src/test/java/org/springframework/data/redis/support/collections/RedisPropertiesTests.java index b8e058e05..ef93f5308 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisPropertiesTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/RedisPropertiesTests.java @@ -13,9 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -31,15 +35,15 @@ import java.util.Set; import org.junit.Ignore; import org.junit.Test; import org.junit.runners.Parameterized.Parameters; -import org.springframework.data.keyvalue.redis.Person; -import org.springframework.data.keyvalue.redis.SettingsUtils; -import org.springframework.data.keyvalue.redis.connection.jedis.JedisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.jredis.JredisConnectionFactory; -import org.springframework.data.keyvalue.redis.connection.rjc.RjcConnectionFactory; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.core.StringRedisTemplate; -import org.springframework.data.keyvalue.redis.serializer.JacksonJsonRedisSerializer; -import org.springframework.data.keyvalue.redis.serializer.OxmSerializer; +import org.springframework.data.redis.Person; +import org.springframework.data.redis.SettingsUtils; +import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.jredis.JredisConnectionFactory; +import org.springframework.data.redis.connection.rjc.RjcConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.serializer.JacksonJsonRedisSerializer; +import org.springframework.data.redis.serializer.OxmSerializer; import org.springframework.oxm.xstream.XStreamMarshaller; /** @@ -82,7 +86,7 @@ public class RedisPropertiesTests extends RedisMapTests { @Test public void testPropertiesLoad() throws Exception { InputStream stream = getClass().getResourceAsStream( - "/org/springframework/data/keyvalue/redis/support/collections/props.properties"); + "/org/springframework/data/redis/support/collections/props.properties"); assertNotNull(stream); diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisSetTests.java b/src/test/java/org/springframework/data/redis/support/collections/RedisSetTests.java similarity index 76% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisSetTests.java rename to src/test/java/org/springframework/data/redis/support/collections/RedisSetTests.java index ad10d7d40..14c79747e 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisSetTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/RedisSetTests.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; -import org.springframework.data.keyvalue.redis.support.collections.AbstractRedisCollection; -import org.springframework.data.keyvalue.redis.support.collections.DefaultRedisSet; -import org.springframework.data.keyvalue.redis.support.collections.RedisStore; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.AbstractRedisCollection; +import org.springframework.data.redis.support.collections.DefaultRedisSet; +import org.springframework.data.redis.support.collections.RedisStore; /** * Parameterized instance of Redis tests. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisZSetTests.java b/src/test/java/org/springframework/data/redis/support/collections/RedisZSetTests.java similarity index 79% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisZSetTests.java rename to src/test/java/org/springframework/data/redis/support/collections/RedisZSetTests.java index 3d1dd65a1..dda0ec570 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/RedisZSetTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/RedisZSetTests.java @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; -import org.springframework.data.keyvalue.redis.core.RedisTemplate; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.support.collections.AbstractRedisCollection; +import org.springframework.data.redis.support.collections.DefaultRedisZSet; +import org.springframework.data.redis.support.collections.RedisStore; /** * Parameterized instance of Redis sorted set tests. diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/StringObjectFactory.java b/src/test/java/org/springframework/data/redis/support/collections/StringObjectFactory.java similarity index 92% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/StringObjectFactory.java rename to src/test/java/org/springframework/data/redis/support/collections/StringObjectFactory.java index 6669ca873..926a93854 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/StringObjectFactory.java +++ b/src/test/java/org/springframework/data/redis/support/collections/StringObjectFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.UUID; diff --git a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/SupportXmlTests.java b/src/test/java/org/springframework/data/redis/support/collections/SupportXmlTests.java similarity index 88% rename from spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/SupportXmlTests.java rename to src/test/java/org/springframework/data/redis/support/collections/SupportXmlTests.java index 026074fbd..2edeb426c 100644 --- a/spring-data-redis/src/test/java/org/springframework/data/keyvalue/redis/support/collections/SupportXmlTests.java +++ b/src/test/java/org/springframework/data/redis/support/collections/SupportXmlTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.data.keyvalue.redis.support.collections; +package org.springframework.data.redis.support.collections; import java.util.Map; @@ -28,7 +28,7 @@ public class SupportXmlTests { @Test public void testContainerSetup() throws Exception { GenericXmlApplicationContext ctx = new GenericXmlApplicationContext( - "/org/springframework/data/keyvalue/redis/support/collections/container.xml"); + "/org/springframework/data/redis/support/collections/container.xml"); RedisList list = ctx.getBean("non-existing", RedisList.class); RedisProperties props = ctx.getBean("props", RedisProperties.class); diff --git a/spring-data-redis/src/test/resources/log4j.properties b/src/test/resources/log4j.properties similarity index 100% rename from spring-data-redis/src/test/resources/log4j.properties rename to src/test/resources/log4j.properties diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/config/namespace.xml b/src/test/resources/org/springframework/data/redis/config/namespace.xml similarity index 68% rename from spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/config/namespace.xml rename to src/test/resources/org/springframework/data/redis/config/namespace.xml index ab17a299e..916b05aa2 100644 --- a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/config/namespace.xml +++ b/src/test/resources/org/springframework/data/redis/config/namespace.xml @@ -8,7 +8,7 @@ http://www.springframework.org/schema/redis http://www.springframework.org/schema/redis/spring-redis.xsd"> - + @@ -20,14 +20,14 @@ - - + + - + - + - + diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/listener/container.xml b/src/test/resources/org/springframework/data/redis/listener/container.xml similarity index 58% rename from spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/listener/container.xml rename to src/test/resources/org/springframework/data/redis/listener/container.xml index f5f3d67ed..e1c815767 100644 --- a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/listener/container.xml +++ b/src/test/resources/org/springframework/data/redis/listener/container.xml @@ -4,21 +4,21 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> + class="org.springframework.data.redis.listener.adapter.MessageListenerAdapter"> - + - + + class="org.springframework.data.redis.listener.RedisMessageListenerContainer"> - + diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/pe.xml b/src/test/resources/org/springframework/data/redis/pe.xml similarity index 60% rename from spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/pe.xml rename to src/test/resources/org/springframework/data/redis/pe.xml index 50680e0a8..947bfc42b 100644 --- a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/pe.xml +++ b/src/test/resources/org/springframework/data/redis/pe.xml @@ -4,11 +4,11 @@ xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> - + - + - - - + + diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/support/collections/props.properties b/src/test/resources/org/springframework/data/redis/support/collections/props.properties similarity index 100% rename from spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/support/collections/props.properties rename to src/test/resources/org/springframework/data/redis/support/collections/props.properties diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/support/collections/props.xml b/src/test/resources/org/springframework/data/redis/support/collections/props.xml similarity index 100% rename from spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/support/collections/props.xml rename to src/test/resources/org/springframework/data/redis/support/collections/props.xml diff --git a/spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/test.properties b/src/test/resources/org/springframework/data/redis/test.properties similarity index 100% rename from spring-data-redis/src/test/resources/org/springframework/data/keyvalue/redis/test.properties rename to src/test/resources/org/springframework/data/redis/test.properties diff --git a/spring-data-redis/template.mf b/template.mf similarity index 90% rename from spring-data-redis/template.mf rename to template.mf index 10749ee20..6ec87743c 100644 --- a/spring-data-redis/template.mf +++ b/template.mf @@ -1,8 +1,8 @@ -Bundle-SymbolicName: org.springframework.data.keyvalue.redis +Bundle-SymbolicName: org.springframework.data.redis Bundle-Name: Spring Data Redis Support Bundle-Vendor: SpringSource Bundle-ManifestVersion: 2 -Export-Template: org.springframework.data.keyvalue.redis.*;version=${version} +Export-Template: org.springframework.data.redis.*;version=${version} Import-Package: sun.reflect;version="0";resolution:=optional Import-Template: