Top Description Inners Fields Constructors Methods
net.fortuna.ical4j.model.component

public Class VFreeBusy

extends CalendarComponent
implements Prototype<VFreeBusy>, ComponentContainer<Component>, ParticipantsAccessor, LocationsAccessor, ResourcesAccessor, DateTimePropertyAccessor
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.DateTimePropertyAccessor, net.fortuna.ical4j.model.PropertyContainer, net.fortuna.ical4j.model.PropertyListAccessor, net.fortuna.ical4j.model.ResourcesAccessor, net.fortuna.ical4j.model.ComponentContainer, net.fortuna.ical4j.model.ComponentListAccessor, net.fortuna.ical4j.model.LocationsAccessor, net.fortuna.ical4j.model.ParticipantsAccessor, net.fortuna.ical4j.model.Prototype
Imports
net.fortuna.ical4j.model.*, net.fortuna.ical4j.model.parameter.FbType, net.fortuna.ical4j.model.property.*, net.fortuna.ical4j.validate.*, org.threeten.extra.Interval, java.time.Instant, java.time.temporal.Temporal, .TemporalAmount, java.util.*, java.util.stream.Collectors

$Id$ [Apr 5, 2004] Defines an iCalendar VFREEBUSY component.
 4.6.4 Free/Busy Component

    Component Name: VFREEBUSY

    Purpose: Provide a grouping of component properties that describe
    either a request for free/busy time, describe a response to a request
    for free/busy time or describe a published set of busy time.

    Formal Definition: A "VFREEBUSY" calendar component is defined by the
    following notation:

      freebusyc  = "BEGIN" ":" "VFREEBUSY" CRLF
                   fbprop
                   "END" ":" "VFREEBUSY" CRLF

      fbprop     = *(

                 ; the following are optional,
                 ; but MUST NOT occur more than once

                 contact / dtstart / dtend / duration / dtstamp /
                 organizer / uid / url /

                 ; the following are optional,
                 ; and MAY occur more than once

                 attendee / comment / freebusy / rstatus / x-prop

                 )

    Description: A "VFREEBUSY" calendar component is a grouping of
    component properties that represents either a request for, a reply to
    a request for free or busy time information or a published set of
    busy time information.

    When used to request free/busy time information, the "ATTENDEE"
    property specifies the calendar users whose free/busy time is being
    requested; the "ORGANIZER" property specifies the calendar user who
    is requesting the free/busy time; the "DTSTART" and "DTEND"
    properties specify the window of time for which the free/busy time is
    being requested; the "UID" and "DTSTAMP" properties are specified to
    assist in proper sequencing of multiple free/busy time requests.

    When used to reply to a request for free/busy time, the "ATTENDEE"
    property specifies the calendar user responding to the free/busy time
    request; the "ORGANIZER" property specifies the calendar user that
    originally requested the free/busy time; the "FREEBUSY" property
    specifies the free/busy time information (if it exists); and the
    "UID" and "DTSTAMP" properties are specified to assist in proper
    sequencing of multiple free/busy time replies.

    When used to publish busy time, the "ORGANIZER" property specifies
    the calendar user associated with the published busy time; the
    "DTSTART" and "DTEND" properties specify an inclusive time window
    that surrounds the busy time information; the "FREEBUSY" property
    specifies the published busy time information; and the "DTSTAMP"
    property specifies the date/time that iCalendar object was created.

    The "VFREEBUSY" calendar component cannot be nested within another
    calendar component. Multiple "VFREEBUSY" calendar components can be
    specified within an iCalendar object. This permits the grouping of
    Free/Busy information into logical collections, such as monthly
    groups of busy time information.

    The "VFREEBUSY" calendar component is intended for use in iCalendar
    object methods involving requests for free time, requests for busy
    time, requests for both free and busy, and the associated replies.

    Free/Busy information is represented with the "FREEBUSY" property.
    This property provides a terse representation of time periods. One or
    more "FREEBUSY" properties can be specified in the "VFREEBUSY"
    calendar component.

    When present in a "VFREEBUSY" calendar component, the "DTSTART" and
    "DTEND" properties SHOULD be specified prior to any "FREEBUSY"
    properties. In a free time request, these properties can be used in
    combination with the "DURATION" property to represent a request for a
    duration of free time within a specified window of time.

    The recurrence properties ("RRULE", "EXRULE", "RDATE", "EXDATE") are
    not permitted within a "VFREEBUSY" calendar component. Any recurring
    events are resolved into their individual busy time periods using the
    "FREEBUSY" property.

    Example: The following is an example of a "VFREEBUSY" calendar
    component used to request free or busy time information:

      BEGIN:VFREEBUSY
      ORGANIZER:MAILTO:[email protected]
      ATTENDEE:MAILTO:[email protected]
      DTSTART:19971015T050000Z
      DTEND:19971016T050000Z
      DTSTAMP:19970901T083000Z
      END:VFREEBUSY

    The following is an example of a "VFREEBUSY" calendar component used
    to reply to the request with busy time information:

      BEGIN:VFREEBUSY
      ORGANIZER:MAILTO:[email protected]
      ATTENDEE:MAILTO:[email protected]
      DTSTAMP:19970901T100000Z
      FREEBUSY;VALUE=PERIOD:19971015T050000Z/PT8H30M,
       19971015T160000Z/PT5H30M,19971015T223000Z/PT6H30M
      URL:http://host2.com/pub/busy/jpublic-01.ifb
      COMMENT:This iCalendar file contains busy time information for
        the next three months.
      END:VFREEBUSY

    The following is an example of a "VFREEBUSY" calendar component used
    to publish busy time information.

      BEGIN:VFREEBUSY
      ORGANIZER:[email protected]
      DTSTART:19980313T141711Z
      DTEND:19980410T141711Z
      FREEBUSY:19980314T233000Z/19980315T003000Z
      FREEBUSY:19980316T153000Z/19980316T163000Z
      FREEBUSY:19980318T030000Z/19980318T040000Z
      URL:http://www.host.com/calendar/busytime/jsmith.ifb
      END:VFREEBUSY
