class DialogDescriptorService {

    public boolean isEnabled(final DialogDescriptor dialogDescriptor) {
        boolean result = false;
        DialogDescriptorUsage usage = dialogDescriptor.getAttributes().getUsage();
        if (usage == DialogDescriptorUsage.DISABLED) {
            result = false;
        } else {
            boolean notTimedOut = isNotTimedOut(dialogDescriptor, usage);
            if (!notTimedOut) {
                dialogDescriptor.getAttributes().setUsage(DialogDescriptorUsage.DISABLED);
                LOGGER.debug("Dialog descriptor '" + dialogDescriptor.getAttributes().getName() + "' was disabled!");
            }
            result = notTimedOut;
        }
        return result;
    }

}