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

COVERAGE SUMMARY FOR SOURCE FILE [NodeClientFactoryBean.java]

nameclass, %method, %block, %line, %
NodeClientFactoryBean.java100% (1/1)86%  (6/7)80%  (24/30)75%  (9/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NodeClientFactoryBean100% (1/1)86%  (6/7)80%  (24/30)75%  (9/12)
NodeClientFactoryBean (boolean): void 0%   (0/1)0%   (0/6)0%   (0/3)
NodeClientFactoryBean (): void 100% (1/1)100% (3/3)100% (2/2)
afterPropertiesSet (): void 100% (1/1)100% (10/10)100% (2/2)
getObject (): NodeClient 100% (1/1)100% (3/3)100% (1/1)
getObjectType (): Class 100% (1/1)100% (2/2)100% (1/1)
isSingleton (): boolean 100% (1/1)100% (2/2)100% (1/1)
setLocal (boolean): void 100% (1/1)100% (4/4)100% (2/2)

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.client;
17 
18import org.elasticsearch.client.Client;
19import org.elasticsearch.client.node.NodeClient;
20import org.springframework.beans.factory.FactoryBean;
21import org.springframework.beans.factory.InitializingBean;
22 
23import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
24 
25/**
26 *  NodeClientFactoryBean
27 *
28 * @author Rizwan Idrees
29 * @author Mohsin Husen
30 */
31 
32public class NodeClientFactoryBean implements FactoryBean<NodeClient>, InitializingBean{
33 
34    private boolean local;
35    private NodeClient nodeClient;
36 
37    NodeClientFactoryBean() {
38    }
39 
40    public NodeClientFactoryBean(boolean local) {
41        this.local = local;
42    }
43 
44    @Override
45    public NodeClient getObject() throws Exception {
46        return nodeClient;
47    }
48 
49    @Override
50    public Class<? extends Client> getObjectType() {
51        return NodeClient.class;
52    }
53 
54    @Override
55    public boolean isSingleton() {
56        return true;
57    }
58 
59    @Override
60    public void afterPropertiesSet() throws Exception {
61        nodeClient = (NodeClient) nodeBuilder().local(this.local).node().client();
62    }
63 
64    public void setLocal(boolean local) {
65        this.local = local;
66    }
67}

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