Repository: zest-java Updated Branches: refs/heads/develop d72bd89aa -> 78e20260e
ZEST-158, ZEST-164 - Fixing for LevelDB ES generation. Preparing the other Assemblers to follow the convention. Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/130ae7f3 Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/130ae7f3 Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/130ae7f3 Branch: refs/heads/develop Commit: 130ae7f3c4e9474389ef13393ac0bba9060f9d4a Parents: d72bd89 Author: Niclas Hedhman <[email protected]> Authored: Sat Aug 27 20:31:31 2016 +0800 Committer: Niclas Hedhman <[email protected]> Committed: Sat Aug 27 20:31:31 2016 +0800 ---------------------------------------------------------------------- .../leveldb/LevelDBEntityStoreAssembler.java | 49 ----------------- .../assembly/LevelDBEntityStoreAssembler.java | 51 ++++++++++++++++++ .../leveldb/JavaLevelDBEntityStoreTest.java | 1 + .../leveldb/JniLevelDBEntityStoreTest.java | 1 + .../LevelDBEntityStoreWithCacheTest.java | 1 + .../redis/RedisMapEntityStoreAssembler.java | 49 ----------------- .../assembly/RedisEntityStoreAssembler.java | 51 ++++++++++++++++++ .../redis/RedisMapEntityStoreTest.java | 3 +- .../redis/RedisMapEntityStoreWithCacheTest.java | 3 +- .../riak/RiakHttpMapEntityStoreAssembler.java | 53 ------------------ .../RiakProtobufMapEntityStoreAssembler.java | 53 ------------------ .../assembly/RiakHttpEntityStoreAssembler.java | 56 ++++++++++++++++++++ .../RiakProtobufEntityStoreAssembler.java | 56 ++++++++++++++++++++ .../riak/RiakHttpMapEntityStoreTest.java | 3 +- .../riak/RiakMapEntityStoreWithCacheTest.java | 3 +- .../riak/RiakProtobufMapEntityStoreTest.java | 3 +- tools/generator-zest/app/index.js | 11 ++-- 17 files changed, 235 insertions(+), 212 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreAssembler.java b/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreAssembler.java deleted file mode 100644 index ea0f031..0000000 --- a/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreAssembler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.zest.entitystore.leveldb; - -import org.apache.zest.bootstrap.Assemblers; -import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.bootstrap.ModuleAssembly; -import org.apache.zest.bootstrap.ServiceDeclaration; -import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; - -/** - * LevelDB EntityStore assembly. - */ -public class LevelDBEntityStoreAssembler - extends Assemblers.VisibilityIdentityConfig<LevelDBEntityStoreAssembler> -{ - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - module.services( UuidIdentityGeneratorService.class ); - ServiceDeclaration service = module.services( LevelDBEntityStoreService.class ).visibleIn( visibility() ); - if( hasIdentity() ) - { - service.identifiedBy( identity() ); - } - if( hasConfig() ) - { - configModule().entities( LevelDBEntityStoreConfiguration.class ).visibleIn( configVisibility() ); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/assembly/LevelDBEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/assembly/LevelDBEntityStoreAssembler.java b/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/assembly/LevelDBEntityStoreAssembler.java new file mode 100644 index 0000000..b54b767 --- /dev/null +++ b/extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/assembly/LevelDBEntityStoreAssembler.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.zest.entitystore.leveldb.assembly; + +import org.apache.zest.bootstrap.Assemblers; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.bootstrap.ServiceDeclaration; +import org.apache.zest.entitystore.leveldb.LevelDBEntityStoreConfiguration; +import org.apache.zest.entitystore.leveldb.LevelDBEntityStoreService; +import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; + +/** + * LevelDB EntityStore assembly. + */ +public class LevelDBEntityStoreAssembler + extends Assemblers.VisibilityIdentityConfig<LevelDBEntityStoreAssembler> +{ + @Override + public void assemble( ModuleAssembly module ) + throws AssemblyException + { + module.services( UuidIdentityGeneratorService.class ); + ServiceDeclaration service = module.services( LevelDBEntityStoreService.class ).visibleIn( visibility() ); + if( hasIdentity() ) + { + service.identifiedBy( identity() ); + } + if( hasConfig() ) + { + configModule().entities( LevelDBEntityStoreConfiguration.class ).visibleIn( configVisibility() ); + } + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JavaLevelDBEntityStoreTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JavaLevelDBEntityStoreTest.java b/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JavaLevelDBEntityStoreTest.java index 6e61487..3e9d6f3 100644 --- a/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JavaLevelDBEntityStoreTest.java +++ b/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JavaLevelDBEntityStoreTest.java @@ -22,6 +22,7 @@ package org.apache.zest.entitystore.leveldb; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.entitystore.leveldb.assembly.LevelDBEntityStoreAssembler; import org.apache.zest.library.fileconfig.FileConfigurationService; import org.apache.zest.test.EntityTestAssembler; import org.apache.zest.test.entity.AbstractEntityStoreTest; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JniLevelDBEntityStoreTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JniLevelDBEntityStoreTest.java b/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JniLevelDBEntityStoreTest.java index 60c7aa6..cb2b297 100644 --- a/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JniLevelDBEntityStoreTest.java +++ b/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JniLevelDBEntityStoreTest.java @@ -22,6 +22,7 @@ package org.apache.zest.entitystore.leveldb; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.entitystore.leveldb.assembly.LevelDBEntityStoreAssembler; import org.apache.zest.library.fileconfig.FileConfigurationService; import org.apache.zest.test.EntityTestAssembler; import org.apache.zest.test.entity.AbstractEntityStoreTest; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreWithCacheTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreWithCacheTest.java b/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreWithCacheTest.java index 49d2c02..3485658 100644 --- a/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreWithCacheTest.java +++ b/extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreWithCacheTest.java @@ -22,6 +22,7 @@ package org.apache.zest.entitystore.leveldb; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.entitystore.leveldb.assembly.LevelDBEntityStoreAssembler; import org.apache.zest.library.fileconfig.FileConfigurationService; import org.apache.zest.test.EntityTestAssembler; import org.apache.zest.test.cache.AbstractEntityStoreWithCacheTest; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreAssembler.java b/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreAssembler.java deleted file mode 100644 index aac636b..0000000 --- a/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreAssembler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.zest.entitystore.redis; - -import org.apache.zest.bootstrap.Assemblers; -import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.bootstrap.ModuleAssembly; -import org.apache.zest.bootstrap.ServiceDeclaration; -import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; - -/** - * Redis EntityStore assembly. - */ -public class RedisMapEntityStoreAssembler - extends Assemblers.VisibilityIdentityConfig<RedisMapEntityStoreAssembler> -{ - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - module.services( UuidIdentityGeneratorService.class ).visibleIn( visibility() ); - ServiceDeclaration service = module.services( RedisMapEntityStoreService.class ).visibleIn( visibility() ); - if( hasIdentity() ) - { - service.identifiedBy( identity() ); - } - if( hasConfig() ) - { - configModule().entities( RedisEntityStoreConfiguration.class ).visibleIn( configVisibility() ); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/assembly/RedisEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/assembly/RedisEntityStoreAssembler.java b/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/assembly/RedisEntityStoreAssembler.java new file mode 100644 index 0000000..ce32f3e --- /dev/null +++ b/extensions/entitystore-redis/src/main/java/org/apache/zest/entitystore/redis/assembly/RedisEntityStoreAssembler.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.zest.entitystore.redis.assembly; + +import org.apache.zest.bootstrap.Assemblers; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.bootstrap.ServiceDeclaration; +import org.apache.zest.entitystore.redis.RedisEntityStoreConfiguration; +import org.apache.zest.entitystore.redis.RedisMapEntityStoreService; +import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; + +/** + * Redis EntityStore assembly. + */ +public class RedisEntityStoreAssembler + extends Assemblers.VisibilityIdentityConfig<RedisEntityStoreAssembler> +{ + @Override + public void assemble( ModuleAssembly module ) + throws AssemblyException + { + module.services( UuidIdentityGeneratorService.class ).visibleIn( visibility() ); + ServiceDeclaration service = module.services( RedisMapEntityStoreService.class ).visibleIn( visibility() ); + if( hasIdentity() ) + { + service.identifiedBy( identity() ); + } + if( hasConfig() ) + { + configModule().entities( RedisEntityStoreConfiguration.class ).visibleIn( configVisibility() ); + } + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java index 7e918b2..6ca6986 100644 --- a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java +++ b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreTest.java @@ -19,6 +19,7 @@ */ package org.apache.zest.entitystore.redis; +import org.apache.zest.entitystore.redis.assembly.RedisEntityStoreAssembler; import org.junit.BeforeClass; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; @@ -51,7 +52,7 @@ public class RedisMapEntityStoreTest new EntityTestAssembler().assemble( config ); new OrgJsonValueSerializationAssembler().assemble( module ); // START SNIPPET: assembly - new RedisMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); + new RedisEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); } // END SNIPPET: assembly private JedisPool jedisPool; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java index 08f4f33..0f0f23b 100644 --- a/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java +++ b/extensions/entitystore-redis/src/test/java/org/apache/zest/entitystore/redis/RedisMapEntityStoreWithCacheTest.java @@ -19,6 +19,7 @@ */ package org.apache.zest.entitystore.redis; +import org.apache.zest.entitystore.redis.assembly.RedisEntityStoreAssembler; import org.junit.BeforeClass; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; @@ -48,7 +49,7 @@ public class RedisMapEntityStoreWithCacheTest ModuleAssembly config = module.layer().module( "config" ); new EntityTestAssembler().assemble( config ); new OrgJsonValueSerializationAssembler().assemble( module ); - new RedisMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); + new RedisEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); } private JedisPool jedisPool; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreAssembler.java b/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreAssembler.java deleted file mode 100644 index d3a00c2..0000000 --- a/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreAssembler.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.zest.entitystore.riak; - -import org.apache.zest.bootstrap.Assemblers; -import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.bootstrap.ModuleAssembly; -import org.apache.zest.bootstrap.ServiceDeclaration; -import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; - -/** - * Riak Http EntityStore assembly. - */ -public class RiakHttpMapEntityStoreAssembler - extends Assemblers.VisibilityIdentityConfig<RiakHttpMapEntityStoreAssembler> -{ - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - module.services( UuidIdentityGeneratorService.class ). - visibleIn( visibility() ); - ServiceDeclaration service = module.services( RiakMapEntityStoreService.class ). - withMixins( RiakHttpMapEntityStoreMixin.class ). - visibleIn( visibility() ); - if( hasIdentity() ) - { - service.identifiedBy( identity() ); - } - if( hasConfig() ) - { - configModule().entities( RiakHttpEntityStoreConfiguration.class ). - visibleIn( configVisibility() ); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreAssembler.java b/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreAssembler.java deleted file mode 100644 index c8e7e89..0000000 --- a/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreAssembler.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.zest.entitystore.riak; - -import org.apache.zest.bootstrap.Assemblers; -import org.apache.zest.bootstrap.AssemblyException; -import org.apache.zest.bootstrap.ModuleAssembly; -import org.apache.zest.bootstrap.ServiceDeclaration; -import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; - -/** - * Riak Protobuf EntityStore assembly. - */ -public class RiakProtobufMapEntityStoreAssembler - extends Assemblers.VisibilityIdentityConfig<RiakProtobufMapEntityStoreAssembler> -{ - @Override - public void assemble( ModuleAssembly module ) - throws AssemblyException - { - module.services( UuidIdentityGeneratorService.class ). - visibleIn( visibility() ); - ServiceDeclaration service = module.services( RiakMapEntityStoreService.class ). - withMixins( RiakProtobufMapEntityStoreMixin.class ). - visibleIn( visibility() ); - if( hasIdentity() ) - { - service.identifiedBy( identity() ); - } - if( hasConfig() ) - { - configModule().entities( RiakProtobufEntityStoreConfiguration.class ). - visibleIn( configVisibility() ); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakHttpEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakHttpEntityStoreAssembler.java b/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakHttpEntityStoreAssembler.java new file mode 100644 index 0000000..2a97e88 --- /dev/null +++ b/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakHttpEntityStoreAssembler.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.zest.entitystore.riak.assembly; + +import org.apache.zest.bootstrap.Assemblers; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.bootstrap.ServiceDeclaration; +import org.apache.zest.entitystore.riak.RiakHttpEntityStoreConfiguration; +import org.apache.zest.entitystore.riak.RiakHttpMapEntityStoreMixin; +import org.apache.zest.entitystore.riak.RiakMapEntityStoreService; +import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; + +/** + * Riak Http EntityStore assembly. + */ +public class RiakHttpEntityStoreAssembler + extends Assemblers.VisibilityIdentityConfig<RiakHttpEntityStoreAssembler> +{ + @Override + public void assemble( ModuleAssembly module ) + throws AssemblyException + { + module.services( UuidIdentityGeneratorService.class ). + visibleIn( visibility() ); + ServiceDeclaration service = module.services( RiakMapEntityStoreService.class ). + withMixins( RiakHttpMapEntityStoreMixin.class ). + visibleIn( visibility() ); + if( hasIdentity() ) + { + service.identifiedBy( identity() ); + } + if( hasConfig() ) + { + configModule().entities( RiakHttpEntityStoreConfiguration.class ). + visibleIn( configVisibility() ); + } + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakProtobufEntityStoreAssembler.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakProtobufEntityStoreAssembler.java b/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakProtobufEntityStoreAssembler.java new file mode 100644 index 0000000..8ddd6c2 --- /dev/null +++ b/extensions/entitystore-riak/src/main/java/org/apache/zest/entitystore/riak/assembly/RiakProtobufEntityStoreAssembler.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.zest.entitystore.riak.assembly; + +import org.apache.zest.bootstrap.Assemblers; +import org.apache.zest.bootstrap.AssemblyException; +import org.apache.zest.bootstrap.ModuleAssembly; +import org.apache.zest.bootstrap.ServiceDeclaration; +import org.apache.zest.entitystore.riak.RiakMapEntityStoreService; +import org.apache.zest.entitystore.riak.RiakProtobufEntityStoreConfiguration; +import org.apache.zest.entitystore.riak.RiakProtobufMapEntityStoreMixin; +import org.apache.zest.spi.uuid.UuidIdentityGeneratorService; + +/** + * Riak Protobuf EntityStore assembly. + */ +public class RiakProtobufEntityStoreAssembler + extends Assemblers.VisibilityIdentityConfig<RiakProtobufEntityStoreAssembler> +{ + @Override + public void assemble( ModuleAssembly module ) + throws AssemblyException + { + module.services( UuidIdentityGeneratorService.class ). + visibleIn( visibility() ); + ServiceDeclaration service = module.services( RiakMapEntityStoreService.class ). + withMixins( RiakProtobufMapEntityStoreMixin.class ). + visibleIn( visibility() ); + if( hasIdentity() ) + { + service.identifiedBy( identity() ); + } + if( hasConfig() ) + { + configModule().entities( RiakProtobufEntityStoreConfiguration.class ). + visibleIn( configVisibility() ); + } + } +} http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreTest.java b/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreTest.java index 73cc1e5..9117173 100644 --- a/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreTest.java +++ b/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakHttpMapEntityStoreTest.java @@ -21,6 +21,7 @@ package org.apache.zest.entitystore.riak; import com.basho.riak.client.IRiakClient; import com.basho.riak.client.bucket.Bucket; +import org.apache.zest.entitystore.riak.assembly.RiakHttpEntityStoreAssembler; import org.junit.BeforeClass; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; @@ -51,7 +52,7 @@ public class RiakHttpMapEntityStoreTest new EntityTestAssembler().assemble( config ); new OrgJsonValueSerializationAssembler().assemble( module ); // START SNIPPET: assembly - new RiakHttpMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); + new RiakHttpEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); } // END SNIPPET: assembly private IRiakClient riakClient; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakMapEntityStoreWithCacheTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakMapEntityStoreWithCacheTest.java b/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakMapEntityStoreWithCacheTest.java index 15f4c21..c6d3069 100644 --- a/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakMapEntityStoreWithCacheTest.java +++ b/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakMapEntityStoreWithCacheTest.java @@ -21,6 +21,7 @@ package org.apache.zest.entitystore.riak; import com.basho.riak.client.IRiakClient; import com.basho.riak.client.bucket.Bucket; +import org.apache.zest.entitystore.riak.assembly.RiakProtobufEntityStoreAssembler; import org.junit.BeforeClass; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; @@ -48,7 +49,7 @@ public class RiakMapEntityStoreWithCacheTest ModuleAssembly config = module.layer().module( "config" ); new EntityTestAssembler().assemble( config ); new OrgJsonValueSerializationAssembler().assemble( module ); - new RiakProtobufMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); + new RiakProtobufEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); } private IRiakClient riakClient; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreTest.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreTest.java b/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreTest.java index 1af66d3..af88322 100644 --- a/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreTest.java +++ b/extensions/entitystore-riak/src/test/java/org/apache/zest/entitystore/riak/RiakProtobufMapEntityStoreTest.java @@ -21,6 +21,7 @@ package org.apache.zest.entitystore.riak; import com.basho.riak.client.IRiakClient; import com.basho.riak.client.bucket.Bucket; +import org.apache.zest.entitystore.riak.assembly.RiakProtobufEntityStoreAssembler; import org.junit.BeforeClass; import org.apache.zest.api.common.Visibility; import org.apache.zest.bootstrap.AssemblyException; @@ -51,7 +52,7 @@ public class RiakProtobufMapEntityStoreTest new EntityTestAssembler().assemble( config ); new OrgJsonValueSerializationAssembler().assemble( module ); // START SNIPPET: assembly - new RiakProtobufMapEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); + new RiakProtobufEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); } // END SNIPPET: assembly private IRiakClient riakClient; http://git-wip-us.apache.org/repos/asf/zest-java/blob/130ae7f3/tools/generator-zest/app/index.js ---------------------------------------------------------------------- diff --git a/tools/generator-zest/app/index.js b/tools/generator-zest/app/index.js index 37000d5..92eea14 100644 --- a/tools/generator-zest/app/index.js +++ b/tools/generator-zest/app/index.js @@ -66,13 +66,18 @@ module.exports = generators.Base.extend( 'Hazelcast', 'JClouds', 'Jdbm', - 'LevelDb', + 'LevelDB', 'Memory', 'MongoDb', 'Preferences', 'Redis', - 'Riak', - 'SQL' + 'RiakHttp', + 'RiakProtobuf', + 'MySQL', + 'PostgresSQL', + 'SQLite', + 'H2SQL', + 'DerbySQL' ], message: 'Which entity store do you want to use?' },
