blob: 13f7240e59e1c8293893db9f27fb2fd941f6ec24 [file] [log] [blame]
Jonathan Hart6df90172014-04-03 10:13:11 -07001package net.onrc.onos.core.datastore;
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -07002
Jonathan Hart6df90172014-04-03 10:13:11 -07003import net.onrc.onos.core.datastore.utils.ByteArrayUtil;
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -07004
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,
Ray Milkey269ffb92014-04-03 14:43:30 -070016 final Throwable cause) {
Yuta HIGUCHI805bc8f2014-04-16 11:51:43 -070017 super(ByteArrayUtil.toHexStringBuilder(key, ":")
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070018 + " 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 HIGUCHI805bc8f2014-04-16 11:51:43 -070022 super(ByteArrayUtil.toHexStringBuilder(key, ":")
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070023 + " already exist on table:" + tableID);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070024 }
25}