public function getCalendar($calendarName)
    {
        // rawurlencode will convert spaces to %20 as required by server
        $url = $this->service_url . '/jobs/calendars/' . rawurlencode($calendarName);
        $response = $this->service->prepAndSend($url, array(200), 'GET', null, true);
        $calendarData = json_decode($response);
        if (empty($calendarData->calendarType)) {
            throw new RESTRequestException("JobService: Data format not expected.");
        }
        $className = JobService::CALENDAR_NAMESPACE . '\\'. ucfirst($calendarData->calendarType) . "Calendar";

        if (class_exists($className)) {
            return $className::createFromJSON($calendarData);
        } else {
            throw new RESTRequestException("JobService: Unrecognized calendar type returned by server");
        }
    }