Package com.carfey.ops.api.embedded
Class CustomCalendarManager
- java.lang.Object
-
- com.carfey.ops.api.embedded.AbstractAPIManager
-
- com.carfey.ops.api.embedded.CustomCalendarManager
-
public class CustomCalendarManager extends AbstractAPIManager
Class to manage custom calendars using the Obsidian public embedded API. SeeAbstractAPIManagerfor details on how transactions are managed within all requests.Example:
CustomCalendarListing calendars = new CustomCalendarManager().listCalendars(); System.out.println("Existing calendars: " + calendars);- Since:
- 2.3
- See Also:
- Embedded API Wiki, REST API Wiki, Carfey Date
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
AbstractAPIManager.ActionCallable
-
-
Constructor Summary
Constructors Constructor Description CustomCalendarManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomCalendaraddCalendar(CustomCalendarUpdateRequest request, java.lang.String auditUser)Creates a newCustomCalendarbased on the supplied request.CustomCalendardeleteCalendar(long customCalendarId, java.lang.String auditUser)Deletes the requestedCustomCalendar.CustomCalendargetCalendar(long customCalendarId)Loads an existingCustomCalendar.CustomCalendarListinglistCalendars()Loads all existingCustomCalendars.CustomCalendarupdateCalendar(long customCalendarId, CustomCalendarUpdateRequest request, java.lang.String auditUser)Updates an existingCustomCalendarbased on the supplied request.-
Methods inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
addParameter, runApiTarget, validateRequired, withTransaction
-
-
-
-
Method Detail
-
listCalendars
public CustomCalendarListing listCalendars() throws java.lang.Exception
Loads all existingCustomCalendars.- Returns:
CustomCalendarListingcontaining all configuredCustomCalendars (never null)- Throws:
java.lang.Exception- Any type of unexpected exception.
-
getCalendar
public CustomCalendar getCalendar(long customCalendarId) throws MissingEntityException, java.lang.Exception
Loads an existingCustomCalendar.- Parameters:
customCalendarId- The id of theCustomCalendarto fetch.- Returns:
- the
CustomCalendar(never null) - Throws:
MissingEntityException- If theCustomCalendarwith the requested id does not exist.java.lang.Exception- Any other type of unexpected exception.
-
addCalendar
public CustomCalendar addCalendar(CustomCalendarUpdateRequest request, java.lang.String auditUser) throws ValidationException, java.lang.Exception
Creates a newCustomCalendarbased on the supplied request.- Parameters:
request- Details of the creation request (not null)auditUser- Optional user that is marked in audit columns. Defaults to "embeddedAPI".- Returns:
- the created
CustomCalendar(never null) - Throws:
ValidationException- A validation error which prevents the action from succeeding.java.lang.Exception- Any other type of unexpected exception.
-
updateCalendar
public CustomCalendar updateCalendar(long customCalendarId, CustomCalendarUpdateRequest request, java.lang.String auditUser) throws MissingEntityException, ValidationException, java.lang.Exception
Updates an existingCustomCalendarbased on the supplied request.- Parameters:
customCalendarId- The id of the custom calendar to update.request- Details of the creation request (not null)auditUser- Optional user that is marked in audit columns. Defaults to "embeddedAPI".- Returns:
- the
CustomCalendar(never null) - Throws:
MissingEntityException- If the custom calendar with the requested id does not exist.ValidationException- A validation error which prevents the action from succeeding.java.lang.Exception- Any other type of unexpected exception.
-
deleteCalendar
public CustomCalendar deleteCalendar(long customCalendarId, java.lang.String auditUser) throws ValidationException, MissingEntityException, java.lang.Exception
Deletes the requestedCustomCalendar.- Parameters:
customCalendarId- ID of the custom calendar to deleteauditUser- Optional user that is marked in audit columns. Defaults to "embeddedAPI".- Returns:
- the deleted
CustomCalendar - Throws:
ValidationException- A validation error which prevents the action from succeeding.MissingEntityException- If the custom calendar with the requested ID does not exist.java.lang.Exception- Any other type of unexpected exception.- Since:
- 3.0
-
-