Interface Mirror
public interface Mirror
Contains the properties for a mirroring task and performs the task.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the authentication credentials which are required when accessing the Git repositories.Returns the direction of the mirroring task.boolean
enabled()
Returns whether thisMirror
is enabled.Returns a gitignore pattern for the files which won't be mirrored.id()
Returns the ID of the mirroring task.Returns the path in the Central Dogma repository where is supposed to keep the mirrored files.Returns the Central Dogma repository where is supposed to keep the mirrored files.mirror
(File workDir, CommandExecutor executor, int maxNumFiles, long maxNumBytes, Instant triggeredTime) Performs the mirroring task.nextExecutionTime
(ZonedDateTime lastExecutionTime) Returns the next execution time of the mirroring task.Returns the name of the branch in the Git repository where is supposed to be mirrored.Returns the path of the Git repository where is supposed to be mirrored.Returns the URI of the Git repository which will be mirrored from.com.cronutils.model.Cron
schedule()
Returns the schedule for the mirroring task.zone()
Returns the zone where thisMirror
is pinned to.
-
Method Details
-
id
String id()Returns the ID of the mirroring task. -
schedule
@Nullable com.cronutils.model.Cron schedule()Returns the schedule for the mirroring task.null
if the mirroring task is not scheduled. -
nextExecutionTime
Returns the next execution time of the mirroring task.- Parameters:
lastExecutionTime
- the last execution time of the mirroring task
-
direction
MirrorDirection direction()Returns the direction of the mirroring task. -
credential
Credential credential()Returns the authentication credentials which are required when accessing the Git repositories. -
localRepo
Repository localRepo()Returns the Central Dogma repository where is supposed to keep the mirrored files. -
localPath
String localPath()Returns the path in the Central Dogma repository where is supposed to keep the mirrored files. -
remoteRepoUri
URI remoteRepoUri()Returns the URI of the Git repository which will be mirrored from. -
remotePath
String remotePath()Returns the path of the Git repository where is supposed to be mirrored. -
remoteBranch
String remoteBranch()Returns the name of the branch in the Git repository where is supposed to be mirrored. -
gitignore
Returns a gitignore pattern for the files which won't be mirrored. -
enabled
boolean enabled()Returns whether thisMirror
is enabled. -
zone
Returns the zone where thisMirror
is pinned to. -
mirror
MirrorResult mirror(File workDir, CommandExecutor executor, int maxNumFiles, long maxNumBytes, Instant triggeredTime) Performs the mirroring task.- Parameters:
workDir
- the local directory where keeps the mirrored filesexecutor
- theCommandExecutor
which is used to perform operation to the Central Dogma storagemaxNumFiles
- the maximum number of files allowed to the mirroring task. AMirrorException
would be raised if the number of files to be mirrored exceeds it.maxNumBytes
- the maximum bytes allowed to the mirroring task. AMirrorException
would be raised if the total size of the files to be mirrored exceeds it.triggeredTime
- the time when the mirroring task is triggered.
-