@Generated(value="OracleSDKGenerator", comments="API Version: 20181116") public final class AccessRule extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
A content access rule. An access rule specifies an action to take if a set of criteria is matched
by a request.
Note: Objects should always be created or deserialized using the AccessRule.Builder
. This model
distinguishes fields that are null
because they are unset from fields that are explicitly
set to null
. This is done in the setter methods of the AccessRule.Builder
, which maintain a
set of all explicitly set fields called AccessRule.Builder.__explicitlySet__
. The hashCode()
and equals(Object)
methods are implemented to take the explicitly set
fields into account. The constructor, on the other hand, does not take the explicitly set fields
into account (since the constructor cannot distinguish explicit null
from unset null
).
Modifier and Type | Class and Description |
---|---|
static class |
AccessRule.Action
The action to take when the access criteria are met for a rule.
|
static class |
AccessRule.BlockAction
The method used to block requests if
action is set to BLOCK and the access
criteria are met. |
static class |
AccessRule.Builder |
static class |
AccessRule.BypassChallenges |
static class |
AccessRule.RedirectResponseCode
The response status code to return when
action is set to REDIRECT . |
EXPLICITLY_SET_FILTER_NAME, EXPLICITLY_SET_PROPERTY_NAME
Constructor and Description |
---|
AccessRule(String name,
List<AccessRuleCriteria> criteria,
AccessRule.Action action,
AccessRule.BlockAction blockAction,
Integer blockResponseCode,
String blockErrorPageMessage,
String blockErrorPageCode,
String blockErrorPageDescription,
List<AccessRule.BypassChallenges> bypassChallenges,
String redirectUrl,
AccessRule.RedirectResponseCode redirectResponseCode,
String captchaTitle,
String captchaHeader,
String captchaFooter,
String captchaSubmitLabel,
List<HeaderManipulationAction> responseHeaderManipulation)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static AccessRule.Builder |
builder()
Create a new builder.
|
boolean |
equals(Object o) |
AccessRule.Action |
getAction()
The action to take when the access criteria are met for a rule.
|
AccessRule.BlockAction |
getBlockAction()
The method used to block requests if
action is set to BLOCK and the access
criteria are met. |
String |
getBlockErrorPageCode()
The error code to show on the error page when
action is set to BLOCK , blockAction is set to SHOW_ERROR_PAGE , and the access criteria are met. |
String |
getBlockErrorPageDescription()
The description text to show on the error page when
action is set to BLOCK ,
blockAction is set to SHOW_ERROR_PAGE , and the access criteria are met. |
String |
getBlockErrorPageMessage()
The message to show on the error page when
action is set to BLOCK , blockAction is set to SHOW_ERROR_PAGE , and the access criteria are met. |
Integer |
getBlockResponseCode()
The response status code to return when
action is set to BLOCK , blockAction is set to SET_RESPONSE_CODE , and the access criteria are met. |
List<AccessRule.BypassChallenges> |
getBypassChallenges()
The list of challenges to bypass when
action is set to BYPASS . |
String |
getCaptchaFooter()
The text to show in the footer when showing a CAPTCHA challenge when
action is set to
SHOW_CAPTCHA and the request is challenged. |
String |
getCaptchaHeader()
The text to show in the header when showing a CAPTCHA challenge when
action is set to
SHOW_CAPTCHA and the request is challenged. |
String |
getCaptchaSubmitLabel()
The text to show on the label of the CAPTCHA challenge submit button when
action is
set to SHOW_CAPTCHA and the request is challenged. |
String |
getCaptchaTitle()
The title used when showing a CAPTCHA challenge when
action is set to SHOW_CAPTCHA and the request is challenged. |
List<AccessRuleCriteria> |
getCriteria()
The list of access rule criteria.
|
String |
getName()
The unique name of the access rule.
|
AccessRule.RedirectResponseCode |
getRedirectResponseCode()
The response status code to return when
action is set to REDIRECT . |
String |
getRedirectUrl()
The target to which the request should be redirected, represented as a URI reference.
|
List<HeaderManipulationAction> |
getResponseHeaderManipulation()
An object that represents an action to apply to an HTTP response headers if all rule criteria
will be matched regardless of
action value. |
int |
hashCode() |
AccessRule.Builder |
toBuilder() |
String |
toString() |
String |
toString(boolean includeByteArrayContents)
Return a string representation of the object.
|
markPropertyAsExplicitlySet, wasPropertyExplicitlySet
@Deprecated @ConstructorProperties(value={"name","criteria","action","blockAction","blockResponseCode","blockErrorPageMessage","blockErrorPageCode","blockErrorPageDescription","bypassChallenges","redirectUrl","redirectResponseCode","captchaTitle","captchaHeader","captchaFooter","captchaSubmitLabel","responseHeaderManipulation"}) public AccessRule(String name, List<AccessRuleCriteria> criteria, AccessRule.Action action, AccessRule.BlockAction blockAction, Integer blockResponseCode, String blockErrorPageMessage, String blockErrorPageCode, String blockErrorPageDescription, List<AccessRule.BypassChallenges> bypassChallenges, String redirectUrl, AccessRule.RedirectResponseCode redirectResponseCode, String captchaTitle, String captchaHeader, String captchaFooter, String captchaSubmitLabel, List<HeaderManipulationAction> responseHeaderManipulation)
public static AccessRule.Builder builder()
Create a new builder.
public AccessRule.Builder toBuilder()
public String getName()
The unique name of the access rule.
public List<AccessRuleCriteria> getCriteria()
The list of access rule criteria. The rule would be applied only for the requests that matched all the listed conditions.
public AccessRule.Action getAction()
The action to take when the access criteria are met for a rule. If unspecified, defaults to
ALLOW
.
- **ALLOW:** Takes no action, just logs the request.
- **DETECT:** Takes no action, but creates an alert for the request.
- **BLOCK:** Blocks the request by returning specified response code or showing error page.
- **BYPASS:** Bypasses some or all challenges.
- **REDIRECT:** Redirects the request to the specified URL. These fields are required when
REDIRECT
is selected: redirectUrl
, redirectResponseCode
.
- **SHOW_CAPTCHA:** Show a CAPTCHA Challenge page instead of the requested page.
Regardless of action, no further rules are processed once a rule is matched.
public AccessRule.BlockAction getBlockAction()
The method used to block requests if action
is set to BLOCK
and the access
criteria are met. If unspecified, defaults to SET_RESPONSE_CODE
.
public Integer getBlockResponseCode()
The response status code to return when action
is set to BLOCK
, blockAction
is set to SET_RESPONSE_CODE
, and the access criteria are met. If
unspecified, defaults to 403
. The list of available response codes: 200
,
201
, 202
, 204
, 206
, 300
, 301
, 302
,
303
, 304
, 307
, 400
, 401
, 403
, 404
,
405
, 408
, 409
, 411
, 412
, 413
, 414
,
415
, 416
, 422
, 444
, 494
, 495
, 496
,
497
, 499
, 500
, 501
, 502
, 503
, 504
,
507
.
public String getBlockErrorPageMessage()
The message to show on the error page when action
is set to BLOCK
, blockAction
is set to SHOW_ERROR_PAGE
, and the access criteria are met. If
unspecified, defaults to ‘Access to the website is blocked.’
public String getBlockErrorPageCode()
The error code to show on the error page when action
is set to BLOCK
, blockAction
is set to SHOW_ERROR_PAGE
, and the access criteria are met. If
unspecified, defaults to ‘Access rules’.
public String getBlockErrorPageDescription()
The description text to show on the error page when action
is set to BLOCK
,
blockAction
is set to SHOW_ERROR_PAGE
, and the access criteria are met. If
unspecified, defaults to ‘Access blocked by website owner. Please contact support.’
public List<AccessRule.BypassChallenges> getBypassChallenges()
The list of challenges to bypass when action
is set to BYPASS
. If unspecified
or empty, all challenges are bypassed.
- **JS_CHALLENGE:** Bypasses JavaScript Challenge.
- **DEVICE_FINGERPRINT_CHALLENGE:** Bypasses Device Fingerprint Challenge.
- **HUMAN_INTERACTION_CHALLENGE:** Bypasses Human Interaction Challenge.
- **CAPTCHA:** Bypasses CAPTCHA Challenge.
public String getRedirectUrl()
The target to which the request should be redirected, represented as a URI reference.
Required when action
is REDIRECT
.
public AccessRule.RedirectResponseCode getRedirectResponseCode()
The response status code to return when action
is set to REDIRECT
.
- **MOVED_PERMANENTLY:** Used for designating the permanent movement of a page (numerical code - 301).
- **FOUND:** Used for designating the temporary movement of a page (numerical code - 302).
public String getCaptchaTitle()
The title used when showing a CAPTCHA challenge when action
is set to SHOW_CAPTCHA
and the request is challenged.
public String getCaptchaHeader()
The text to show in the header when showing a CAPTCHA challenge when action
is set to
SHOW_CAPTCHA
and the request is challenged.
public String getCaptchaFooter()
The text to show in the footer when showing a CAPTCHA challenge when action
is set to
SHOW_CAPTCHA
and the request is challenged.
public String getCaptchaSubmitLabel()
The text to show on the label of the CAPTCHA challenge submit button when action
is
set to SHOW_CAPTCHA
and the request is challenged.
public List<HeaderManipulationAction> getResponseHeaderManipulation()
An object that represents an action to apply to an HTTP response headers if all rule criteria
will be matched regardless of action
value.
public String toString()
toString
in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.
includeByteArrayContents
- true to include the full contents of byte arrayspublic boolean equals(Object o)
equals
in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
public int hashCode()
hashCode
in class com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
Copyright © 2016–2024. All rights reserved.