Search in sources :

Example 11 with GitBasedRepository

use of org.eclipse.winery.repository.backend.filebased.GitBasedRepository in project winery by eclipse.

the class Prefs method doRepositoryInitialization.

/**
 * Initialization code for the repository. Should go into separate class, but being here should be OK for a
 * prototype
 * <p>
 * Called from both the constructor for JUnit and the servlet-based initialization
 * <p>
 */
private void doRepositoryInitialization() throws Exception {
    RepositoryFactory.reconfigure();
    if (RepositoryFactory.getRepository() instanceof GitBasedRepository) {
        GitWebSocket socket = new GitWebSocket();
        ((GitBasedRepository) RepositoryFactory.getRepository()).registerForEvents(socket);
    } else if (RepositoryFactory.getRepository() instanceof MultiRepository) {
        GitWebSocket socket = new GitWebSocket();
        ((MultiRepository) RepositoryFactory.getRepository()).registerForEvents(socket);
    }
}
Also used : GitWebSocket(org.eclipse.winery.repository.rest.websockets.GitWebSocket) MultiRepository(org.eclipse.winery.repository.filebased.MultiRepository) GitBasedRepository(org.eclipse.winery.repository.backend.filebased.GitBasedRepository)

Aggregations

GitBasedRepository (org.eclipse.winery.repository.backend.filebased.GitBasedRepository)11 IRepository (org.eclipse.winery.repository.backend.IRepository)5 MultiRepository (org.eclipse.winery.repository.filebased.MultiRepository)5 IOException (java.io.IOException)3 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)2 WineryVersion (org.eclipse.winery.common.version.WineryVersion)2 YamlRepository (org.eclipse.winery.repository.yaml.YamlRepository)2 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 URI (java.net.URI)1 Path (java.nio.file.Path)1 LocalDateTime (java.time.LocalDateTime)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 OnMessage (javax.websocket.OnMessage)1 Consumes (javax.ws.rs.Consumes)1 DELETE (javax.ws.rs.DELETE)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1