EMMA Coverage Report (generated Tue Mar 05 16:36:55 GMT 2013)
[all classes][org.springframework.data.elasticsearch.repository.support]

COVERAGE SUMMARY FOR SOURCE FILE [ElasticsearchRepositoryFactoryBean.java]

nameclass, %method, %block, %line, %
ElasticsearchRepositoryFactoryBean.java100% (1/1)100% (4/4)100% (22/22)100% (8/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ElasticsearchRepositoryFactoryBean100% (1/1)100% (4/4)100% (22/22)100% (8/8)
ElasticsearchRepositoryFactoryBean (): void 100% (1/1)100% (3/3)100% (1/1)
afterPropertiesSet (): void 100% (1/1)100% (7/7)100% (3/3)
createRepositoryFactory (): RepositoryFactorySupport 100% (1/1)100% (6/6)100% (1/1)
setElasticsearchOperations (ElasticsearchOperations): void 100% (1/1)100% (6/6)100% (3/3)

1/*
2 * Copyright 2013 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.springframework.data.elasticsearch.repository.support;
17 
18import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
19import org.springframework.data.repository.Repository;
20import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
21import org.springframework.data.repository.core.support.RepositoryFactorySupport;
22import org.springframework.util.Assert;
23 
24import java.io.Serializable;
25 
26/**
27 * Spring {@link org.springframework.beans.factory.FactoryBean} implementation to ease container based configuration for XML namespace and JavaConfig.
28 *
29 * @author Rizwan Idrees
30 * @author Mohsin Husen
31 */
32public class ElasticsearchRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable> extends
33        RepositoryFactoryBeanSupport<T, S, ID> {
34 
35        private ElasticsearchOperations operations;
36 
37        /**
38         * Configures the {@link ElasticsearchOperations} to be used to create Elasticsearch repositories.
39         * 
40         * @param operations the operations to set
41         */
42        public void setElasticsearchOperations(ElasticsearchOperations operations) {
43                Assert.notNull(operations);
44                this.operations = operations;
45        }
46 
47        /*
48         * (non-Javadoc)
49         * @see org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport#afterPropertiesSet()
50         */
51        @Override
52        public void afterPropertiesSet() {
53        super.afterPropertiesSet();
54                Assert.notNull(operations, "ElasticsearchOperations must be configured!");
55        }
56 
57 
58    @Override
59    protected RepositoryFactorySupport createRepositoryFactory() {
60        return new ElasticsearchRepositoryFactory(operations);
61    }
62 
63}

[all classes][org.springframework.data.elasticsearch.repository.support]
EMMA 2.0.5312 (C) Vladimir Roubtsov