Record Class AgentStatus
java.lang.Object
java.lang.Record
io.github.chkrishnatej.rp3200.health.AgentStatus
- Record Components:
ok- alwaystruewhen the agent answeredversion- agent version, e.g."0.1.0"os-"windows","linux"or"darwin"hostname- the PC's computer name - identifies the tillstartedAt- when the agent (service) last starteduptimeSeconds- seconds sincestartedAtprinter- printer the agent prints to, e.g."TVS RP3200"printerState- one ofready, disconnected, offline, paused, paper-out, error, not-found, unknown; seeprinterReady()printerReady-trueonly whenprinterStateis"ready"printerError- human-readable reason when not ready, otherwise nullqueuedJobs- jobs waiting in the OS print queue (stuck jobs point to a problem)jobsPrinted- jobs printed successfully since the agent startedjobsFailed- jobs that failed since the agent startedlastJobAt- time of the last job, or nulllastError- message of the last failed job, or nulllastErrorAt- time of the last failed job, or nullallowedOrigins- web origins the agent accepts
public record AgentStatus(boolean ok, String version, String os, String hostname, Instant startedAt, long uptimeSeconds, String printer, String printerState, boolean printerReady, String printerError, int queuedJobs, long jobsPrinted, long jobsFailed, Instant lastJobAt, String lastError, Instant lastErrorAt, List<String> allowedOrigins)
extends Record
The health of one shop PC's print agent, as returned by the agent's
GET /status
endpoint and forwarded to your server by rp3200-print.js.
Field names match the agent's JSON exactly, so Jackson (Spring Boot's default) binds it without configuration. New fields may be added in later agent versions; Spring Boot ignores unknown JSON properties by default.
-
Constructor Summary
ConstructorsConstructorDescriptionAgentStatus(boolean ok, String version, String os, String hostname, Instant startedAt, long uptimeSeconds, String printer, String printerState, boolean printerReady, String printerError, int queuedJobs, long jobsPrinted, long jobsFailed, Instant lastJobAt, String lastError, Instant lastErrorAt, List<String> allowedOrigins) Creates an instance of aAgentStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedOriginsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.hostname()Returns the value of thehostnamerecord component.longReturns the value of thejobsFailedrecord component.longReturns the value of thejobsPrintedrecord component.Returns the value of thelastErrorrecord component.Returns the value of thelastErrorAtrecord component.Returns the value of thelastJobAtrecord component.booleanok()Returns the value of theokrecord component.os()Returns the value of theosrecord component.printer()Returns the value of theprinterrecord component.Returns the value of theprinterErrorrecord component.booleanReturns the value of theprinterReadyrecord component.Returns the value of theprinterStaterecord component.intReturns the value of thequeuedJobsrecord component.Returns the value of thestartedAtrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theuptimeSecondsrecord component.version()Returns the value of theversionrecord component.
-
Constructor Details
-
AgentStatus
public AgentStatus(boolean ok, String version, String os, String hostname, Instant startedAt, long uptimeSeconds, String printer, String printerState, boolean printerReady, String printerError, int queuedJobs, long jobsPrinted, long jobsFailed, Instant lastJobAt, String lastError, Instant lastErrorAt, List<String> allowedOrigins) Creates an instance of aAgentStatusrecord class.- Parameters:
ok- the value for theokrecord componentversion- the value for theversionrecord componentos- the value for theosrecord componenthostname- the value for thehostnamerecord componentstartedAt- the value for thestartedAtrecord componentuptimeSeconds- the value for theuptimeSecondsrecord componentprinter- the value for theprinterrecord componentprinterState- the value for theprinterStaterecord componentprinterReady- the value for theprinterReadyrecord componentprinterError- the value for theprinterErrorrecord componentqueuedJobs- the value for thequeuedJobsrecord componentjobsPrinted- the value for thejobsPrintedrecord componentjobsFailed- the value for thejobsFailedrecord componentlastJobAt- the value for thelastJobAtrecord componentlastError- the value for thelastErrorrecord componentlastErrorAt- the value for thelastErrorAtrecord componentallowedOrigins- the value for theallowedOriginsrecord component
-
-
Method Details
-
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
public final int 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ok
public boolean ok()Returns the value of theokrecord component.- Returns:
- the value of the
okrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
os
Returns the value of theosrecord component.- Returns:
- the value of the
osrecord component
-
hostname
Returns the value of thehostnamerecord component.- Returns:
- the value of the
hostnamerecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
uptimeSeconds
public long uptimeSeconds()Returns the value of theuptimeSecondsrecord component.- Returns:
- the value of the
uptimeSecondsrecord component
-
printer
Returns the value of theprinterrecord component.- Returns:
- the value of the
printerrecord component
-
printerState
Returns the value of theprinterStaterecord component.- Returns:
- the value of the
printerStaterecord component
-
printerReady
public boolean printerReady()Returns the value of theprinterReadyrecord component.- Returns:
- the value of the
printerReadyrecord component
-
printerError
Returns the value of theprinterErrorrecord component.- Returns:
- the value of the
printerErrorrecord component
-
queuedJobs
public int queuedJobs()Returns the value of thequeuedJobsrecord component.- Returns:
- the value of the
queuedJobsrecord component
-
jobsPrinted
public long jobsPrinted()Returns the value of thejobsPrintedrecord component.- Returns:
- the value of the
jobsPrintedrecord component
-
jobsFailed
public long jobsFailed()Returns the value of thejobsFailedrecord component.- Returns:
- the value of the
jobsFailedrecord component
-
lastJobAt
Returns the value of thelastJobAtrecord component.- Returns:
- the value of the
lastJobAtrecord component
-
lastError
Returns the value of thelastErrorrecord component.- Returns:
- the value of the
lastErrorrecord component
-
lastErrorAt
Returns the value of thelastErrorAtrecord component.- Returns:
- the value of the
lastErrorAtrecord component
-
allowedOrigins
Returns the value of theallowedOriginsrecord component.- Returns:
- the value of the
allowedOriginsrecord component
-