/** * {@inheritDoc} */ public final String getValue() { return getPeriods().toString(); }
public Property createProperty(final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new FreeBusy(parameters, value); }
/** * @param aValue a freebusy value * @throws ParseException where the specified string is not a valid freebusy value */ public FreeBusy(final String aValue) throws ParseException { super(FREEBUSY, new Factory()); setValue(aValue); }
public FreeBusy build() { final FreeBusy fb = new FreeBusy(); fb.getParameters().add(FbType.FREE); final PeriodList periods = getConsumedTime(components, start, end); final DateRange range = new DateRange(start, end); fb.getPeriods().add(new Period(lastPeriodEnd, freeDuration.getDuration()));
FreeBusy fb = new FreeBusy(); PeriodList pdl = fb.getPeriods();
FbType fbt = (FbType) fb.getParameters().getParameter( Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) { addRelevantPeriods(busyPeriods, fb.getPeriods(), freeBusyRange); } else if (FbType.BUSY_TENTATIVE.equals(fbt)) { addRelevantPeriods(busyTentativePeriods, fb .getPeriods(), freeBusyRange); } else if (FbType.BUSY_UNAVAILABLE.equals(fbt)) { addRelevantPeriods(busyUnavailablePeriods, fb .getPeriods(), freeBusyRange);
FreeBusy fb = new FreeBusy(busyPeriods); fb.getParameters().add(FbType.BUSY); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyTentativePeriods); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyUnavailablePeriods); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
/** * */ public void testFbType() { VFreeBusy result = new VFreeBusy(request, components); FreeBusy fb = (FreeBusy) result.getProperty(Property.FREEBUSY); assertEquals(expectedFbType, fb.getParameter(Parameter.FBTYPE)); }
for(FreeBusy fb : props) { FbType fbt = (FbType) fb.getParameters().getParameter(Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) { busyPeriods.addAll(fb.getPeriods()); } else if (FbType.BUSY_TENTATIVE.equals(fbt)) { busyTentativePeriods.addAll(fb.getPeriods()); } else if (FbType.BUSY_UNAVAILABLE.equals(fbt)) { busyUnavailablePeriods.addAll(fb.getPeriods()); FreeBusy fb = new FreeBusy(busyPeriods); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyTentativePeriods); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyUnavailablePeriods); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
FreeBusy fb = new FreeBusy(); PeriodList pdl = fb.getPeriods();
FbType fbt = (FbType) fb.getParameters().getParameter( Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) { addRelevantPeriods(busyPeriods, fb.getPeriods(), freeBusyRange); } else if (FbType.BUSY_TENTATIVE.equals(fbt)) { addRelevantPeriods(busyTentativePeriods, fb .getPeriods(), freeBusyRange); } else if (FbType.BUSY_UNAVAILABLE.equals(fbt)) { addRelevantPeriods(busyUnavailablePeriods, fb .getPeriods(), freeBusyRange);
FreeBusy fb = new FreeBusy(busyPeriods); fb.getParameters().add(FbType.BUSY); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyTentativePeriods); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyUnavailablePeriods); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }
FbType fbType = (FbType) fb.getParameter(Parameter.FBTYPE); if (fbType != null && fbType == FbType.FREE) availability = Events.AVAILABILITY_FREE;
for(FreeBusy fb : props) { FbType fbt = (FbType) fb.getParameters().getParameter(Parameter.FBTYPE); if (fbt == null || FbType.BUSY.equals(fbt)) { busyPeriods.addAll(fb.getPeriods()); } else if (FbType.BUSY_TENTATIVE.equals(fbt)) { busyTentativePeriods.addAll(fb.getPeriods()); } else if (FbType.BUSY_UNAVAILABLE.equals(fbt)) { busyUnavailablePeriods.addAll(fb.getPeriods()); FreeBusy fb = new FreeBusy(busyPeriods); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyTentativePeriods); fb.getParameters().add(FbType.BUSY_TENTATIVE); vfb.getProperties().add(fb); FreeBusy fb = new FreeBusy(busyUnavailablePeriods); fb.getParameters().add(FbType.BUSY_UNAVAILABLE); vfb.getProperties().add(fb);
/** * {@inheritDoc} */ public final String getValue() { return getPeriods().toString(); }
public Property createProperty() { return new FreeBusy(); } }
/** * @param aList a list of parameters for this component * @param aValue a value string for this component * @throws ParseException when the specified string is not a valid list of periods */ public FreeBusy(final ParameterList aList, final String aValue) throws ParseException { super(FREEBUSY, aList, PropertyFactoryImpl.getInstance()); setValue(aValue); }
/** * {@inheritDoc} */ public final void validate() throws ValidationException { /* * ; the following is optional, ; but MUST NOT occur more than once (";" fbtypeparam) / */ ParameterValidator.getInstance().assertOneOrLess(Parameter.FBTYPE, getParameters()); /* * ; the following is optional, ; and MAY occur more than once (";" xparam) */ if (!periods.isUtc()) { throw new ValidationException("Periods must be in UTC format"); } }