Search in sources :

Example 6 with MultiRepository

use of org.eclipse.winery.repository.filebased.MultiRepository 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

MultiRepository (org.eclipse.winery.repository.filebased.MultiRepository)6 GitBasedRepository (org.eclipse.winery.repository.backend.filebased.GitBasedRepository)5 IOException (java.io.IOException)2 IRepository (org.eclipse.winery.repository.backend.IRepository)2 TenantRepository (org.eclipse.winery.repository.filebased.TenantRepository)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 OnMessage (javax.websocket.OnMessage)1 DELETE (javax.ws.rs.DELETE)1 Path (javax.ws.rs.Path)1 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)1 WineryVersion (org.eclipse.winery.common.version.WineryVersion)1 AbstractFileBasedRepository (org.eclipse.winery.repository.backend.filebased.AbstractFileBasedRepository)1 RepositoryProperties (org.eclipse.winery.repository.backend.filebased.RepositoryProperties)1 MultiRepositoryManager (org.eclipse.winery.repository.filebased.MultiRepositoryManager)1 GitData (org.eclipse.winery.repository.rest.datatypes.GitData)1 GitWebSocket (org.eclipse.winery.repository.rest.websockets.GitWebSocket)1