Class FileAnswer
java.lang.Object
ch.autumo.beetroot.server.message.AbstractMessage
ch.autumo.beetroot.server.message.ClientAnswer
ch.autumo.beetroot.server.message.file.FileAnswer
File answer: only used when the server received a file from client!
-
Field Summary
Fields inherited from class ClientAnswer
TYPE_ERROR, TYPE_FILE_NOK, TYPE_FILE_OK, TYPE_OKModifier and TypeFieldDescriptionstatic final intAnswer type: error.static final intAnswer type: file transfer failed.static final intAnswer type: file transfer OK.static final intAnswer type: OK.Fields inherited from class AbstractMessage
domain, ENCRYPT, entity, fileId, id, INTERNAL_MSG_PART_SEPARATOR, INTERNAL_MSG_PART_SEPARATOR_REGEXP, LOG, message, MSG_PART_SEPARATOR, MSG_PART_SEPARATOR_REGEXP, object, serverNameModifier and TypeFieldDescriptionprotected StringTransport domain name.protected static final booleanEncrypt client-server-com?protected StringTransport entity name.protected StringTransport file ID.protected longTransport entity ID.static final Stringinternal message part separatorstatic final Stringinternal message part separator regular expressionprotected static final org.slf4j.LoggerLogger.protected StringTransport message.static final Stringmessage part separatorstatic final Stringmessage part separator regular expressionprotected SerializableAdditional transport object.static Stringserver name -
Constructor Summary
ConstructorsConstructorDescriptionFileAnswer(String answer, int type) Fail constructor.FileAnswer(String answer, String fileId) Success constructor. -
Method Summary
Methods inherited from class ClientAnswer
getAnswer, getErrorReason, getJsonTransferString, getTransferString, getType, parse, parseJsonModifier and TypeMethodDescriptionGet answer, possibly holds message parts separated by '|'.Get error reason if any.Get JSON representation; this includes all set information including the additional object if set.Get transfer string; this includes all set information including the additional object is set.intgetType()Get client answer type.static ClientAnswerCreate a new client answer out of transfer string.static ClientAnswerCreate a new client answer out of JSON transfer string.Methods inherited from class AbstractMessage
contains, deserializeObject, getData, getDataLength, getDomain, getEntity, getFileId, getId, getJSONObject, getMessageIntValue, getMessageValue, getObject, serializeObject, setEntity, setObjectModifier and TypeMethodDescriptionbooleanChecks if this key is contained in a paired transport message.protected voiddeserializeObject(String serializedObject) Deserialize this object with FasterXML/Jackson.byte[]getData()Get transfer data; this includes all set information including an object.intGet transfer data length.Get a domain associated with this message or null.Get entity associated with this message or null.File ID if this message is used to transport file information.longgetId()Get entity ID associated with this message or null.org.json.JSONObjectReturn a JSON object or null; null means the object hold by this message represents another object type, but it is always serializable.intgetMessageIntValue(String key) Helper method for accessing paired transport message values.getMessageValue(String key) Helper method for accessing paired transport message values.Get serializable transport object hold by this message or null.protected StringSerialize this object with FasterXML/Jackson.voidSet an entity associated with this message.voidsetObject(Serializable object) Set any serializable object, usually a JSON string is meaningful for transport.
-
Constructor Details
-
FileAnswer
-
FileAnswer
Fail constructor.- Parameters:
answer- answer (reason)type- failure type
-