Search in sources :

Example 11 with SerializerEngine

use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.

the class TreatedBuildTracking method serialize.

public void serialize() {
    SerializedData data = new SerializedData(this.serializeAsList(), this.serializeAsJson());
    List<SerializedData> allData = new ArrayList<>();
    allData.add(data);
    for (SerializerEngine engine : this.getEngines()) {
        engine.serialize(allData, this.getType());
    }
}
Also used : ArrayList(java.util.ArrayList) SerializedData(fr.inria.spirals.repairnator.serializer.engines.SerializedData) SerializerEngine(fr.inria.spirals.repairnator.serializer.engines.SerializerEngine)

Example 12 with SerializerEngine

use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.

the class Launcher method initSerializerEngines.

private void initSerializerEngines() {
    this.engines = new ArrayList<>();
    SerializerEngine spreadsheetSerializerEngine = LauncherUtils.initSpreadsheetSerializerEngineWithFileSecret(LOGGER);
    if (spreadsheetSerializerEngine != null) {
        this.engines.add(spreadsheetSerializerEngine);
        try {
            ManageGoogleAccessToken manageGoogleAccessToken = ManageGoogleAccessToken.getInstance();
            Credential credential = manageGoogleAccessToken.getCredential();
            if (credential != null) {
                this.config.setGoogleAccessToken(credential.getAccessToken());
            }
        } catch (IOException | GeneralSecurityException e) {
            LOGGER.error("Error while initializing Google Spreadsheet, no information will be serialized in spreadsheets from the pipeline.", e);
        }
    }
    List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER);
    this.engines.addAll(fileSerializerEngines);
    SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER);
    if (mongoDBSerializerEngine != null) {
        this.engines.add(mongoDBSerializerEngine);
    }
}
Also used : Credential(com.google.api.client.auth.oauth2.Credential) GeneralSecurityException(java.security.GeneralSecurityException) SerializerEngine(fr.inria.spirals.repairnator.serializer.engines.SerializerEngine) IOException(java.io.IOException) ManageGoogleAccessToken(fr.inria.spirals.repairnator.serializer.gspreadsheet.ManageGoogleAccessToken)

Example 13 with SerializerEngine

use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.

the class InspectorTimeSerializer method serializeData.

@Override
public void serializeData(ProjectInspector inspector) {
    SerializedData data = new SerializedData(this.serializeAsList(inspector), this.serializeAsJson(inspector));
    List<SerializedData> allData = new ArrayList<>();
    allData.add(data);
    for (SerializerEngine engine : this.getEngines()) {
        engine.serialize(allData, this.getType());
    }
}
Also used : ArrayList(java.util.ArrayList) SerializedData(fr.inria.spirals.repairnator.serializer.engines.SerializedData) SerializerEngine(fr.inria.spirals.repairnator.serializer.engines.SerializerEngine) MongoDBSerializerEngine(fr.inria.spirals.repairnator.serializer.engines.json.MongoDBSerializerEngine)

Example 14 with SerializerEngine

use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.

the class EndProcessSerializer method serialize.

public void serialize() {
    SerializedData data = new SerializedData(this.serializeAsList(), this.serializeAsJson());
    List<SerializedData> allData = new ArrayList<>();
    allData.add(data);
    for (SerializerEngine engine : this.getEngines()) {
        engine.serialize(allData, this.getType());
    }
}
Also used : ArrayList(java.util.ArrayList) SerializedData(fr.inria.spirals.repairnator.serializer.engines.SerializedData) SerializerEngine(fr.inria.spirals.repairnator.serializer.engines.SerializerEngine)

Example 15 with SerializerEngine

use of fr.inria.spirals.repairnator.serializer.engines.SerializerEngine in project repairnator by Spirals-Team.

the class Launcher method initSerializerEngines.

private void initSerializerEngines() {
    this.engines = new ArrayList<>();
    SerializerEngine spreadsheetSerializerEngine = LauncherUtils.initSpreadsheetSerializerEngineWithAccessToken(LOGGER);
    if (spreadsheetSerializerEngine != null) {
        this.engines.add(spreadsheetSerializerEngine);
    }
    List<SerializerEngine> fileSerializerEngines = LauncherUtils.initFileSerializerEngines(LOGGER);
    this.engines.addAll(fileSerializerEngines);
    SerializerEngine mongoDBSerializerEngine = LauncherUtils.initMongoDBSerializerEngine(LOGGER);
    if (mongoDBSerializerEngine != null) {
        this.engines.add(mongoDBSerializerEngine);
    }
}
Also used : SerializerEngine(fr.inria.spirals.repairnator.serializer.engines.SerializerEngine)

Aggregations

SerializerEngine (fr.inria.spirals.repairnator.serializer.engines.SerializerEngine)28 ArrayList (java.util.ArrayList)24 SerializedData (fr.inria.spirals.repairnator.serializer.engines.SerializedData)23 BuildToBeInspected (fr.inria.spirals.repairnator.BuildToBeInspected)8 RepairnatorConfig (fr.inria.spirals.repairnator.config.RepairnatorConfig)8 Build (fr.inria.jtravis.entities.Build)7 AbstractNotifier (fr.inria.spirals.repairnator.notifier.AbstractNotifier)7 AbstractDataSerializer (fr.inria.spirals.repairnator.serializer.AbstractDataSerializer)7 MongoDBSerializerEngine (fr.inria.spirals.repairnator.serializer.engines.json.MongoDBSerializerEngine)7 File (java.io.File)7 Path (java.nio.file.Path)7 Test (org.junit.Test)7 NotifierEngine (fr.inria.spirals.repairnator.notifier.engines.NotifierEngine)5 InspectorSerializer (fr.inria.spirals.repairnator.serializer.InspectorSerializer)5 NopolSerializer (fr.inria.spirals.repairnator.serializer.NopolSerializer)5 Git (org.eclipse.jgit.api.Git)5 RevCommit (org.eclipse.jgit.revwalk.RevCommit)5 JsonObject (com.google.gson.JsonObject)4 Date (java.util.Date)4 PatchNotifier (fr.inria.spirals.repairnator.notifier.PatchNotifier)3