Interface ReservationService
Reservable objects.
Supported API: true
Extendable: false
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncheckGranted(Collection<Reservation> reservations) Check if reservations are granted.booleancheckGranted(Reservation reservation) Check if a reservation is granted.checkReserved(WTCollection reservableRefs, ReservationType reservationType) Check for reservations granted for Reservable objects.checkReserved(ObjectReference reservableRef, ReservationType reservationType) Check for reservations granted for Reservable object.checkReservedBy(WTCollection reservedByRefs, ReservationType reservationType) Check for reservations granted to principals.checkReservedBy(WTPrincipalReference reservedByRef, ReservationType reservationType) Check for reservations granted to a principal.releaseReservation(Collection<Reservation> releases) Release reservations forReservableobjects.releaseReservation(Reservation release) Release a reservation for a singleReservableobject.requestReservation(Collection<Reservation> requests, boolean allOrNone) Request reservations forReservableobjects.requestReservation(Reservation request) Request reservation for a singleReservableobject.
-
Method Details
-
checkReserved
Set<Reservation> checkReserved(ObjectReference reservableRef, ReservationType reservationType) throws WTException Check for reservations granted for Reservable object.
Supported API: true- Parameters:
reservableRef- Reference ofReservableobject to be checked.reservationType- Type of reservation to be checked (null for all types).- Returns:
- Set of Reservation objects for granted reservations (guaranteed non-null, may be empty).
- Throws:
WTException
-
checkReserved
Set<Reservation> checkReserved(WTCollection reservableRefs, ReservationType reservationType) throws WTException Check for reservations granted for Reservable objects.
Supported API: true- Parameters:
reservableRefs- Collection ofReservableobjects to be checked (other types ignored, will not be inflated).reservationType- Type of reservation to be checked (null for all types).- Returns:
- Set of Reservation objects for granted reservations (guaranteed non-null, may be empty).
- Throws:
WTException
-
checkReservedBy
Set<Reservation> checkReservedBy(WTPrincipalReference reservedByRef, ReservationType reservationType) throws WTException Check for reservations granted to a principal.
Supported API: true- Parameters:
reservedByRef- Reference ofWTPrincipalobjects to be checked.reservationType- Type of reservation to be checked (null for all types).- Returns:
- Set of Reservation objects for granted reservations (guaranteed non-null, may be empty).
- Throws:
WTException
-
checkReservedBy
Set<Reservation> checkReservedBy(WTCollection reservedByRefs, ReservationType reservationType) throws WTException Check for reservations granted to principals.
Supported API: true- Parameters:
reservedBy- Collection ofWTPrincipalobjects to be checked (other types ignored, will not be inflated).reservationType- Type of reservation to be checked (null for all types).- Returns:
- Set of Reservation objects for granted reservations (guaranteed non-null, may be empty).
- Throws:
WTException
-
checkGranted
Check if a reservation is granted.
Supported API: true- Parameters:
reservations-Reservationobject describing reservation.
Attribute values required to determine granted status:Reservation.getReservableRef()-- required.Reservation.getReservationType()-- default isReservationType.MODIFY.Reservation.getReservedByRef()-- default is the current principal.
- Returns:
- True if reservation is currently granted, or false if not.
- Throws:
ReservationException- Thrown for invalid input.WTException
-
checkGranted
Set<Reservation> checkGranted(Collection<Reservation> reservations) throws ReservationException, WTException Check if reservations are granted.
Supported API: true- Parameters:
reservations- Collection ofReservationobjects describing reservations.
Attribute values required to determine granted status:Reservation.getReservableRef()-- required.Reservation.getReservationType()-- default isReservationType.MODIFY.Reservation.getReservedByRef()-- default is the current principal.
- Returns:
- Set of reservations that are granted (guaranteed non-null, may be empty).
- Throws:
ReservationException- Thrown for invalid input.WTException
-
requestReservation
Request reservation for a singleReservableobject.See
ReservationService#requestReservation(Set, boolean)for complete documentation.
Supported API: true- Parameters:
request-Reservationobject describing the reservation request.- Returns:
- Input
Reservationobject containing request result. - Throws:
ReservationException- Thrown for invalid input.WTException
-
requestReservation
Collection<Reservation> requestReservation(Collection<Reservation> requests, boolean allOrNone) throws ReservationException, WTException Request reservations forReservableobjects. A request will be denied if a reservation is already held by a different principal. A request for a reservation already held by the same principal will be automatically re-granted and its expiration time will be reset.It is strongly recommended that this API be called either outside of an active database transaction. If a transaction is in progress when this API is called then granted reservations will not become effective until the transaction is fully committed. In the period between return of this API call and full transaction commit a granted reservation can be stolen by another requester, which will cause a database uniqueness exception and a rollback.
Supported API: true- Parameters:
requests- Collection ofReservationobjects describing the reservation requests. The caller must set the reservable reference of each Reservation object. All other attributes used to control the reservation are optional and have default values.List of attribute setters that control a reservation request:
Reservation.setReservableRef(ObjectReference)-- required.Reservation.setReservationType(ReservationType)-- default isReservationType.MODIFY.Reservation.setReservedByRef(WTPrincipalReference)-- default is the current principal.Reservation.setExpiresAfter(int)-- default taken from system propertyReservation.setEnforcedByService(boolean)-- default is false.Reservation.setAdminOverride(boolean)-- default is false.Reservation.setWorkflowOverride(boolean)-- default is false.
allOrNone- True to restrict granting reservations to either all of requests or none of the requests. If true then no requests will be granted if one or more is denied. If false then requests will be granted when possible, and results may contain a mixture of granted and denied.- Returns:
- Input collection of
Reservationobjects containing request results (guaranteed non-null, may be empty).Methods
_Reservation.isGranted()andReservationHelper.filterByGranted(Set, boolean)can be used to determine which reservations were granted.Method
_Reservation.getErrorMessage()andReservationHelper.filterByMessage(Set, boolean)can be used to obtain localized messages giving reasons for request failures. - Throws:
ReservationException- Thrown for invalid input.WTException
-
releaseReservation
Release a reservation for a singleReservableobject.See
ReservationService#releaseReservation(Set)for complete documentation.
Supported API: true- Parameters:
release-Reservationobject describing the reservation release.- Returns:
- Input
Reservationobject containing release result. - Throws:
ReservationException- Thrown for invalid input or if current principal does is not authorized to release the reservation.WTException
-
releaseReservation
Collection<Reservation> releaseReservation(Collection<Reservation> releases) throws ReservationException, WTException Release reservations forReservableobjects. Releases for reservations not currently granted are ignored. Reservations can only be released by the following principals:- The principal that was originally granted the reservation.
- A principal with administrative permission to the organization or site containing the reservable object.
Supported API: true- Parameters:
releases- Collection ofReservationobjects describing the reservation releases. The caller must set the reservable reference of each Reservation object. All other attributes used to control the reservation are optional and have default values.List of attribute setters that control a reservation release:
Reservation.setReservableRef(ObjectReference)-- required.Reservation.setReservationType(ReservationType)-- default isReservationType.MODIFY.
- Returns:
- Input collection of
Reservationobjects containing release results (guaranteed non-null, may be empty).Methods
_Reservation.isGranted()andReservationHelper.filterByGranted(Set, boolean)can be used to determine which reservations were released (i.e., no longer granted).Method
_Reservation.getErrorMessage()andReservationHelper.filterByMessage(Set, boolean)can be used to obtain localized messages giving reasons for release failures. - Throws:
ReservationException- Thrown for invalid input or if current principal does is not authorized to release a reservation.WTException
-