Search in sources :

Example 1 with BeConnectionProfiles

use of com.developmentontheedge.be5.metadata.model.BeConnectionProfiles in project be5 by DevelopmentOnTheEdge.

the class Serialization method reloadConnectionProfiles.

public static BeConnectionProfiles reloadConnectionProfiles(final Path file, final BeConnectionProfileType type, final BeConnectionProfilesRoot target) throws ReadException {
    checkProject(target.getProject());
    turnOffAutomaticSerialization();
    try {
        return new YamlDeserializer(new LoadContext()).reloadConnectionProfiles(file, type, target);
    } finally {
        turnOnAutomaticSerialization();
    }
}
Also used : YamlDeserializer(com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)

Example 2 with BeConnectionProfiles

use of com.developmentontheedge.be5.metadata.model.BeConnectionProfiles in project be5 by DevelopmentOnTheEdge.

the class YamlDeserializer method readConnectionProfiles.

private void readConnectionProfiles(BeConnectionProfileType type, BeConnectionProfilesRoot target) throws ReadException {
    Path connectionProfilesFile = getFileSystem().getConnectionProfilesFile(type);
    if (target.getProject().isModuleProject() && !Files.exists(connectionProfilesFile))
        return;
    if (type == BeConnectionProfileType.LOCAL && !Files.exists(connectionProfilesFile)) {
        target.put(new BeConnectionProfiles(BeConnectionProfileType.LOCAL, target));
        return;
    }
    new ConnectionProfilesDeserializer(connectionProfilesFile, type, target).deserialize();
}
Also used : Path(java.nio.file.Path) DataElementPath(com.developmentontheedge.be5.metadata.model.base.DataElementPath) BeConnectionProfiles(com.developmentontheedge.be5.metadata.model.BeConnectionProfiles)

Example 3 with BeConnectionProfiles

use of com.developmentontheedge.be5.metadata.model.BeConnectionProfiles in project be5 by DevelopmentOnTheEdge.

the class YamlSerializer method serialize.

public void serialize(final BeConnectionProfiles connectionProfiles) throws WriteException {
    this.fileSystem = new ProjectFileSystem(connectionProfiles.getProject());
    new ConnectionProfilesSerializer().serialize(connectionProfiles.getType(), connectionProfiles);
}
Also used : ProjectFileSystem(com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)

Aggregations

BeConnectionProfiles (com.developmentontheedge.be5.metadata.model.BeConnectionProfiles)1 DataElementPath (com.developmentontheedge.be5.metadata.model.base.DataElementPath)1 ProjectFileSystem (com.developmentontheedge.be5.metadata.serialization.ProjectFileSystem)1 YamlDeserializer (com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)1 Path (java.nio.file.Path)1