Class RepoTemplate

  • All Implemented Interfaces:
    RepoOperations

    public class RepoTemplate
    extends Object
    implements RepoOperations

    Repository template implementation.

    Author:
    Willie Wheeler (willie.wheeler@gmail.com)
    • Constructor Detail

      • RepoTemplate

        public RepoTemplate​(org.springframework.web.client.RestTemplate restTemplate,
                            boolean isAuthorizedForUser)
        Parameters:
        restTemplate - RestTemplate
        isAuthorizedForUser - boolean
    • Method Detail

      • getCollaborators

        public List<GitHubUser> getCollaborators​(String user,
                                                 String repo)
        Description copied from interface: RepoOperations
        Public operation to return a list of collaborators for the given repository.
        Specified by:
        getCollaborators in interface RepoOperations
        Parameters:
        user - GitHub user
        repo - GitHub repository
        Returns:
        list of collaborators
      • getCommits

        public List<GitHubCommit> getCommits​(String user,
                                             String repo)
        Description copied from interface: RepoOperations
        Public operation to return a list of commits for the given repository.
        Specified by:
        getCommits in interface RepoOperations
        Parameters:
        user - GitHub user
        repo - GitHub repository
        Returns:
        list of commits
      • getDownloads

        public List<GitHubDownload> getDownloads​(String user,
                                                 String repo)
        Description copied from interface: RepoOperations
        Public operation to return a list of downloads for the given repository.
        Specified by:
        getDownloads in interface RepoOperations
        Parameters:
        user - GitHub user
        repo - GitHub repository
        Returns:
        list of downloads
      • getForks

        public List<GitHubRepo> getForks​(String user,
                                         String repo)
        Description copied from interface: RepoOperations
        Public operation to return the forks for the given repository.
        Specified by:
        getForks in interface RepoOperations
        Parameters:
        user - GitHub user
        repo - GitHub repository
        Returns:
        list of repository forks
      • getWatchers

        public List<GitHubUser> getWatchers​(String user,
                                            String repo)
        Description copied from interface: RepoOperations
        Public operation to return a list of watchers for the given repository.
        Specified by:
        getWatchers in interface RepoOperations
        Parameters:
        user - GitHub user
        repo - GitHub repository
        Returns:
        list of watchers
      • getHooks

        public List<GitHubHook> getHooks​(String user,
                                         String repo)
        Description copied from interface: RepoOperations
        Authorized operation to return a list of hooks for the given repository.
        Specified by:
        getHooks in interface RepoOperations
        Parameters:
        user - GitHub user
        repo - GitHub repository
        Returns:
        list of hooks
      • requireAuthorization

        protected void requireAuthorization()