blob: 8ce6055de1bf7b4dbac37631bd7b4f5f7764efb4 [file] [log] [blame]
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -07001package net.onrc.onos.datastore;
2
3import net.onrc.onos.datastore.utils.ByteArrayUtil;
4
5/**
6 * Exception thrown when object was not expected to be in data store.
7 */
8public class ObjectExistsException extends RejectRulesException {
9 private static final long serialVersionUID = -1488647215779909457L;
10
11 public ObjectExistsException(final String message) {
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070012 super(message);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070013 }
14
15 public ObjectExistsException(final IKVTableID tableID, final byte[] key,
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070016 final Throwable cause) {
17 super(ByteArrayUtil.toHexStringBuffer(key, ":")
18 + " already exist on table:" + tableID, cause);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070019 }
20
21 public ObjectExistsException(final IKVTableID tableID, final byte[] key) {
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070022 super(ByteArrayUtil.toHexStringBuffer(key, ":")
23 + " already exist on table:" + tableID);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070024 }
25}