Class ExpectedDataObjectNotFoundException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ExpectedDataObjectNotFoundException
    extends org.opendaylight.mdsal.common.api.ReadFailedException
    Exception thrown from code which expects data to necessarily be present in the data store.

    While this could be considered a functional problem instead of a technical error, and thus should not extend ReadFailedException (which is for technical errors), it does still for convenience of being able to propagate all ReadFailedException with a single "throws ReadFailedException" clause, instead of requiring you to declare "throws ExpectedDataObjectNotFoundException, ReadFailedException".

    This is because any code which treats this as functional error and catches it is abusing the SingleTransactionDataBroker.syncRead(DataBroker, LogicalDatastoreType, InstanceIdentifier) method (the only one throwing this Exception), and should use another method: If code IS expecting data to not be found, then it should never use that method, but one of the alternatives in that class. If code is NEVER expecting data to not be found, then this is, effectively, a technical error (in that particular usage).

    Author:
    Michael Vorburger
    See Also:
    SingleTransactionDataBroker.syncRead(DataBroker, LogicalDatastoreType, InstanceIdentifier), Serialized Form
    • Field Summary

      • Fields inherited from class org.opendaylight.mdsal.common.api.ReadFailedException

        MAPPER
    • Constructor Summary

      Constructors 
      Constructor Description
      ExpectedDataObjectNotFoundException​(org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)  
    • Method Summary

      • Methods inherited from class org.opendaylight.yangtools.yang.common.OperationFailedException

        getErrorList, toString
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExpectedDataObjectNotFoundException

        public ExpectedDataObjectNotFoundException​(org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType,
                                                   org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)