Package wt.reservation
Class Reservation
java.lang.Object
wt.reservation._Reservation
wt.reservation.Reservation
- All Implemented Interfaces:
Externalizable,Serializable
@GenAsUnPersistable(extendable=false,properties={@GeneratedProperty(name="reservableRef",type=ObjectReference.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(getAccess=PRIVATE),javaDoc="Reference to {@link Reservable} object."),@GeneratedProperty(name="reservationType",type=ReservationType.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(getAccess=PRIVATE),javaDoc="Type of reservation requested or granted to the {@link Reservable} object."),@GeneratedProperty(name="reservedByRef",type=WTPrincipalReference.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(getAccess=PRIVATE),javaDoc="Reference to {@link WTPrincipal} requesting or holding the reservation (null for current principal)."),@GeneratedProperty(name="expiresAfter",type=int.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(getAccess=PRIVATE),javaDoc="Number of minutes the reservation is held before expiring (< 1 for default expiration time)."),@GeneratedProperty(name="expires",type=java.sql.Timestamp.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE),javaDoc="Reservation is automatically dropped after this time has passed (null if reservation has not been granted yet)."),@GeneratedProperty(name="enforcedByService",type=boolean.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE),javaDoc="True if reservation is enforced by {@link ReservationService}, false if enforced by client (default)."),@GeneratedProperty(name="adminOverride",type=boolean.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE),javaDoc="True if a principal with administrative permission to the site or organization containing the {@link Reservable} object is allowed to override the reservation, false if not allowed (default)."),@GeneratedProperty(name="workflowOverride",type=boolean.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE),javaDoc="True if a workflow process is allowed to override the reservation, false if not allowed (default)."),@GeneratedProperty(name="granted",type=boolean.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE),javaDoc="True if reservation is granted, false if not granted."),@GeneratedProperty(name="errorMessage",type=WTMessage.class,supportedAPI=PUBLIC,accessors=@PropertyAccessors(setAccess=PRIVATE),javaDoc="Reason a reservation could not be granted (null if no error)."),@GeneratedProperty(name="immutable",type=boolean.class,supportedAPI=PRIVATE,accessors=@PropertyAccessors(getAccess=PRIVATE),javaDoc="True if this object is immutable.")})
public final class Reservation
extends _Reservation
Class to aggregate the parameters for requesting reservations or returning
Supported API: true
Extendable: false
ReservationService API results.
Supported API: true
Extendable: false
-
Field Summary
Fields inherited from class wt.reservation._Reservation
ADMIN_OVERRIDE, ENFORCED_BY_SERVICE, ERROR_MESSAGE, EXPIRES, EXPIRES_AFTER, GRANTED, RESERVABLE_REF, RESERVATION_TYPE, RESERVED_BY_REF, WORKFLOW_OVERRIDE -
Method Summary
Modifier and TypeMethodDescriptionbooleanReservation objects are equal if they have the same reservable object reference and reservation type.intGet the length of time in minutes a reservation is held before expiring (default is taken from system property "ReservationService.expiresAfter").Get reference to Reservable object.Get type of reservation requested or active (default isReservationType.MODIFY).Get reference to principal requesting or holding the reservation (default is current principal).static ReservationFactory to construct a Reservation object.static ReservationnewReservation(ObjectReference reservableRef) Factory to construct a Reservation object.static ReservationnewReservation(ObjectReference reservableRef, boolean enforcedByService, boolean adminOverride, boolean workflowOverride) Factory to construct a Reservation object.static ReservationnewReservation(Reservable reservable) Factory to construct a Reservation object.static ReservationnewReservation(Reservable reservable, boolean enforcedByService, boolean adminOverride, boolean workflowOverride) Factory to construct a Reservation object.static ReservationnewReservation(Reservation copyFrom, boolean immutable) Factory to construct a copy of a Reservation object.static Set<Reservation>newReservations(WTSet reservables) Factory to construct a collection of Reservation objects.static Set<Reservation>newReservations(WTSet reservables, boolean enforcedByService, boolean adminOverride, boolean workflowOverride) Factory to construct a collection of Reservation objects.voidsetAdminOverride(boolean adminOverride) Control if a principal with administrative permission to the site or organization containing theReservableobject is allowed to override the reservation.voidsetEnforcedByService(boolean enforcedByService) Control if reservation is enforced by theReservationService.voidsetExpiresAfter(int expiresAfter) Set the length of time in minutes a reservation is held before expiring (default is taken from system property "ReservationService.expiresAfter").voidsetReservable(Reservable reservable) Set reference to a Reservable object.voidsetReservableRef(ObjectReference reservableRef) Set reference to a Reservable object.voidsetReservationType(ReservationType reservationType) Set type of reservation requested or active (default isReservationType.MODIFY).voidsetReservedByRef(WTPrincipalReference reservedByRef) Set reference to principal requesting or holding the reservation (default is current principal).voidsetWorkflowOverride(boolean workflowOverride) Set true if a workflow process is allowed to override the reservation.Methods inherited from class wt.reservation._Reservation
getErrorMessage, getExpires, isAdminOverride, isEnforcedByService, isGranted, isWorkflowOverride
-
Method Details
-
newReservation
Factory to construct a Reservation object. All reservation options are set to default values.
Supported API: true- Returns:
- New
Reservationobject.
-
newReservation
Factory to construct a copy of a Reservation object.
Supported API: true- Parameters:
copyFrom- Existing object from which to copy attribute values.immutable- True to make the new reservation immutable.- Returns:
- New
Reservationobject with copied attributes. Subsequent changes to the attributes values of either the original or copy will not affect the other.
-
newReservation
Factory to construct a Reservation object. All reservation options not specified are set to default values.
Supported API: true- Parameters:
reservable- PersistedReservableobject.- Returns:
- New
Reservationobject. - Throws:
WTException
-
newReservation
public static Reservation newReservation(Reservable reservable, boolean enforcedByService, boolean adminOverride, boolean workflowOverride) throws WTException Factory to construct a Reservation object. All reservation options not specified are set to default values.
Supported API: true- Parameters:
reservable- PersistedReservableobject.enforcedByService- True if reservation is enforced byReservationService, or false if enforced by client code.adminOverride- True if a principal with administrative permission to the site or organization containing theReservableobject is allowed to override the reservation, false if not allowed.workflowOverride- True if a workflow process is allowed to override the reservation, false if not allowed.- Returns:
- New
Reservationobject. - Throws:
WTException
-
newReservation
Factory to construct a Reservation object. All reservation options not specified are set to default values.
Supported API: true- Parameters:
reservableRef- Reference toReservableobject.- Returns:
- New
Reservationobject. - Throws:
WTException
-
newReservation
public static Reservation newReservation(ObjectReference reservableRef, boolean enforcedByService, boolean adminOverride, boolean workflowOverride) throws WTException Factory to construct a Reservation object. All reservation options not specified are set to default values.
Supported API: true- Parameters:
reservableRef- Reference to persistedReservableobject.enforcedByService- True if reservation is enforced byReservationService, or false if enforced by client code.adminOverride- True if a principal with administrative permission to the site or organization containing theReservableobject is allowed to override the reservation, false if not allowed.workflowOverride- True if a workflow process is allowed to override the reservation, false if not allowed.- Returns:
- New
Reservationobject. - Throws:
WTException
-
newReservations
Factory to construct a collection of Reservation objects.
Supported API: true- Parameters:
reservables- Set ofReservableobject references (will not be inflated, other types ignored). References to Reservable objects must be typeObjectReference.- Returns:
- Set of new Reservation objects (guaranteed non-null, may be empty).
- Throws:
WTException
-
newReservations
public static Set<Reservation> newReservations(WTSet reservables, boolean enforcedByService, boolean adminOverride, boolean workflowOverride) throws WTException Factory to construct a collection of Reservation objects.
Supported API: true- Parameters:
reservables- Set ofReservableobject references (will not be inflated, other types ignored). References to Reservable objects must be typeObjectReference.enforcedByService- True if reservation is enforced byReservationService, or false if enforced by client code.adminOverride- True if a principal with administrative permission to the site or organization containing theReservableobject is allowed to override the reservation, false if not allowed.workflowOverride- True if a workflow process is allowed to override the reservation, false if not allowed.- Returns:
- Set of new Reservation objects (guaranteed non-null, may be empty). The set will only contain entries for reservable references that meet the stated requirements.
- Throws:
WTException
-
getReservableRef
Get reference to Reservable object.
Supported API: true- Returns:
- Reference to
Reservableobject (may be null for reservations not yet granted).
-
setReservableRef
Set reference to a Reservable object. Required when requesting a new reservation.
Supported API: true- Parameters:
reservableRef- Reference to a persistedReservableobject (must be non-null).- Throws:
WTException
-
setReservable
Set reference to a Reservable object. Required when requesting a new reservation.
Supported API: true- Parameters:
reservable- PersistedReservableobject (must be non-null).- Throws:
WTException
-
getReservationType
Get type of reservation requested or active (default isReservationType.MODIFY).
Supported API: true- Returns:
ReservationTypeobject (non-null).
-
setReservationType
Set type of reservation requested or active (default isReservationType.MODIFY).
Supported API: true- Parameters:
reservationType-ReservationTypeobject (null for default type).- Throws:
WTException
-
getReservedByRef
Get reference to principal requesting or holding the reservation (default is current principal).
Supported API: true- Returns:
WTPrincipalReferenceto reserving principal (null for default).
-
setReservedByRef
Set reference to principal requesting or holding the reservation (default is current principal).
Supported API: true- Parameters:
reservedByRef-WTPrincipalReferenceto reserving principal (null for default).
-
getExpiresAfter
public int getExpiresAfter()Get the length of time in minutes a reservation is held before expiring (default is taken from system property "ReservationService.expiresAfter").
Supported API: true -
setExpiresAfter
public void setExpiresAfter(int expiresAfter) Set the length of time in minutes a reservation is held before expiring (default is taken from system property "ReservationService.expiresAfter").
Supported API: true- Parameters:
expiresAfter- Number of minutes until expiration (< 1 for default expiration time).
-
setEnforcedByService
public void setEnforcedByService(boolean enforcedByService) - Parameters:
enforcedByService- True to enable service enforcement of reservation, false to disable (default).
-
setAdminOverride
Control if a principal with administrative permission to the site or organization containing theReservableobject is allowed to override the reservation.
Supported API: true- Parameters:
adminOverride- True to enable administrative override, false to disable (default). Can only be set true ifReservationServiceenforcement is enabled.- Throws:
WTException
-
setWorkflowOverride
Set true if a workflow process is allowed to override the reservation.
Supported API: true- Parameters:
workflowOverride- True to enable workflow process override, false to disable (default). Can only be set true ifReservationServiceenforcement is enabled.- Throws:
WTException
-
equals
Reservation objects are equal if they have the same reservable object reference and reservation type.
Supported API: true
-