Package org.forgerock.android.auth
Class PushNotification.PushNotificationBuilder
- java.lang.Object
-
- org.forgerock.android.auth.PushNotification.PushNotificationBuilder
-
- Enclosing class:
- PushNotification
public static class PushNotification.PushNotificationBuilder extends java.lang.ObjectBuilder class responsible for producing Notifications.
-
-
Constructor Summary
Constructors Constructor Description PushNotificationBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PushNotificationbuild()Build the notification.PushNotification.PushNotificationBuildersetAmlbCookie(java.lang.String amlbCookie)Set the he AM load balance cookie with this notification.PushNotification.PushNotificationBuildersetApproved(boolean approved)Sets whether the authentication the notification is related to was approved.PushNotification.PushNotificationBuildersetChallenge(java.lang.String challenge)Set the challenge that was sent with this notification.PushNotification.PushNotificationBuildersetContextInfo(java.lang.String contextInfo)Sets context information for this notification.PushNotification.PushNotificationBuildersetCustomPayload(java.lang.String customPayload)Sets custom attributes associated with this notification.PushNotification.PushNotificationBuildersetMechanismUID(java.lang.String mechanismUID)Sets the mechanism unique Id.PushNotification.PushNotificationBuildersetMessage(java.lang.String message)Sets the message that was received with this notification.PushNotification.PushNotificationBuildersetMessageId(java.lang.String messageId)Sets the message id that was received with this notification.PushNotification.PushNotificationBuildersetNumbersChallenge(java.lang.String numbersChallenge)Sets the numbers used in the Push challenge.PushNotification.PushNotificationBuildersetPending(boolean pending)Sets whether the authentication the notification is related to has been handled.PushNotification.PushNotificationBuildersetPushType(java.lang.String pushType)Sets the type of Push notification.PushNotification.PushNotificationBuildersetTimeAdded(java.util.Calendar timeAdded)Sets the date that the notification was received.PushNotification.PushNotificationBuildersetTimeExpired(java.util.Calendar timeExpired)Sets the date that the notification will automatically fail.PushNotification.PushNotificationBuildersetTtl(long ttl)Sets the time to live for the notification.
-
-
-
Method Detail
-
setMechanismUID
public PushNotification.PushNotificationBuilder setMechanismUID(java.lang.String mechanismUID)
Sets the mechanism unique Id.- Parameters:
mechanismUID- the mechanism unique Id.- Returns:
- The current builder.
-
setMessageId
public PushNotification.PushNotificationBuilder setMessageId(java.lang.String messageId)
Sets the message id that was received with this notification.- Parameters:
messageId- The messageId that was received.- Returns:
- The current builder.
-
setMessage
public PushNotification.PushNotificationBuilder setMessage(java.lang.String message)
Sets the message that was received with this notification.- Parameters:
message- The message that was received.- Returns:
- The current builder.
-
setChallenge
public PushNotification.PushNotificationBuilder setChallenge(java.lang.String challenge)
Set the challenge that was sent with this notification.- Parameters:
challenge- The base64 encoded challenge.- Returns:
- The current builder.
-
setAmlbCookie
public PushNotification.PushNotificationBuilder setAmlbCookie(java.lang.String amlbCookie)
Set the he AM load balance cookie with this notification.- Parameters:
amlbCookie- the load balance cookie.- Returns:
- The current builder.
-
setTimeAdded
public PushNotification.PushNotificationBuilder setTimeAdded(java.util.Calendar timeAdded)
Sets the date that the notification was received.- Parameters:
timeAdded- The date received in UTC.- Returns:
- The current builder.
-
setTimeExpired
public PushNotification.PushNotificationBuilder setTimeExpired(java.util.Calendar timeExpired)
Sets the date that the notification will automatically fail.- Parameters:
timeExpired- The expiry date.- Returns:
- The current builder.
-
setTtl
public PushNotification.PushNotificationBuilder setTtl(long ttl)
Sets the time to live for the notification.- Parameters:
ttl- The expiry date.- Returns:
- The current builder.
-
setApproved
public PushNotification.PushNotificationBuilder setApproved(boolean approved)
Sets whether the authentication the notification is related to was approved.- Parameters:
approved- True if the authentication was approved, false otherwise.- Returns:
- The current builder.
-
setPending
public PushNotification.PushNotificationBuilder setPending(boolean pending)
Sets whether the authentication the notification is related to has been handled.- Parameters:
pending- True if the authentication has not been handled, false otherwise.- Returns:
- The current builder.
-
setCustomPayload
public PushNotification.PushNotificationBuilder setCustomPayload(java.lang.String customPayload)
Sets custom attributes associated with this notification.- Parameters:
customPayload- JSON String containing the custom attributes- Returns:
- The current builder.
-
setNumbersChallenge
public PushNotification.PushNotificationBuilder setNumbersChallenge(java.lang.String numbersChallenge)
Sets the numbers used in the Push challenge.- Parameters:
numbersChallenge- String containing the numbers for challenge- Returns:
- The current builder.
-
setContextInfo
public PushNotification.PushNotificationBuilder setContextInfo(java.lang.String contextInfo)
Sets context information for this notification.- Parameters:
contextInfo- JSON String containing the context information.- Returns:
- The current builder.
-
setPushType
public PushNotification.PushNotificationBuilder setPushType(java.lang.String pushType)
Sets the type of Push notification.- Parameters:
pushType- the push type- Returns:
- The current builder.
-
build
protected PushNotification build() throws InvalidNotificationException
Build the notification.- Returns:
- The final notification.
- Throws:
InvalidNotificationException- if timeAdded or mechanismUID are not provided
-
-