Fluent builder for a FraudContext, the description of the operation a fraud rule is asked to score. Obtained from fraudManager.newContextBuilder. Only the two values every rule needs are required - the context type naming the operation, and the account it belongs to - with the profile, IP address, user agent, subject and any custom attributes optional. Call build to produce the immutable context.

Group: Builders


Methods

contextType(FraudContextType contextType) · contextTypeName(String contextTypeName) · adminOrg(Organisation adminOrg) · website(Website website) · profile(Profile profile) · ipAddress(String ipAddress) · userAgent(String userAgent) · subject(String subjectType, Long subjectId) · attribute(String name, Object value) · build()

contextType(FraudContextType contextType)

Returns: Builder

Set which operation is being scored.

ParameterDescription
contextTypewhich operation is being scored. Must not be null

contextTypeName(String contextTypeName)

Returns: Builder

Set the context type by name, for script callers who have a string.

ParameterDescription
contextTypeNameone of the FraudContextType names. Must not be blank

adminOrg(Organisation adminOrg)

Returns: Builder

Set the account the operation belongs to.

ParameterDescription
adminOrgthe account the operation belongs to. Must not be null

website(Website website)

Returns: Builder

Set the website the operation happened on.

ParameterDescription
websitethe website the operation happened on, or null

profile(Profile profile)

Returns: Builder

Set the profile the operation is for.

ParameterDescription
profilethe profile the operation is for, or null for a signup

ipAddress(String ipAddress)

Returns: Builder

Set the client IP the operation came from.

ParameterDescription
ipAddressthe client IP, or null if unknown

userAgent(String userAgent)

Returns: Builder

Set the client's user agent header.

ParameterDescription
userAgentthe client's user agent header, or null

subject(String subjectType, Long subjectId)

Returns: Builder

Set what the operation's subject is and its persisted id.

ParameterDescription
subjectTypewhat the subject is, eg "cart". May be null
subjectIdthe subject's id. May be null when the subject is not persisted yet

attribute(String name, Object value)

Returns: Builder

Set one context-specific attribute.

ParameterDescription
namethe attribute name. Must not be blank
valuethe attribute value. May be null, in which case nothing is set

build()

Returns: FraudContext

Build the context from the values set so far.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.