Package net.sf.eBusx.monitor
Class MonitoredObjectReply.Builder
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject.Builder<M>
-
- net.sf.eBus.messages.EMessage.Builder<M,B>
-
- net.sf.eBus.messages.EReplyMessage.Builder<MonitoredObjectReply,MonitoredObjectReply.Builder>
-
- net.sf.eBusx.monitor.MonitoredObjectReply.Builder
-
- Enclosing class:
- MonitoredObjectReply
public static final class MonitoredObjectReply.Builder extends EReplyMessage.Builder<MonitoredObjectReply,MonitoredObjectReply.Builder>
Builder class used to create aMonitoredObjectReply
instance. This class guarantees that reply's message fields are correctly and completely configured before instantiating the reply instance
-
-
Field Summary
-
Fields inherited from class net.sf.eBus.messages.EReplyMessage.Builder
mReplyReason, mReplyStatus
-
Fields inherited from class net.sf.eBus.messages.EMessageObject.Builder
mTargetClass
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MonitoredObjectReply.Builder
appName(java.lang.String name)
Sets application name to given value.protected MonitoredObjectReply
buildImpl()
Returns eBus message instance built from the configured properties.MonitoredObjectReply.Builder
hostName(java.lang.String name)
Sets host name to given value.MonitoredObjectReply.Builder
statuses(PersistentStatusMessage[] statuses)
Sets persistent status array to given value.protected Validator
validate(Validator problems)
Checks if reply status is set.-
Methods inherited from class net.sf.eBus.messages.EReplyMessage.Builder
replyReason, replyStatus
-
Methods inherited from class net.sf.eBus.messages.EMessage.Builder
copy, subject, timestamp, timestamp
-
Methods inherited from class net.sf.eBus.messages.EMessageObject.Builder
build
-
-
-
-
Method Detail
-
buildImpl
protected MonitoredObjectReply buildImpl()
Description copied from class:EMessageObject.Builder
Returns eBus message instance built from the configured properties. Note: the builder configuration wasvalidated
prior to calling this method. The message object may now be constructed.- Specified by:
buildImpl
in classEMessageObject.Builder<MonitoredObjectReply>
- Returns:
- target message class instance.
-
validate
protected Validator validate(Validator problems)
Description copied from class:EReplyMessage.Builder
Checks if reply status is set. Note that the reply reason is not required to be set; it may benull
or an empty string.- Overrides:
validate
in classEReplyMessage.Builder<MonitoredObjectReply,MonitoredObjectReply.Builder>
- Parameters:
problems
- used to check field validity and collect discovered invalid fields.- Returns:
problems
to allow for method chaining.- See Also:
Validator
-
hostName
public MonitoredObjectReply.Builder hostName(java.lang.String name)
Sets host name to given value. This name does not need to be a network host name but any name meaningful to the application and those monitoring it.- Parameters:
name
- host name.- Returns:
this Builder
instance.- Throws:
java.lang.IllegalArgumentException
- ifname
is eithernull
or empty.
-
appName
public MonitoredObjectReply.Builder appName(java.lang.String name)
Sets application name to given value.- Parameters:
name
- application name.- Returns:
this Builder
instance.- Throws:
java.lang.IllegalArgumentException
- ifname
is eithernull
or empty.
-
statuses
public MonitoredObjectReply.Builder statuses(PersistentStatusMessage[] statuses)
Sets persistent status array to given value. Note that given array is copied.- Parameters:
statuses
- persistent status array.- Returns:
this Builder
instance.- Throws:
java.lang.NullPointerException
- ifstatuses
isnull
.
-
-