001/*******************************************************************************
002 * Copyright (c) 2006-2014 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 ******************************************************************************/
009package org.nuxeo.ecm.core.redis;
010
011import org.apache.commons.lang.StringUtils;
012import org.nuxeo.common.xmap.annotation.XNode;
013import org.nuxeo.common.xmap.annotation.XObject;
014
015import redis.clients.jedis.Protocol;
016
017@XObject("pool")
018public abstract class RedisPoolDescriptor {
019
020    @XNode("disabled")
021    protected boolean disabled = false;
022
023    public String password;
024
025    @XNode("password")
026    public void setPassword(String value) {
027        password = StringUtils.defaultIfBlank(value, null);
028    }
029
030    @XNode("database")
031    public int database = Protocol.DEFAULT_DATABASE;
032
033    @XNode("timeout")
034    public int timeout = Protocol.DEFAULT_TIMEOUT;
035
036    @XNode("prefix")
037    public String prefix;
038
039    protected abstract RedisExecutor newExecutor();
040}