'Utility method to grab the next resource class identifier to use for
user-defined resource classes.'

@staticmethod
@db_api.api_context_manager.reader
def _get_next_id(context):

    query = context.session.query(func.max(models.ResourceClass.id))
    max_id = query.one()[0]
    if (not max_id):
        return ResourceClass.MIN_CUSTOM_RESOURCE_CLASS_ID
    else:
        return (max_id + 1)
