1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.linecorp.centraldogma.server.internal.mirror;
18
19 import static java.util.Objects.requireNonNull;
20
21 import java.io.File;
22 import java.net.URI;
23
24 import javax.annotation.Nullable;
25
26 import com.cronutils.model.Cron;
27
28 import com.linecorp.centraldogma.server.command.CommandExecutor;
29 import com.linecorp.centraldogma.server.mirror.MirrorCredential;
30 import com.linecorp.centraldogma.server.mirror.MirrorDirection;
31 import com.linecorp.centraldogma.server.storage.repository.Repository;
32
33 public final class CentralDogmaMirror extends AbstractMirror {
34
35 private final String remoteProject;
36 private final String remoteRepo;
37
38 public CentralDogmaMirror(Cron schedule, MirrorDirection direction, MirrorCredential credential,
39 Repository localRepo, String localPath,
40 URI remoteRepoUri, String remoteProject, String remoteRepo, String remotePath,
41 @Nullable String gitignore) {
42
43 super(schedule, direction, credential, localRepo, localPath, remoteRepoUri, remotePath, null,
44 gitignore);
45
46 this.remoteProject = requireNonNull(remoteProject, "remoteProject");
47 this.remoteRepo = requireNonNull(remoteRepo, "remoteRepo");
48 }
49
50 String remoteProject() {
51 return remoteProject;
52 }
53
54 String remoteRepo() {
55 return remoteRepo;
56 }
57
58 @Override
59 protected void mirrorLocalToRemote(File workDir, int maxNumFiles, long maxNumBytes) throws Exception {
60 throw new UnsupportedOperationException();
61 }
62
63 @Override
64 protected void mirrorRemoteToLocal(File workDir, CommandExecutor executor,
65 int maxNumFiles, long maxNumBytes) throws Exception {
66 throw new UnsupportedOperationException();
67 }
68 }