Search in sources :

Example 1 with FederationSet

use of com.gitblit.models.FederationSet in project gitblit by gitblit.

the class FederationManager method getFederationSets.

/**
	 * Returns the list of federation sets.
	 *
	 * @return list of federation sets
	 */
@Override
public List<FederationSet> getFederationSets(String gitblitUrl) {
    List<FederationSet> list = new ArrayList<FederationSet>();
    // generate standard tokens
    for (FederationToken type : FederationToken.values()) {
        FederationSet fset = new FederationSet(type.toString(), type, getFederationToken(type));
        fset.repositories = getRepositories(gitblitUrl, fset.token);
        list.add(fset);
    }
    // generate tokens for federation sets
    for (String set : settings.getStrings(Keys.federation.sets)) {
        FederationSet fset = new FederationSet(set, FederationToken.REPOSITORIES, getFederationToken(set));
        fset.repositories = getRepositories(gitblitUrl, fset.token);
        list.add(fset);
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) FederationSet(com.gitblit.models.FederationSet) FederationToken(com.gitblit.Constants.FederationToken)

Aggregations

FederationToken (com.gitblit.Constants.FederationToken)1 FederationSet (com.gitblit.models.FederationSet)1 ArrayList (java.util.ArrayList)1