Implementing the invoke Method to Validate the Date

We need to modify the implementation of the invoke method to check the date and have an exception thrown if the date is in the past. The setNewTime method does not allow an alarm time to be set in the past. Here we check if the alarmTime is valid.

How It Works

Any operation can be rejected by the provider. Exceptions in the OAL are all DOFExceptions.

The OAL library has several pre-defined exception that can be used when an operation is being rejected. Pre-defined exceptions are DOFErrorExceptions.

Interfaces can define exceptions that providers can create and throw.