Example 1 - Requesting all busy time slots for a given period:

// request all busy times between today and 1 week from now..
DateTime start = new DateTime();
DateTime end = new DateTime(start.getTime() + 1000 * 60 * 60 * 24 * 7);

VFreeBusy request = new VFreeBusy(start, end);

VFreeBusy reply = new VFreeBusy(request, calendar.getComponents());
Example 2 - Requesting all free time slots for a given period of at least the specified duration:

// request all free time between today and 1 week from now of
// duration 2 hours or more..
DateTime start = new DateTime();
DateTime end = new DateTime(start.getTime() + 1000 * 60 * 60 * 24 * 7);

VFreeBusy request = new VFreeBusy(start, end, new Dur(0, 2, 0, 0));

VFreeBusy response = new VFreeBusy(request, myCalendar.getComponents());
Author
Ben Fortuna

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
VFreeBusy.BusyTimeBuilder

Create a FREEBUSY property representing the busy time for the specified component list.

public static class
VFreeBusy.Factory

Default factory.

private static class
VFreeBusy.FreeTimeBuilder

Create a FREEBUSY property representing the free time available of the specified duration for the given list of components.

Field Summary

Modifier and TypeField and Description
private static final Map<Method, Validator<VFreeBusy>>
private static final long
Inherited from net.fortuna.ical4j.model.component.CalendarComponent:
EMPTY_VALIDATOR

Constructor Summary

AccessConstructor and Description
public
VFreeBusy()

Default constructor.

public
VFreeBusy(boolean initialise)

public
VFreeBusy(final PropertyList
a list of properties
properties
)

Constructor.

public
VFreeBusy(final Temporal
the starting boundary for the VFreeBusy
start
,
final Temporal
the ending boundary for the VFreeBusy
end
)

Constructs a new VFreeBusy instance with the specified start and end boundaries.

public
VFreeBusy(final Instant
the starting boundary for the VFreeBusy
start
,
final Instant
the ending boundary for the VFreeBusy
end
,
final TemporalAmount
the length of the period being requested
duration
)

Constructs a new VFreeBusy instance with the specified start and end boundaries.

public
VFreeBusy(final VFreeBusy
a VFREEBUSY request
request
,
final List<CalendarComponent>
a component list used to initialise busy time
components
)

Constructs a new VFreeBusy instance representing a reply to the specified VFREEBUSY request according to the specified list of components.

Method Summary

Modifier and TypeMethod and Description
public VFreeBusy
copy()

Overrides net.fortuna.ical4j.model.Component.copy.

Implements net.fortuna.ical4j.model.Prototype.copy.

Create a (deep) copy of this component.

public ComponentList<Component>

Returns:

Returns the underlying component list.
getComponentList
()

Implements net.fortuna.ical4j.model.ComponentListAccessor.getComponentList.

private static <T extends Temporal> List<Interval>
getConsumedTime(final List<CalendarComponent> components, final Period<T> range)

Creates a list of periods representing the time consumed by the specified list of components.

public final Optional<Contact>

Returns:

the CONTACT property or null if not specified
getContact
()

public final Optional<DtStamp>

Returns:

the DTSTAMP property or null if not specified
getDateStamp
()

public final <T extends Temporal> Optional<DtEnd<T>>

Returns:

