Package org.apache.juneau.console.views
Record Class RowJobSubmit
java.lang.Object
java.lang.Record
org.apache.juneau.console.views.RowJobSubmit
- Record Components:
action- The submitted action id.targetId- The submitted row id.idempotencyKey- The submitted key value.fields- The submitted fields; empty when the body omitted them.
public record RowJobSubmit(String action, String targetId, String idempotencyKey, JsonMap fields)
extends Record
The action-envelope submit of a row job:
{action, targetId, idempotencyKey, fields}, the shape the
row-action dialog and the job-log card's envelope: "action" both send.
parse(JsonMap) checks the shape; verify(JobKeyLedger, String, String) checks the action, then the
key's recorded binding. The row identity is targetId() plus that binding — never anything in
fields(), which is user-tamperable request data. An endpoint that also carries the row id in its path
should check targetId().equals(pathId) first.
Example:
See Also:
- Since:
- 10.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe HTTP status to answerbindingRefusal()with. -
Constructor Summary
ConstructorsConstructorDescriptionRowJobSubmit(String action, String targetId, String idempotencyKey, JsonMap fields) Creates an instance of aRowJobSubmitrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.static ActionResultThe standard refusal for a failed verify; answer it withREFUSAL_STATUS.final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theidempotencyKeyrecord component.static RowJobSubmitParses the envelope.targetId()Returns the value of thetargetIdrecord component.toString()Returns a string representation of this record class.verify(JobKeyLedger ledger, String expectedAction) Checks the action, then the key's binding to(action, targetId).verify(JobKeyLedger ledger, String expectedAction, String principal) Checks the action, then the key's binding to(action, targetId, principal).
-
Field Details
-
REFUSAL_STATUS
The HTTP status to answerbindingRefusal()with.- See Also:
-
-
Constructor Details
-
RowJobSubmit
Creates an instance of aRowJobSubmitrecord class.- Parameters:
action- the value for theactionrecord componenttargetId- the value for thetargetIdrecord componentidempotencyKey- the value for theidempotencyKeyrecord componentfields- the value for thefieldsrecord component
-
-
Method Details
-
parse
Parses the envelope.- Parameters:
body- The request body.- Returns:
- The submit.
- Throws:
BadRequest- On a non-object body, a blankaction,targetIdoridempotencyKey, or afieldsmember that is not an object. A missingfieldsreads as empty.
-
verify
Checks the action, then the key's binding to(action, targetId).- Parameters:
ledger- The ledger the key was issued from.expectedAction- The action this endpoint performs.- Returns:
- The grant, or empty when the action differs or the key does not verify.
-
verify
public Optional<JobKeyLedger.Grant> verify(JobKeyLedger ledger, String expectedAction, String principal) Checks the action, then the key's binding to(action, targetId, principal).- Parameters:
ledger- The ledger the key was issued from.expectedAction- The action this endpoint performs.principal- The actor, resolved the same way the key endpoint resolved it.- Returns:
- The grant, or empty when the action differs or the key does not verify.
-
bindingRefusal
The standard refusal for a failed verify; answer it withREFUSAL_STATUS.One code and one message for every kind of miss (see
JobKeyLedger).- Returns:
- A new refusal.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
targetId
Returns the value of thetargetIdrecord component.- Returns:
- the value of the
targetIdrecord component
-
idempotencyKey
Returns the value of theidempotencyKeyrecord component.- Returns:
- the value of the
idempotencyKeyrecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-