Package org.silverpeas.components.community.notification.user

## Class MembershipLeaveUserNotificationBuilder

- java.lang.Object
- - org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder
  - - org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder<T>
    - - org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder<CommunityOfUsers>
      - - org.silverpeas.components.community.notification.user.AbstractCommunityUserNotificationBuilder
        - - org.silverpeas.components.community.notification.user.MembershipLeaveUserNotificationBuilder

- All Implemented Interfaces:
    `org.silverpeas.core.notification.user.builder.UserNotificationBuilder`

      public class MembershipLeaveUserNotificationBuilder
      extends AbstractCommunityUserNotificationBuilder

  User notification dedicated to the membership leave.
  Author:
    silveryocha

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder

      `org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder.NotificationTemporal`

  - ### Field Summary

    - ### Fields inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder

      `CUSTOM_NOTIFICATION_SUBJECT, DEFAULT_NOTIFICATION_SUBJECT`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `MembershipLeaveUserNotificationBuilder​(CommunityOfUsers resource)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static MembershipLeaveUserNotificationBuilder` | `about​(CommunityOfUsers community)` | Initializing the user notification builder with given community.
    `MembershipLeaveUserNotificationBuilder` | `andContactInFuture​(boolean contactInFuture)` | Indicates that the member accepts or not to be contacted in the future about its leaving.
    `MembershipLeaveUserNotificationBuilder` | `andMessage​(String message)` | Sets an additional message that allows the member to explain more precisely the reason of its leaving.
    `protected String` | `getBundleSubjectKey()` |
    `protected Collection<String>` | `getGroupIdsToNotify()` |
    `protected String` | `getSender()` |
    `protected String` | `getTemplateFileName()` |
    `protected String` | `getTitle​(String language)` |
    `protected Collection<String>` | `getUserIdsToNotify()` |
    `MembershipLeaveUserNotificationBuilder` | `memberLeavingIs​(org.silverpeas.core.admin.user.model.User leavingMember)` | Indicating the member which is leaving the community.
    `protected void` | `perform​(CommunityOfUsers resource)` |
    `protected void` | `performTemplateData​(String language, CommunityOfUsers resource, org.silverpeas.core.template.SilverpeasTemplate template)` |
    `MembershipLeaveUserNotificationBuilder` | `withReason​(int reason)` | Sets the leaving reason that the member has indicated.

    - ### Methods inherited from class org.silverpeas.components.community.notification.user.AbstractCommunityUserNotificationBuilder

      `getAction, getComponentInstanceId, getContributionAccessLinkLabelBundleKey, getLocalizationBundlePath, getResourceURL, getSpace, getSpaceManagerProfile, getTemplatePath, isSendImmediately, performNotificationResource`

    - ### Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder

      `createNotification, getTitle, performBuild, performNotificationResource, performNotificationResource`

    - ### Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractResourceUserNotificationBuilder

      `getResource, initialize, initializeNotificationResourceData, isGroupCanBeNotified, isUserCanBeNotified, performBuild, setResource`

    - ### Methods inherited from class org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder

      `build, getBundle, getBundle, getContent, getExternalAddressesToNotify, getMessageType, getNotificationMetaData, getUserIdsToExcludeFromNotifying, stop, stopWhenNoUserToNotify`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MembershipLeaveUserNotificationBuilder

          protected MembershipLeaveUserNotificationBuilder​(CommunityOfUsers resource)

  - ### Method Detail

    - #### about

          public static MembershipLeaveUserNotificationBuilder about​(CommunityOfUsers community)

      Initializing the user notification builder with given community.
      Parameters:
        `community` - a `CommunityOfUsers` instance.
      Returns:
        the builder instance itself.

    - #### memberLeavingIs

          public MembershipLeaveUserNotificationBuilder memberLeavingIs​(org.silverpeas.core.admin.user.model.User leavingMember)

      Indicating the member which is leaving the community.
      Parameters:
        `leavingMember` - a `User` instance representing the member leaving the community.
      Returns:
        the builder instance itself.

    - #### withReason

          public MembershipLeaveUserNotificationBuilder withReason​(int reason)

      Sets the leaving reason that the member has indicated.
      Parameters:
        `reason` - an integer representing the index to retrieve the reason label into `CommunityComponentSettings.getLeaveReasons(String)` list.
      Returns:
        the builder instance itself.

    - #### andMessage

          public MembershipLeaveUserNotificationBuilder andMessage​(String message)

      Sets an additional message that allows the member to explain more precisely the reason of its leaving.
      Parameters:
        `message` - a string.
      Returns:
        the builder instance itself.

    - #### andContactInFuture

          public MembershipLeaveUserNotificationBuilder andContactInFuture​(boolean contactInFuture)

      Indicates that the member accepts or not to be contacted in the future about its leaving.
      Parameters:
        `contactInFuture` - a boolean.
      Returns:
        the builder instance itself.

    - #### getBundleSubjectKey

          protected String getBundleSubjectKey()

      Overrides:
        `getBundleSubjectKey` in class `org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder<CommunityOfUsers>`

    - #### getTemplateFileName

          protected String getTemplateFileName()

      Specified by:
        `getTemplateFileName` in class `org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder<CommunityOfUsers>`

    - #### getTitle

          protected String getTitle​(String language)

      Overrides:
        `getTitle` in class `org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder<CommunityOfUsers>`

    - #### getUserIdsToNotify

          protected Collection<String> getUserIdsToNotify()

      Specified by:
        `getUserIdsToNotify` in class `org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder`

    - #### getGroupIdsToNotify

          protected Collection<String> getGroupIdsToNotify()

      Overrides:
        `getGroupIdsToNotify` in class `org.silverpeas.core.notification.user.builder.AbstractUserNotificationBuilder`

    - #### getSender

          protected String getSender()

      Overrides:
        `getSender` in class `AbstractCommunityUserNotificationBuilder`

    - #### perform

          protected void perform​(CommunityOfUsers resource)

      Overrides:
        `perform` in class `org.silverpeas.core.notification.user.builder.AbstractTemplateUserNotificationBuilder<CommunityOfUsers>`

    - #### performTemplateData

          protected void performTemplateData​(String language,
                                             CommunityOfUsers resource,
                                             org.silverpeas.core.template.SilverpeasTemplate template)

      Overrides:
        `performTemplateData` in class `AbstractCommunityUserNotificationBuilder`