Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0a4e674 | 2016-09-15 23:03:10 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.store.primitives.resources.impl; |
| 18 | |
| 19 | import io.atomix.catalyst.serializer.SerializableTypeResolver; |
| 20 | import io.atomix.copycat.client.CopycatClient; |
| 21 | import io.atomix.resource.ResourceFactory; |
| 22 | import io.atomix.resource.ResourceStateMachine; |
| 23 | |
| 24 | import java.util.Properties; |
| 25 | |
| 26 | /** |
Aaron Kruglikov | a1801aa | 2016-07-12 15:17:30 -0700 | [diff] [blame] | 27 | * {@link AtomixConsistentSetMultimap} resource factory. |
Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 28 | */ |
Aaron Kruglikov | a1801aa | 2016-07-12 15:17:30 -0700 | [diff] [blame] | 29 | public class AtomixConsistentSetMultimapFactory implements |
| 30 | ResourceFactory<AtomixConsistentSetMultimap> { |
Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 31 | @Override |
| 32 | public SerializableTypeResolver createSerializableTypeResolver() { |
Aaron Kruglikov | a1801aa | 2016-07-12 15:17:30 -0700 | [diff] [blame] | 33 | return new AtomixConsistentMultimapCommands.TypeResolver(); |
Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public ResourceStateMachine createStateMachine(Properties config) { |
Aaron Kruglikov | a1801aa | 2016-07-12 15:17:30 -0700 | [diff] [blame] | 38 | return new AtomixConsistentSetMultimapState(config); |
Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | @Override |
Aaron Kruglikov | a1801aa | 2016-07-12 15:17:30 -0700 | [diff] [blame] | 42 | public AtomixConsistentSetMultimap createInstance(CopycatClient client, |
| 43 | Properties properties) { |
| 44 | return new AtomixConsistentSetMultimap(client, properties); |
Aaron Kruglikov | 44a1fef | 2016-04-27 11:29:23 -0700 | [diff] [blame] | 45 | } |
| 46 | } |