27db82068dc6b38e5974a185e8c32cd9ec3ee5a7
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / FrontendType.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.access.concepts;
9
10 import com.google.common.annotations.Beta;
11 import java.util.regex.Pattern;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.yangtools.concepts.Identifier;
14
15 /**
16  * An {@link Identifier} identifying a data store frontend type, which is able to access the data store backend.
17  * Frontend implementations need to define this identifier so that multiple clients existing on a member node can be
18  * discerned.
19  *
20  * @author Robert Varga
21  */
22 @Beta
23 public interface FrontendType extends Identifier {
24     Pattern SIMPLE_STRING_PATTERN = Pattern.compile("[a-zA-Z-_.*+:=,!~';]+");
25
26     /**
27      * Return a string representation of this frontend type. Unlike {@link #toString()}, returned string has
28      * restricted rules on what it can contain:
29      * - US-ASCII letters
30      * - special characters: -_.*+:=,!~';
31      *
32      * A validation pattern for this string is available as {@link #SIMPLE_STRING_PATTERN}.
33      */
34     @Nonnull String toSimpleString();
35 }