the DTEND property or null if not specified
getEndDate
()

public final Optional<Organizer>

Returns:

the ORGANIZER property or null if not specified
getOrganizer
()

public final <T extends Temporal> Optional<DtStart<T>>

Returns:

the DTSTART propery or null if not specified
getStartDate
()

public final Optional<Url>

Returns:

the URL property or null if not specified
getUrl
()

protected ComponentFactory<VFreeBusy>
newFactory()

Implements abstract net.fortuna.ical4j.model.Component.newFactory.

Returns a new component factory used to create deep copies.

public void
public ValidationResult
validate(final boolean
indicates whether to validate the component's properties
recurse
)

Implements abstract net.fortuna.ical4j.model.Component.validate.

Perform validation on a component.

public ValidationResult
validate(Method
the applicable method
method
)

Overrides net.fortuna.ical4j.model.component.CalendarComponent.validate.

Performs method-specific ITIP validation.

Inherited from net.fortuna.ical4j.model.component.CalendarComponent:
validateAddvalidateCancelvalidateCountervalidateDeclineCountervalidatePublishvalidateRefreshvalidateReplyvalidateRequest

Field Detail

methodValidatorsback to summary
private static final Map<Method, Validator<VFreeBusy>> methodValidators
serialVersionUIDback to summary
private static final long serialVersionUID

Hides net.fortuna.ical4j.model.component.CalendarComponent.serialVersionUID.

Constructor Detail

VFreeBusyback to summary
public VFreeBusy()

Default constructor.

VFreeBusyback to summary
public VFreeBusy(boolean initialise)
VFreeBusyback to summary
public VFreeBusy(final PropertyList properties)

Constructor.

Parameters
properties:PropertyList

a list of properties

VFreeBusyback to summary
public VFreeBusy(final Temporal start, final Temporal end)

Constructs a new VFreeBusy instance with the specified start and end boundaries. This constructor should be used for requesting busy time for a specified period.

Parameters
start:Temporal

the starting boundary for the VFreeBusy

end:Temporal

the ending boundary for the VFreeBusy

VFreeBusyback to summary
public VFreeBusy(final Instant start, final Instant end, final TemporalAmount duration)

Constructs a new VFreeBusy instance with the specified start and end boundaries. This constructor should be used for requesting free time for a specified duration in given period defined by the start date and end date.

Parameters
start:Instant

the starting boundary for the VFreeBusy

end:Instant

the ending boundary for the VFreeBusy

duration:TemporalAmount

the length of the period being requested

VFreeBusyback to summary
public VFreeBusy(final VFreeBusy request, final List<CalendarComponent> components)

Constructs a new VFreeBusy instance representing a reply to the specified VFREEBUSY request according to the specified list of components. If the request argument has its duration set, then the result represents a list of free times (that is, parameter FBTYPE is set to FbType.FREE). If the request argument does not have its duration set, then the result represents a list of busy times.

Parameters
request:VFreeBusy

a VFREEBUSY request

components:List<CalendarComponent>

a component list used to initialise busy time

Method Detail

copyback to summary
public VFreeBusy copy()

Overrides net.fortuna.ical4j.model.Component.copy.

Implements net.fortuna.ical4j.model.Prototype.copy.

Doc from net.fortuna.ical4j.model.Component.copy.

Create a (deep) copy of this component.

Returns:VFreeBusy

the component copy

Annotations
@Override
getComponentListback to summary
public ComponentList<Component> getComponentList()

Implements net.fortuna.ical4j.model.ComponentListAccessor.getComponentList.

Returns:ComponentList<Component>

Returns the underlying component list.

Annotations
@Override
getConsumedTimeback to summary
private static <T extends Temporal> List<Interval> getConsumedTime(final List<CalendarComponent> components, final Period<T> range)

Creates a list of periods representing the time consumed by the specified list of components.

getContactback to summary
public final Optional<Contact> getContact()
Returns:Optional<Contact>

the CONTACT property or null if not specified

Annotations
@Deprecated
getDateStampback to summary
public final Optional<DtStamp> getDateStamp()
Returns:Optional<DtStamp>

the DTSTAMP property or null if not specified

Annotations
@Deprecated
getEndDateback to summary
public final <T extends Temporal> Optional<DtEnd<T>> getEndDate()
Returns:Optional<DtEnd<T>>

the DTEND property or null if not specified

Annotations
@Deprecated
getOrganizerback to summary
public final Optional<Organizer> getOrganizer()
Returns:Optional<Organizer>

the ORGANIZER property or null if not specified

Annotations
@Deprecated
getStartDateback to summary
public final <T extends Temporal> Optional<DtStart<T>> getStartDate()
Returns:Optional<DtStart<T>>

