Package com.saasovation.collaboration.domain.model.calendar

Examples of com.saasovation.collaboration.domain.model.calendar.Calendar


            String aCalendarId,
            String aDescription) {

        Tenant tenant = new Tenant(aTenantId);

        Calendar calendar =
                this.calendarRepository()
                    .calendarOfId(
                            tenant,
                            new CalendarId(aCalendarId));

        calendar.changeDescription(aDescription);

        this.calendarRepository().save(calendar);
    }
View Full Code Here


        Owner owner = this.collaboratorService().ownerFrom(tenant, anOwnerId);

        Set<CalendarSharer> sharers = this.sharersFrom(tenant, aParticipantsToSharedWith);

        Calendar calendar =
                new Calendar(
                        tenant,
                        this.calendarRepository.nextIdentity(),
                        aName,
                        aDescription,
                        owner,
                        sharers);

        this.calendarRepository().save(calendar);

        aCalendarCommandResult.resultingCalendarId(calendar.calendarId().id());
    }
View Full Code Here

            String aCalendarId,
            String aName) {

        Tenant tenant = new Tenant(aTenantId);

        Calendar calendar =
                this.calendarRepository()
                    .calendarOfId(
                            tenant,
                            new CalendarId(aCalendarId));

        calendar.rename(aName);

        this.calendarRepository().save(calendar);
    }
View Full Code Here

            Set<String> aParticipantsToInvite,
            CalendarCommandResult aCalendarCommandResult) {

        Tenant tenant = new Tenant(aTenantId);

        Calendar calendar =
                this.calendarRepository()
                    .calendarOfId(
                            tenant,
                            new CalendarId(aCalendarId));

        CalendarEntry calendarEntry =
                calendar.scheduleCalendarEntry(
                    this.calendarIdentityService(),
                    aDescription,
                    aLocation,
                    this.collaboratorService().ownerFrom(tenant, anOwnerId),
                    new TimeSpan(aTimeSpanBegins, aTimeSpanEnds),
View Full Code Here

            String aCalendarId,
            Set<String> aParticipantsToSharedWith) {

        Tenant tenant = new Tenant(aTenantId);

        Calendar calendar =
                this.calendarRepository()
                    .calendarOfId(
                            tenant,
                            new CalendarId(aCalendarId));

        for (CalendarSharer sharer : this.sharersFrom(tenant, aParticipantsToSharedWith)) {
            calendar.shareCalendarWith(sharer);
        }

        this.calendarRepository().save(calendar);
    }
View Full Code Here

            String aCalendarId,
            Set<String> aParticipantsToUnsharedWith) {

        Tenant tenant = new Tenant(aTenantId);

        Calendar calendar =
                this.calendarRepository()
                    .calendarOfId(
                            tenant,
                            new CalendarId(aCalendarId));

        for (CalendarSharer sharer : this.sharersFrom(tenant, aParticipantsToUnsharedWith)) {
            calendar.unshareCalendarWith(sharer);
        }

        this.calendarRepository().save(calendar);
    }
View Full Code Here

        EventStreamId eventId = new EventStreamId(aTenant.id(), aCalendarId.id());

        EventStream eventStream = this.eventStore().eventStreamSince(eventId);

        Calendar calendar = new Calendar(eventStream.events(), eventStream.version());

        return calendar;
    }
View Full Code Here

    protected Calendar calendarAggregate() {

        Tenant tenant = new Tenant("01234567");

        Calendar calendar =
            new Calendar(
                    tenant,
                    DomainRegistry.calendarRepository().nextIdentity(),
                    "John Doe's Calendar",
                    "John Doe's everyday work calendar.",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
View Full Code Here

        return calendar;
    }

    protected CalendarEntry calendarEntryAggregate() {

        Calendar calendar = this.calendarAggregate();

        DomainRegistry.calendarRepository().save(calendar);

        CalendarEntry calendarEntry =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "A Doctor Checkup.",
                    "Family Practice Offices",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
                    this.tomorrowOneHourTimeSpan(),
View Full Code Here

        return calendarEntry;
    }

    protected CalendarEntry[] calendarEntryAggregates() {

        Calendar calendar = this.calendarAggregate();

        DomainRegistry.calendarRepository().save(calendar);

        Set<Participant> invitees = new TreeSet<Participant>();
        invitees.add(new Participant("zoe", "Zoe Doe", "zoe@saasovation.com"));

        CalendarEntry calendarEntry1 =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "A Doctor Checkup",
                    "Family Practice Offices",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
                    this.daysFromNowOneHourTimeSpan(1),
                    Repetition.doesNotRepeatInstance(new Date()),
                    this.oneHourBeforeAlarm(),
                    invitees);

        CalendarEntry calendarEntry2 =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "A Break Replacement",
                    "Breaks R Us",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
                    this.daysFromNowOneHourTimeSpan(2),
                    Repetition.doesNotRepeatInstance(new Date()),
                    this.oneHourBeforeAlarm(),
                    invitees);

        CalendarEntry calendarEntry3 =
            calendar.scheduleCalendarEntry(
                    DomainRegistry.calendarIdentityService(),
                    "Dinner with Family",
                    "Burritos Grandes",
                    new Owner("jdoe", "John Doe", "jdoe@saasovation.com"),
                    this.daysFromNowOneHourTimeSpan(3),
View Full Code Here

TOP

Related Classes of com.saasovation.collaboration.domain.model.calendar.Calendar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.