Class RepositoryServiceFactory

java.lang.Object
sonia.scm.repository.api.RepositoryServiceFactory

public final class RepositoryServiceFactory extends Object
The RepositoryServiceFactory is the entrypoint of the repository api. You could create RepositoryService from a Repository and with the RepositoryService you could browse and control the entire Repository.

 

Simple usage example:

 public class Sample {

   private final RepositoryServiceFactory factory;

   @Inject
   public Sample(RepositoryServiceFactory factory){
     this.factory = factory;
   }

   public Changeset getChangeset(String repositoryId, String commitId){
     Changeset changeset = null;
     RepositoryService service = null;
     try {
       service = factory.create(repositoryId);
       changeset = service.getLogCommand().getChangeset(commitId);
     } finally {
       if ( service != null ){
         service.close();
       }
     }
     return changeset;
   }

 }
 
Since:
1.17