Package org.silverpeas.core.calendar
Class Attendee
- java.lang.Object
-
- org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity<E,I>
-
- org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity<Attendee,UuidIdentifier>
-
- org.silverpeas.core.calendar.Attendee
-
- All Implemented Interfaces:
Serializable
,Entity<Attendee,UuidIdentifier>
,IdentifiableEntity
- Direct Known Subclasses:
ExternalAttendee
,InternalAttendee
@Entity public abstract class Attendee extends SilverpeasJpaEntity<Attendee,UuidIdentifier>
An attendee is a user that participates in a calendar component that can be an event or anything that can be planned in a calendar. It is uniquely defined by an identifier, for example, an email address so that it can be notified about changes on theCalendarComponent
object or about its attendance. Its participation in aCalendarComponent
is qualified by a status and by its presence requirement.- Author:
- mmoquillon
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Attendee.ParticipationStatus
Predefined participation status of an attendee.static class
Attendee.PresenceStatus
Predefined presence status of an attendee in his participation in a calendar event.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Attendee()
Constructs an empty attendee.protected
Attendee(String id, CalendarComponent component)
Constructs a participant in the specified calendar component.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
accept()
Accepts the attendance.
Calling this method represents an answer action.
CallsetParticipationStatus(ParticipationStatus)
method to modify the status without specifying that is in case of an answer.void
decline()
Declines the attendance.
Calling this method represents an answer action.
CallsetParticipationStatus(ParticipationStatus)
method to modify the status without specifying that is in case of an answer.void
delegateTo(String email)
Delegates the participation of this attendee to another participant.void
delegateTo(User user)
Delegates the participation of this attendee to another participant.CalendarComponent
getCalendarComponent()
Gets the calendar component for which this attendee participates.Optional<Attendee>
getDelegate()
The delegate to whom or from whom the attendance as been delegated.abstract String
getFullName()
Gets the full name of this attendee.String
getId()
The unique identifier of this attendee.Attendee.ParticipationStatus
getParticipationStatus()
The status of the participation of this attendee.Attendee.PresenceStatus
getPresenceStatus()
The status of presence in his participation as it was asked by the calendar event author.void
ifMatches(Predicate<Attendee> filter, Consumer<Attendee> then, Consumer<Attendee> otherwise)
boolean
isAttendeeIn(CalendarComponent component)
Is this attendee participates in the specified calendar component?void
setPresenceStatus(Attendee.PresenceStatus presenceStatus)
Sets a new presence status to this attendee.void
tentativelyAccept()
Tentatively accepts the attendance.
Calling this method represents an answer action.
CallsetParticipationStatus(ParticipationStatus)
method to modify the status without specifying that is in case of an answer.Attendee
withPresenceStatus(Attendee.PresenceStatus presenceStatus)
Sets a new presence status to this attendee.-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity
createdBy, createdBy, createdBy, equals, getCreationDate, getCreator, getCreatorId, getLastUpdateDate, getLastUpdater, getLastUpdaterId, getVersion, hasBeenModified, hashCode, lastUpdatedBy, markAsModified, performBeforePersist, performBeforeRemove, performBeforeUpdate, setCreationDate, setCreator, setLastUpdateDate, setLastUpdater, setVersion, updatedBy, updatedBy
-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity
getNativeId, isPersisted, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.persistence.datasource.model.IdentifiableEntity
isPersisted
-
-
-
-
Constructor Detail
-
Attendee
protected Attendee()
Constructs an empty attendee. This constructor is dedicated to the persistence engine.
-
Attendee
protected Attendee(String id, CalendarComponent component)
Constructs a participant in the specified calendar component.- Parameters:
id
- the unique identifier of the attendee. It can be an address email, an identifier of a user in Silverpeas, or anything from which we can notify him.component
- a calendar component in which the attendee participates.
-
-
Method Detail
-
ifMatches
public void ifMatches(Predicate<Attendee> filter, Consumer<Attendee> then, Consumer<Attendee> otherwise)
-
getId
public String getId()
The unique identifier of this attendee. It can an email address, a unique identifier of a user in Silverpeas, or whatever that can be used to notify the attendee.- Specified by:
getId
in interfaceIdentifiableEntity
- Overrides:
getId
in classAbstractJpaEntity<Attendee,UuidIdentifier>
- Returns:
- the unique identifier of the attendee.
-
getFullName
public abstract String getFullName()
Gets the full name of this attendee. According to the type of the attendee, this can be the actual full name of the user or its email address.- Returns:
- the attendee full name (either its first and last name or its email address)
-
getCalendarComponent
public CalendarComponent getCalendarComponent()
Gets the calendar component for which this attendee participates.- Returns:
- the calendar component in which this attendee participates.
-
getParticipationStatus
public Attendee.ParticipationStatus getParticipationStatus()
The status of the participation of this attendee.- Returns:
- the participation status.
-
isAttendeeIn
public boolean isAttendeeIn(CalendarComponent component)
Is this attendee participates in the specified calendar component?- Parameters:
component
- a calendar component.- Returns:
- true if he participates in the given calendar component, false otherwise.
-
getDelegate
public Optional<Attendee> getDelegate()
The delegate to whom or from whom the attendance as been delegated. If the participation status of this attendee isAttendee.ParticipationStatus.DELEGATED
then this method returns the attendee to whom the delegation has been done. Otherwise, it returns the attendee that has delegated its attendance to this attendee.- Returns:
- optionally the attendee to whom or from whom a delegation has been done. If this attendee isn't concerned by any delegation, then nothing is returned (the optional attendee is empty).
-
delegateTo
public void delegateTo(User user)
Delegates the participation of this attendee to another participant. The delegated is added among the calendar event's attendees.- Parameters:
user
- a user in Silverpeas.
-
delegateTo
public void delegateTo(String email)
Delegates the participation of this attendee to another participant. The delegated is added among the calendar event's attendees.- Parameters:
email
- the email of another attendee. This attendee is expected to be a person external to Silverpeas.
-
accept
public void accept()
Accepts the attendance.
Calling this method represents an answer action.
CallsetParticipationStatus(ParticipationStatus)
method to modify the status without specifying that is in case of an answer.
-
decline
public void decline()
Declines the attendance.
Calling this method represents an answer action.
CallsetParticipationStatus(ParticipationStatus)
method to modify the status without specifying that is in case of an answer.
-
tentativelyAccept
public void tentativelyAccept()
Tentatively accepts the attendance.
Calling this method represents an answer action.
CallsetParticipationStatus(ParticipationStatus)
method to modify the status without specifying that is in case of an answer.
-
getPresenceStatus
public Attendee.PresenceStatus getPresenceStatus()
The status of presence in his participation as it was asked by the calendar event author. If not set, by default, his presence status isAttendee.PresenceStatus.REQUIRED
.- Returns:
- the presence status of this attendee.
-
setPresenceStatus
public void setPresenceStatus(Attendee.PresenceStatus presenceStatus)
Sets a new presence status to this attendee.- Parameters:
presenceStatus
- the status of presence in his participation.
-
withPresenceStatus
public Attendee withPresenceStatus(Attendee.PresenceStatus presenceStatus)
Sets a new presence status to this attendee.- Parameters:
presenceStatus
- the status of presence in his participation.- Returns:
- himself.
-
-