blob: 8ce85576a8d7fda7fffb298348b9044dcc65920d [file] [log] [blame]
Aaron Kruglikov3e29f662016-07-13 10:18:10 -07001/*
Brian O'Connor0a4e6742016-09-15 23:03:10 -07002 * Copyright 2016-present Open Networking Laboratory
Aaron Kruglikov3e29f662016-07-13 10:18:10 -07003 *
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 */
16
17package org.onosproject.store.primitives.resources.impl;
18
19import io.atomix.catalyst.serializer.SerializableTypeResolver;
20import io.atomix.copycat.client.CopycatClient;
21import io.atomix.resource.ResourceFactory;
22import io.atomix.resource.ResourceStateMachine;
23
24import java.util.Properties;
25
26/**
27 * Factory for {@link AtomixConsistentTreeMap}.
28 */
29public class AtomixConsistentTreeMapFactory implements ResourceFactory<AtomixConsistentTreeMap> {
30 @Override
31 public SerializableTypeResolver createSerializableTypeResolver() {
32 return new AtomixConsistentTreeMapCommands.TypeResolver();
33 }
34
35 @Override
36 public ResourceStateMachine createStateMachine(Properties config) {
37 return new AtomixConsistentTreeMapState(config);
38 }
39
40 @Override
41 public AtomixConsistentTreeMap createInstance(CopycatClient client, Properties options) {
42 return new AtomixConsistentTreeMap(client, options);
43 }
44}