Class IAmMessage
java.lang.Object
zleurtor.scanmanager.model.messages.AbstractMessage
zleurtor.scanmanager.model.messages.IAmMessage
- All Implemented Interfaces:
Serializable
The message sent by the slave during the discover process.
- Author:
- Zleurtor
- See Also:
-
Field Summary
Fields inherited from class zleurtor.scanmanager.model.messages.AbstractMessage
DISCOVER, LOGGER, STOP
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty message.IAmMessage
(String theName, String theVersion, String theOptions) Constructs a new "I am" message using the specified name. -
Method Summary
Modifier and TypeMethodDescriptionprotected final AbstractMessage
Set this message values to the ones in the given XML description.final String
getName()
Returns the name of the slave which sent this message.final String
Returns the options used by the slave while taking snapshots or streaming.Returns the version of the slave which sent this message.protected final String
toXml()
Transform this message to an XML description.Methods inherited from class zleurtor.scanmanager.model.messages.AbstractMessage
serialize, unserialize
-
Constructor Details
-
IAmMessage
public IAmMessage()Constructs an empty message. -
IAmMessage
Constructs a new "I am" message using the specified name.- Parameters:
theName
- The name of the slave which sent this message.theVersion
- The version of the slave which sent this message.theOptions
- The options used by the slave while taking snapshots.
-
-
Method Details
-
getName
Returns the name of the slave which sent this message.- Returns:
- The name of the slave which sent this message.
-
getVersion
Returns the version of the slave which sent this message.- Returns:
- The version of the slave which sent this message.
-
getOptions
Returns the options used by the slave while taking snapshots or streaming.- Returns:
- The options used by the slave while taking snapshots or streaming.
-
toXml
protected final String toXml() throws ParserConfigurationException, TransformerFactoryConfigurationError, TransformerException, IOExceptionDescription copied from class:AbstractMessage
Transform this message to an XML description.- Specified by:
toXml
in classAbstractMessage
- Returns:
- An XML describing this message.
- Throws:
ParserConfigurationException
- If a DocumentBuildercannot be created which satisfies the configuration requested.TransformerFactoryConfigurationError
- Thrown in case of service configuration error or ifthe implementation is not available or cannot be instantiated.TransformerException
- When it is not possible to create a Transformer instance or if an unrecoverable error occurs during the course of the transformation.IOException
- If an I/O error occurs.
-
fromXml
protected final AbstractMessage fromXml(String xml) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException Description copied from class:AbstractMessage
Set this message values to the ones in the given XML description.- Specified by:
fromXml
in classAbstractMessage
- Parameters:
xml
- The XML containing the values to set in this message.- Returns:
- This message.
- Throws:
SAXException
- If any parse errors occur.IOException
- If any IO errors occur.ParserConfigurationException
- If a DocumentBuildercannot be created which satisfies the configuration requested.XPathExpressionException
- If an XPath expression cannot be evaluated.
-