Class EppRequestMessage
- All Implemented Interfaces:
OutboundMessageType
EppMessage
subclass that implements OutboundMessageType
, which represents an
outbound Epp message.
In modifying the getReplacements
field of EppRequestMessage
and the template,
we can represent the the 5 basic EPP commands we are attempting to probe. The original 5 are:
LOGIN, CREATE, CHECK, DELETE, LOGOUT.
In turn, we equivalently create 10 different EPP commands probed: Hello - checks for Greeting response, Login expecting success, Login expecting Failure, Create expecting Success, Create expecting Failure, Check that the domain exists, Check that the domain doesn't exist, Delete expecting Success, Delete expecting Failure, and Logout expecting Success.
The main difference is that we added a hello command that simply waits for the server to send a greeting, then moves on to the Login action.
Stores a clTRID and domainName which is modified each time the token calls
modifyMessage
. These will also modify the EPP request sent to the server.
-
Field Summary
Fields inherited from class google.registry.monitoring.blackbox.message.EppMessage
CLIENT_ID_KEY, CLIENT_PASSWORD_KEY, CLIENT_TRID_KEY, DOMAIN_KEY, HEADER_LENGTH, message, SERVER_TRID_KEY, XFAIL_EXPRESSION, XPASS_EXPRESSION
-
Constructor Summary
ConstructorDescriptionEppRequestMessage
(String name, EppResponseMessage expectedResponse, String template, BiFunction<String, String, Map<String, String>> getReplacements) Private constructor forEppRequestMessage
that its subclasses use for instantiation. -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBuf
bytes()
Converts the currentDocument
message to aByteBuf
with the requisite bytesReturns theEppResponseMessage
we expect.modifyMessage
(String... args) From the inputclTrid
anddomainName
, modifies the template EPP XML document and theexpectedResponse
to reflect new parameters.name()
Necessary to inform metrics collector what kind of message is sent downChannelPipeline
.Necessary to inform metrics collector what kind of message is sent inboundChannelPipeline
.toString()
Returns a String representation using thename()
,responseName()
, andEppMessage.message
(if non-null).Methods inherited from class google.registry.monitoring.blackbox.message.EppMessage
byteArrayToXmlDoc, eppValidate, getElementValue, getElementValue, getEppDocFromTemplate, verifyEppResponse, xmlDocToByteArray, xmlDocToString
-
Constructor Details
-
EppRequestMessage
public EppRequestMessage(String name, EppResponseMessage expectedResponse, String template, BiFunction<String, String, Map<String, String>> getReplacements) Private constructor forEppRequestMessage
that its subclasses use for instantiation.
-
-
Method Details
-
modifyMessage
From the inputclTrid
anddomainName
, modifies the template EPP XML document and theexpectedResponse
to reflect new parameters.- Specified by:
modifyMessage
in interfaceOutboundMessageType
- Parameters:
args
- - should always be two Strings: The first one isclTrid
and the second one isdomainName
.- Returns:
- the current
EppRequestMessage
instance. - Throws:
EppClientException
- - On the occasion that the prober can't appropriately modify the EPP XML document, the blame falls on the prober, not the server, so it throws anEppClientException
, which is a subclass of theUndeterminedStateException
.
-
bytes
Converts the currentDocument
message to aByteBuf
with the requisite bytes- Returns:
- the
ByteBuf
instance that stores the bytes representing the requisite EPP Request - Throws:
EppClientException
- On the occasion that the prober can't appropriately convert the EPP XML document to aByteBuf
, the blame falls on the prober, not the server, so it throws anEppClientException
, which is a subclass of theUndeterminedStateException
.
-
getExpectedResponse
Returns theEppResponseMessage
we expect. -
name
Description copied from interface:OutboundMessageType
Necessary to inform metrics collector what kind of message is sent downChannelPipeline
. Not equivalent to toString, as to different instances will have the same name if they perform the same action.- Specified by:
name
in interfaceOutboundMessageType
-
responseName
Description copied from interface:OutboundMessageType
Necessary to inform metrics collector what kind of message is sent inboundChannelPipeline
. Equivalent toname
but forInboundMessageType
.- Specified by:
responseName
in interfaceOutboundMessageType
-
toString
Returns a String representation using thename()
,responseName()
, andEppMessage.message
(if non-null).This is primarily for parameterized test case usage, which requires a sensible
toString
for the purposes of test method naming.- Overrides:
toString
in classEppMessage
-