2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.store.cluster.impl;
20 import com.google.common.collect.ImmutableSet;
25 public class ClusterDefinition {
27 private Set<NodeInfo> nodes;
28 private String ipPrefix;
31 * Creates a new cluster definition.
32 * @param nodes cluster nodes information
33 * @param ipPrefix ip prefix common to all cluster nodes
34 * @return cluster definition
36 public static ClusterDefinition from(Set<NodeInfo> nodes, String ipPrefix) {
37 ClusterDefinition definition = new ClusterDefinition();
38 definition.ipPrefix = ipPrefix;
39 definition.nodes = ImmutableSet.copyOf(nodes);
44 * Returns set of cluster nodes info.
45 * @return cluster nodes info
47 public Set<NodeInfo> getNodes() {
48 return ImmutableSet.copyOf(nodes);
52 * Returns ipPrefix in dotted decimal notion.
55 public String getIpPrefix() {