@@ -0,0 +1,1710 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage de.hsbo.fbg.sm4c.mining.encode;%0A%0Aimport de.hsbo.fbg.sm4c.mining.model.FacebookMessage;%0Aimport de.hsbo.fbg.sm4c.mining.model.FacebookSource;%0Aimport facebook4j.Facebook;%0Aimport facebook4j.FacebookFactory;%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.bson.Document;%0Aimport org.joda.time.DateTime;%0A%0A/**%0A * Class for decoding Faceook messages%0A *%0A * @author Sebastian Drost%0A */%0Apublic class FacebookDecoder %7B%0A%0A    private static final Logger LOGGER = LogManager.getLogger(FacebookDecoder.class);%0A%0A    private Facebook facebook;%0A%0A    public FacebookDecoder() %7B%0A        facebook = new FacebookFactory().getInstance();%0A    %7D%0A%0A    /**%0A     * Decodes a MongoDB document to a a FacebookMessage%0A     * @param doc MongoDB document%0A     * @return decoded FacebookMessage%0A     */%0A    public FacebookMessage decodeFacebookMessage(Document doc) %7B%0A        FacebookMessage message = new FacebookMessage();%0A        message.setId(doc.getString(%22messageId%22));%0A        message.setContent(doc.getString(%22content%22));%0A        message.setLabel(doc.getString(%22label%22));%0A        FacebookSource source = new FacebookSource();%0A        Document sourceDoc = (Document) doc.get(%22source%22);%0A        source.setId(sourceDoc.getString(%22sourceId%22));%0A        source.setName(sourceDoc.getString(%22sourceName%22));%0A        source.setType(sourceDoc.getString(%22sourceType%22));%0A        message.setSource(source);%0A        message.setCreationTime(new DateTime(doc.getDate(%22timeStamp%22)));%0A        return message;%0A    %7D%0A%7D%0A

implement decoding