the DTSTART propery or null if not specified

Annotations
@Deprecated
getUrlback to summary
public final Optional<Url> getUrl()
Returns:Optional<Url>

the URL property or null if not specified

Annotations
@Deprecated
newFactoryback to summary
protected ComponentFactory<VFreeBusy> newFactory()

Implements abstract net.fortuna.ical4j.model.Component.newFactory.

Doc from net.fortuna.ical4j.model.Component.newFactory.

Returns a new component factory used to create deep copies.

Returns:ComponentFactory<VFreeBusy>

a component factory instance

Annotations
@Override
setComponentListback to summary
public void setComponentList(ComponentList<Component> components)

Implements net.fortuna.ical4j.model.ComponentContainer.setComponentList.

Annotations
@Override
validateback to summary
public ValidationResult validate(final boolean recurse) throws ValidationException

Implements abstract net.fortuna.ical4j.model.Component.validate.

Doc from net.fortuna.ical4j.model.Component.validate.

Perform validation on a component.

Parameters
recurse:boolean

indicates whether to validate the component's properties

Annotations
@Override
Exceptions
ValidationException:
where the component is not in a valid state
validateback to summary
public ValidationResult validate(Method method) throws ValidationException

Overrides net.fortuna.ical4j.model.component.CalendarComponent.validate.

Performs method-specific ITIP validation.

Parameters
method:Method

the applicable method

Exceptions
ValidationException:
where the component does not comply with RFC2446
net.fortuna.ical4j.model.component back to summary

private Class VFreeBusy.BusyTimeBuilder

extends Object
Class Inheritance

Create a FREEBUSY property representing the busy time for the specified component list. If the component is not applicable to FREEBUSY time, or if the component is outside the bounds of the start and end dates, null is returned. If no valid busy periods are identified in the component an empty FREEBUSY property is returned (i.e. empty period list).

Field Summary

Modifier and TypeField and Description
private List<CalendarComponent>
private Instant
private Instant

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public FreeBusy
public VFreeBusy.BusyTimeBuilder
public VFreeBusy.BusyTimeBuilder
end(Instant end)

public VFreeBusy.BusyTimeBuilder
start(Instant start)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

componentsback to summary
private List<CalendarComponent> components
endback to summary
private Instant end
startback to summary
private Instant start

Constructor Detail

BusyTimeBuilderback to summary
private BusyTimeBuilder()

Method Detail

buildback to summary
public FreeBusy build()
componentsback to summary
public VFreeBusy.BusyTimeBuilder components(List<CalendarComponent> components)
endback to summary
public VFreeBusy.BusyTimeBuilder end(Instant end)
startback to summary
public VFreeBusy.BusyTimeBuilder start(Instant start)
net.fortuna.ical4j.model.component back to summary

public Class VFreeBusy.Factory

extends Factory
implements ComponentFactory<VFreeBusy>
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.ComponentFactory

Default factory.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public VFreeBusy
public VFreeBusy
Inherited from net.fortuna.ical4j.model.Content.Factory:
supports

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

createComponentback to summary
public VFreeBusy createComponent()

Implements net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override
createComponentback to summary
public VFreeBusy createComponent(PropertyList properties)

Implements net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override
net.fortuna.ical4j.model.component back to summary

private Class VFreeBusy.FreeTimeBuilder

extends Object
Class Inheritance

Create a FREEBUSY property representing the free time available of the specified duration for the given list of components. component. If the component is not applicable to FREEBUSY time, or if the component is outside the bounds of the start and end dates, null is returned. If no valid busy periods are identified in the component an empty FREEBUSY property is returned (i.e. empty period list).

Field Summary

Modifier and TypeField and Description
private List<CalendarComponent>
private TemporalAmount
private Instant
private Instant

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public FreeBusy
public VFreeBusy.FreeTimeBuilder
private VFreeBusy.FreeTimeBuilder
public VFreeBusy.FreeTimeBuilder
end(Instant end)

public VFreeBusy.FreeTimeBuilder
start(Instant start)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

componentsback to summary
private List<CalendarComponent> components
durationback to summary
private TemporalAmount duration
endback to summary
private Instant end
startback to summary
private Instant start

Constructor Detail

FreeTimeBuilderback to summary
private FreeTimeBuilder()

Method Detail

buildback to summary
public FreeBusy build()
componentsback to summary
public VFreeBusy.FreeTimeBuilder components(List<CalendarComponent> components)
durationback to summary
private VFreeBusy.FreeTimeBuilder duration(TemporalAmount duration)
endback to summary
public VFreeBusy.FreeTimeBuilder end(Instant end)
startback to summary
public VFreeBusy.FreeTimeBuilder start(Instant start)