blob: 06d21ca4bafac68c8cc39905cf651e0bcc663e28 [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 expected, but not found in data store.
7 */
8public class ObjectDoesntExistException extends RejectRulesException {
9 private static final long serialVersionUID = 859082748533417866L;
10
11 public ObjectDoesntExistException(final String message) {
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070012 super(message);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070013 }
14
15 public ObjectDoesntExistException(final IKVTableID tableID,
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070016 final byte[] key, final Throwable cause) {
17 super(ByteArrayUtil.toHexStringBuffer(key, ":")
18 + " did not exist on table:" + tableID, cause);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070019 }
20
21 public ObjectDoesntExistException(final IKVTableID tableID, final byte[] key) {
Yuta HIGUCHI826b4a42014-03-24 13:10:33 -070022 super(ByteArrayUtil.toHexStringBuffer(key, ":")
23 + " did not exist on table:" + tableID);
Yuta HIGUCHI66ca1bf2014-03-12 18:34:09 -070024 }
25}