Package eu.tneitzel.rmg.plugin
Class GenericPrint
- java.lang.Object
-
- eu.tneitzel.rmg.plugin.GenericPrint
-
- All Implemented Interfaces:
IResponseHandler
public class GenericPrint extends Object implements IResponseHandler
GenericPrint is an rmg ResponseHandler plugin that attempts to print all incoming server responses. It compares the incoming object to some known data types and chooses reasonable defaults to visualize them. From remote-method-guesser v5.0.0, GenericPrint is included per default and does not need to be compiled separately. It can be enabled by using the --show-response option.- Author:
- Tobias Neitzel (@qtc_de)
-
-
Constructor Summary
Constructors Constructor Description GenericPrint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleArray(Object o)For each item within an array, call the handleResponse function.voidhandleByte(byte o)Byte objects are converted to hex and printed.voidhandleCollection(Object o)For each item within an collection, call handleResponse on the corresponding item value.voidhandleDefault(Object o)The default action for each object is to print it using it's toString method.voidhandleFile(File o)For File objects, print their absolute path.voidhandleMap(Object o)For each entry within a map, handleResponse is called on the entry key and value.voidhandleRemote(Remote o)For all objects that extend Remote, the details of the remote reference are printed.voidhandleResponse(Object responseObject)The handleResponse function is called with the incoming responseObject from the RMI server.
-
-
-
Method Detail
-
handleResponse
public void handleResponse(Object responseObject)
The handleResponse function is called with the incoming responseObject from the RMI server. Depending on the corresponding class, a different print action is chosen.- Specified by:
handleResponsein interfaceIResponseHandler- Parameters:
responseObject- Incoming object from an RMI server response
-
handleCollection
public void handleCollection(Object o)
For each item within an collection, call handleResponse on the corresponding item value.- Parameters:
o- Object of the Collection type
-
handleMap
public void handleMap(Object o)
For each entry within a map, handleResponse is called on the entry key and value. Furthermore, an arrow is printed in an attempt to visualize their relationship.- Parameters:
o- Object of the Map type
-
handleArray
public void handleArray(Object o)
For each item within an array, call the handleResponse function.- Parameters:
o- Object of the Array type
-
handleRemote
public void handleRemote(Remote o)
For all objects that extend Remote, the details of the remote reference are printed. This includes the class name, the remote TCP endpoint, the assigned ObjID and the configured socket factories.- Parameters:
o- Object that extends the Remote type
-
handleFile
public void handleFile(File o)
For File objects, print their absolute path.- Parameters:
o- File object
-
handleByte
public void handleByte(byte o)
Byte objects are converted to hex and printed. As a single byte is most likely part of a sequence, we print without a newline.- Parameters:
o- File object
-
handleDefault
public void handleDefault(Object o)
The default action for each object is to print it using it's toString method.- Parameters:
o- Object that did not matched one of the previously mentioned types.
-
-