Aaron Kruglikov | 3e29f66 | 2016-07-13 10:18:10 -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 | 3e29f66 | 2016-07-13 10:18:10 -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 | /** |
| 27 | * Factory for {@link AtomixConsistentTreeMap}. |
| 28 | */ |
| 29 | public 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 | } |