/** * {@inheritDoc} */ public final String toString() { return BEGIN + ':' + getName() + Strings.LINE_SEPARATOR + getProperties() + getAvailable() + END + ':' + getName() + Strings.LINE_SEPARATOR; }
@Override public VAvailability createComponent(PropertyList properties, ComponentList subComponents) { return new VAvailability(properties, subComponents); } }
final Iterator iterator = getAvailable().iterator(); while (iterator.hasNext()) { final Component component = (Component) iterator.next(); getProperties()); PropertyValidator.getInstance().assertOne(Property.DTSTAMP, getProperties()); PropertyValidator.getInstance().assertOne(Property.UID, getProperties()); final DtStart start = (DtStart) getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART if (getProperty(Property.DTEND) != null) { PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); final DtEnd end = (DtEnd) getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND if (getProperty(Property.DURATION) != null) { throw new ValidationException("Only one of Property [" + Property.DTEND + "] or [" + Property.DURATION + getProperties()); PropertyValidator.getInstance().assertOneOrLess(Property.CREATED, getProperties());
Arrays.asList(Property.DTSTART, Property.DTSTAMP, Property.UID).forEach(parameter -> PropertyValidator.getInstance().assertOne(parameter, getProperties())); final DtStart start = getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART if (getProperty(Property.DTEND) != null) { PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); final DtEnd end = getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND if (getProperty(Property.DURATION) != null) { throw new ValidationException("Only one of Property [" + Property.DTEND + "] or [" + Property.DURATION + Property.ORGANIZER, Property.SEQUENCE, Property.SUMMARY, Property.URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, getProperties())); validateProperties();
public void testVAvailability() throws ParserException, IOException { CalendarBuilder calendarBuilder = new CalendarBuilder(); String availability = getVAvailabilityICal(); Reader reader = new StringReader(availability); Calendar calendar = calendarBuilder.build(reader); Component availabilityComponent = calendar.getComponent(Component.VAVAILABILITY); Assert.assertNotNull(availabilityComponent); Assert.assertFalse(((VAvailability) availabilityComponent).getAvailable().isEmpty()); String iCalString = calendar.toString(); Assert.assertTrue(iCalString.contains("BEGIN:AVAILABLE")); Assert.assertEquals(iCalString.trim(), availability); }
@Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, getProperties()); } });
/** * @return * @throws SocketException */ public static TestSuite suite() throws SocketException { TestSuite suite = new TestSuite(); VAvailability a = new VAvailability(); suite.addTest(new VAvailabilityTest("testIsCalendarComponent", a)); suite.addTest(new VAvailabilityTest("testValidationException", a)); UidGenerator g = new RandomUidGenerator(); a = new VAvailability(); a.getProperties().add(g.generateUid()); a.getProperties().add(new DtStart(new DateTime())); suite.addTest(new VAvailabilityTest("testValidation", a)); return suite; }
freeBusy = true; } else if (entityType == IcalDefs.entityTypeVavailability) { comp = new VAvailability(pl); vavail = true; } else if (entityType == IcalDefs.entityTypeAvailable) { final VAvailability va = (VAvailability)comp; for (final EventInfo aei: ei.getContainedItems()) { va.getAvailable().add((Available)toIcalComponent(aei, false, tzreg, currentPrincipal));
Arrays.asList(Property.DTSTART, Property.DTSTAMP, Property.UID).forEach(parameter -> PropertyValidator.getInstance().assertOne(parameter, getProperties())); final DtStart start = getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART if (getProperty(Property.DTEND) != null) { PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); final DtEnd end = getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND if (getProperty(Property.DURATION) != null) { throw new ValidationException("Only one of Property [" + Property.DTEND + "] or [" + Property.DURATION + Property.ORGANIZER, Property.SEQUENCE, Property.SUMMARY, Property.URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, getProperties())); validateProperties();
cl = ((VAvailability)comp).getAvailable();
@Override public void execute(String input) { PropertyValidator.getInstance().assertOne(input, getProperties()); } });
/** * {@inheritDoc} */ public final String toString() { return BEGIN + ':' + getName() + Strings.LINE_SEPARATOR + getProperties() + getAvailable() + END + ':' + getName() + Strings.LINE_SEPARATOR; }
final DtStart start = (DtStart) getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART if (getProperty(Property.DTEND) != null) { PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); final DtEnd end = (DtEnd) getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND if (getProperty(Property.DURATION) != null) { throw new ValidationException("Only one of Property [" + Property.DTEND + "] or [" + Property.DURATION + validateProperties();
@Override public void endCalendar() throws IOException { if (propertiesWithTzId.size() > 0 && tzRegistry != null) { for (CalendarComponent component : calendar.getComponents()) { resolveTimezones(component.getProperties()); if (component instanceof VAvailability) { for (Component available : ((VAvailability) component).getAvailable()) { resolveTimezones(available.getProperties()); } } else if (component instanceof VEvent) { for (Component alarm : ((VEvent) component).getAlarms()) { resolveTimezones(alarm.getProperties()); } } else if (component instanceof VToDo) { for (Component todo : ((VToDo) component).getAlarms()) { resolveTimezones(todo.getProperties()); } } } } consumer.accept(calendar); }
@Override public VAvailability createComponent(PropertyList properties) { return new VAvailability(properties); }
@Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, getProperties()); } });
/** * {@inheritDoc} */ public final String toString() { String b = BEGIN + ':' + getName() + Strings.LINE_SEPARATOR + getProperties() + getAvailable() + END + ':' + getName() + Strings.LINE_SEPARATOR; return b; }
final DtStart start = (DtStart) getProperty(Property.DTSTART); if (Value.DATE.equals(start.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTSTART if (getProperty(Property.DTEND) != null) { PropertyValidator.getInstance().assertOne(Property.DTEND, getProperties()); final DtEnd end = (DtEnd) getProperty(Property.DTEND); if (Value.DATE.equals(end.getParameter(Parameter.VALUE))) { throw new ValidationException("Property [" + Property.DTEND if (getProperty(Property.DURATION) != null) { throw new ValidationException("Only one of Property [" + Property.DTEND + "] or [" + Property.DURATION + validateProperties();
@Override public void endCalendar() throws IOException { if (propertiesWithTzId.size() > 0 && tzRegistry != null) { for (CalendarComponent component : calendar.getComponents()) { resolveTimezones(component.getProperties()); if (component instanceof VAvailability) { for (Component available : ((VAvailability) component).getAvailable()) { resolveTimezones(available.getProperties()); } } else if (component instanceof VEvent) { for (Component alarm : ((VEvent) component).getAlarms()) { resolveTimezones(alarm.getProperties()); } } else if (component instanceof VToDo) { for (Component todo : ((VToDo) component).getAlarms()) { resolveTimezones(todo.getProperties()); } } } } consumer.accept(calendar); }
@Override public VAvailability createComponent(PropertyList properties, ComponentList subComponents) { return new VAvailability(properties, subComponents); } }