blob: 490183ff578dd86ab1f4e097c804d30cd29f1fb0 [file] [log] [blame]
tom0755a362014-09-24 11:54:43 -07001package org.onlab.onos.store.common;
tomdc66b382014-09-22 17:05:47 -07002
3import com.hazelcast.core.HazelcastInstance;
4
5/**
6 * Bootstrap service to get a handle on a share Hazelcast instance.
7 */
8public interface StoreService {
9
10 /**
11 * Returns the shared Hazelcast instance for use as a distributed store
12 * backing.
13 *
14 * @return shared Hazelcast instance
15 */
16 HazelcastInstance getHazelcastInstance();
17
tom0872a172014-09-23 11:24:26 -070018 /**
19 * Serializes the specified object into bytes using one of the
20 * pre-registered serializers.
21 *
22 * @param obj object to be serialized
23 * @return serialized bytes
24 */
25 public byte[] serialize(final Object obj);
26
27 /**
28 * Deserializes the specified bytes into an object using one of the
29 * pre-registered serializers.
30 *
31 * @param bytes bytes to be deserialized
32 * @return deserialized object
33 */
34 public <T> T deserialize(final byte[] bytes);
35
tomdc66b382014-09-22 17:05:47 -070036}