blob: e6d760b80f6e8223fa888cbc2cc042f5db92a30c [file] [log] [blame]
Aaron Kruglikov44a1fef2016-04-27 11:29:23 -07001/*
2 * Copyright 2016 Open Networking Laboratory
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 */
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/**
Aaron Kruglikova1801aa2016-07-12 15:17:30 -070027 * {@link AtomixConsistentSetMultimap} resource factory.
Aaron Kruglikov44a1fef2016-04-27 11:29:23 -070028 */
Aaron Kruglikova1801aa2016-07-12 15:17:30 -070029public class AtomixConsistentSetMultimapFactory implements
30 ResourceFactory<AtomixConsistentSetMultimap> {
Aaron Kruglikov44a1fef2016-04-27 11:29:23 -070031 @Override
32 public SerializableTypeResolver createSerializableTypeResolver() {
Aaron Kruglikova1801aa2016-07-12 15:17:30 -070033 return new AtomixConsistentMultimapCommands.TypeResolver();
Aaron Kruglikov44a1fef2016-04-27 11:29:23 -070034 }
35
36 @Override
37 public ResourceStateMachine createStateMachine(Properties config) {
Aaron Kruglikova1801aa2016-07-12 15:17:30 -070038 return new AtomixConsistentSetMultimapState(config);
Aaron Kruglikov44a1fef2016-04-27 11:29:23 -070039 }
40
41 @Override
Aaron Kruglikova1801aa2016-07-12 15:17:30 -070042 public AtomixConsistentSetMultimap createInstance(CopycatClient client,
43 Properties properties) {
44 return new AtomixConsistentSetMultimap(client, properties);
Aaron Kruglikov44a1fef2016-04-27 11:29:23 -070045 }
46}