RegisteredSystems.java 1.21 KB
Newer Older
1
package de.hftstuttgart.unifiedticketing.core;
2

3
import de.hftstuttgart.unifiedticketing.systems.github.GithubTicketSystemBuilder;
4
import de.hftstuttgart.unifiedticketing.systems.gitlab.GitlabTicketSystemBuilder;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * This class is where for each supported system a method is placed, that returns a new Builder instance for it.
 */
public class RegisteredSystems
{
    private static Logger logger = Logging.getLogger(RegisteredSystems.class.getName());

    private static RegisteredSystems instance = null;

    protected RegisteredSystems() { }

    protected static RegisteredSystems getInstance()
    {
        if (instance == null)
        {
            instance = new RegisteredSystems();
            logger.log(Level.FINEST, "Singleton instance created");
        }
        return instance;
    }

30
31
32
33
34
35
36
37
    /**
     * Starts the builder mechanism for a GitHub connection
     */
    public GithubTicketSystemBuilder github()
    {
        return new GithubTicketSystemBuilder();
    }

38
39
40
41
42
43
44
45
    /**
     * Starts the builder mechanism for a GitLab connection
     */
    public GitlabTicketSystemBuilder gitlab()
    {
        return new GitlabTicketSystemBuilder();
    }
}