Interface Command<T>
- Type Parameters:
T
- the result type of aCommand
- All Known Implementing Classes:
AbstractPushCommand
,CreateProjectCommand
,CreateRepositoryCommand
,CreateSessionCommand
,ForcePushCommand
,NormalizingPushCommand
,PurgeProjectCommand
,PurgeRepositoryCommand
,PushAsIsCommand
,RemoveProjectCommand
,RemoveRepositoryCommand
,RemoveSessionCommand
,RepositoryCommand
,RootCommand
,SessionCommand
,TransformCommand
,UnremoveProjectCommand
,UnremoveRepositoryCommand
,UpdateServerStatusCommand
public interface Command<T>
A Central Dogma command which is used to mutate projects and repositories.
-
Method Summary
Modifier and TypeMethodDescriptionauthor()
Returns the author who initiated the command.createProject
(Author author, String name) Returns a newCommand
which is used to create a new project.createProject
(Long timestamp, Author author, String name) Returns a newCommand
which is used to create a new project.createRepository
(Author author, String projectName, String repositoryName) Returns a newCommand
which is used to create a new repository.createRepository
(Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to create a new repository.createSession
(Session session) Returns a newCommand
which is used to create a new session.Returns the target that the command is supposed to affect, i.e. the project name for the commands affecting to the project, or the project and repository names for the commands affecting to the repository.static <T> Command
<T> purgeProject
(Author author, String name) Returns a newCommand
which is used to purge a project that was removed before.purgeProject
(Long timestamp, Author author, String name) Returns a newCommand
which is used to purge a project that was removed before.purgeRepository
(Author author, String projectName, String repositoryName) Returns a newCommand
which is used to purge a repository.purgeRepository
(Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to purge a repository.static Command
<CommitResult> push
(Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Change<?>... changes) Returns a newCommand
which is used to push the changes.static Command
<CommitResult> push
(Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Iterable<Change<?>> changes) Returns a newCommand
which is used to push the changes.static Command
<CommitResult> push
(Long timestamp, Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Change<?>... changes) Returns a newCommand
which is used to push the changes.static Command
<CommitResult> push
(Long timestamp, Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Iterable<Change<?>> changes) Returns a newCommand
which is used to push the changes.removeProject
(Author author, String name) Returns a newCommand
which is used to remove a project.removeProject
(Long timestamp, Author author, String name) Returns a newCommand
which is used to remove a project.removeRepository
(Author author, String projectName, String repositoryName) Returns a newCommand
which is used to remove a repository.removeRepository
(Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to remove a repository.removeSession
(String sessionId) Returns a newCommand
which is used to remove an existing session.long
Returns the time when performing the command, in milliseconds.static Command
<CommitResult> transform
(Long timestamp, Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, ContentTransformer<?> transformer) Returns a newCommand
that transforms the content at the base revision with the specifiedContentTransformer
and pushed the result of transformation.type()
Returns theCommandType
of the command.unremoveProject
(Author author, String name) Returns a newCommand
which is used to restore a project that was removed before.unremoveProject
(Long timestamp, Author author, String name) Returns a newCommand
which is used to restore a project that was removed before.unremoveRepository
(Author author, String projectName, String repositoryName) Returns a newCommand
which is used to restore a repository that was removed before.unremoveRepository
(Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to restore a repository that was removed before.updateServerStatus
(ServerStatus serverStatus) Returns a newCommand
which is used to update the status of the server.
-
Method Details
-
createProject
Returns a newCommand
which is used to create a new project.- Parameters:
author
- the author who is creating the projectname
- the name of the project which is supposed to be created
-
createProject
Returns a newCommand
which is used to create a new project.- Parameters:
timestamp
- the creation time of the project, in millisecondsauthor
- the author who is creating the projectname
- the name of the project which is supposed to be created
-
removeProject
Returns a newCommand
which is used to remove a project.- Parameters:
author
- the author who is removing the projectname
- the name of the project which is supposed to be removed
-
removeProject
Returns a newCommand
which is used to remove a project.- Parameters:
timestamp
- the removal time of the project, in millisecondsauthor
- the author who is removing the projectname
- the name of the project which is supposed to be removed
-
unremoveProject
Returns a newCommand
which is used to restore a project that was removed before.- Parameters:
author
- the author who is restoring the projectname
- the name of the project which is supposed to be restored
-
unremoveProject
Returns a newCommand
which is used to restore a project that was removed before.- Parameters:
timestamp
- the restoration time of the project, in millisecondsauthor
- the author who is restoring the projectname
- the name of the project which is supposed to be restored
-
purgeProject
Returns a newCommand
which is used to purge a project that was removed before.- Parameters:
author
- the author who is restoring the projectname
- the name of the project which is supposed to be restored
-
purgeProject
Returns a newCommand
which is used to purge a project that was removed before.- Parameters:
timestamp
- the purging time of the project, in millisecondsauthor
- the author who is restoring the projectname
- the name of the project which is supposed to be restored
-
createRepository
Returns a newCommand
which is used to create a new repository.- Parameters:
author
- the author who is creating the repositoryprojectName
- the name of the project that the new repository is supposed to belong torepositoryName
- the name of the repository which is supposed to be created
-
createRepository
static Command<Void> createRepository(@Nullable Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to create a new repository.- Parameters:
timestamp
- the creation time of the repository, in millisecondsauthor
- the author who is creating the repositoryprojectName
- the name of the project that the new repository is supposed to belong torepositoryName
- the name of the repository which is supposed to be created
-
removeRepository
Returns a newCommand
which is used to remove a repository.- Parameters:
author
- the author who is removing the repositoryprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be removed
-
removeRepository
static Command<Void> removeRepository(@Nullable Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to remove a repository.- Parameters:
timestamp
- the removal time of the repository, in millisecondsauthor
- the author who is removing the repositoryprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be removed
-
unremoveRepository
Returns a newCommand
which is used to restore a repository that was removed before.- Parameters:
author
- the author who is restoring the repositoryprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be restored
-
unremoveRepository
static Command<Void> unremoveRepository(@Nullable Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to restore a repository that was removed before.- Parameters:
timestamp
- the restoration time of the project, in millisecondsauthor
- the author who is restoring the repositoryprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be restored
-
purgeRepository
Returns a newCommand
which is used to purge a repository.- Parameters:
author
- the author who is removing the repositoryprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be purged
-
purgeRepository
static Command<Void> purgeRepository(@Nullable Long timestamp, Author author, String projectName, String repositoryName) Returns a newCommand
which is used to purge a repository.- Parameters:
timestamp
- the purging time of the repository, in millisecondsauthor
- the author who is removing the repositoryprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be purged
-
push
static Command<CommitResult> push(Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Change<?>... changes) Returns a newCommand
which is used to push the changes. The changes are normalized viaRepository.previewDiff(Revision, Iterable)
before they are applied. You can find the normalized changes from theCommitResult.changes()
that is the result ofCommandExecutor.execute(Command)
.- Parameters:
author
- the author who is pushing the changesprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be restoredbaseRevision
- the revision which is supposed to apply the changessummary
- the summary of the changesdetail
- the detail message of the changesmarkup
- the markup for the detail messagechanges
- the changes to be applied
-
push
static Command<CommitResult> push(@Nullable Long timestamp, Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Change<?>... changes) Returns a newCommand
which is used to push the changes. The changes are normalized viaRepository.previewDiff(Revision, Iterable)
before they are applied. You can find the normalized changes from theCommitResult.changes()
that is the result ofCommandExecutor.execute(Command)
.- Parameters:
timestamp
- the time when pushing the changes, in millisecondsauthor
- the author who is pushing the changesprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be restoredbaseRevision
- the revision which is supposed to apply the changessummary
- the summary of the changesdetail
- the detail message of the changesmarkup
- the markup for the detail messagechanges
- the changes to be applied
-
push
static Command<CommitResult> push(Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Iterable<Change<?>> changes) Returns a newCommand
which is used to push the changes. The changes are normalized viaRepository.previewDiff(Revision, Iterable)
before they are applied. You can find the normalized changes from theCommitResult.changes()
that is the result ofCommandExecutor.execute(Command)
.- Parameters:
author
- the author who is pushing the changesprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be restoredbaseRevision
- the revision which is supposed to apply the changessummary
- the summary of the changesdetail
- the detail message of the changesmarkup
- the markup for the detail messagechanges
- the changes to be applied
-
push
static Command<CommitResult> push(@Nullable Long timestamp, Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, Iterable<Change<?>> changes) Returns a newCommand
which is used to push the changes. The changes are normalized viaRepository.previewDiff(Revision, Iterable)
before they are applied. You can find the normalized changes from theCommitResult.changes()
that is the result ofCommandExecutor.execute(Command)
.- Parameters:
timestamp
- the time when pushing the changes, in millisecondsauthor
- the author who is pushing the changesprojectName
- the name of the projectrepositoryName
- the name of the repository which is supposed to be restoredbaseRevision
- the revision which is supposed to apply the changessummary
- the summary of the changesdetail
- the detail message of the changesmarkup
- the markup for the detail messagechanges
- the changes to be applied
-
transform
static Command<CommitResult> transform(@Nullable Long timestamp, Author author, String projectName, String repositoryName, Revision baseRevision, String summary, String detail, Markup markup, ContentTransformer<?> transformer) Returns a newCommand
that transforms the content at the base revision with the specifiedContentTransformer
and pushed the result of transformation. You can find the result of transformation fromCommitResult.changes()
. -
createSession
Returns a newCommand
which is used to create a new session.- Parameters:
session
- the session supposed to be created
-
removeSession
Returns a newCommand
which is used to remove an existing session.- Parameters:
sessionId
- the session ID supposed to be removed
-
updateServerStatus
Returns a newCommand
which is used to update the status of the server. -
forcePush
Returns a newCommand
which is used to force-pushCommand
even the server is in read-only mode. This command is useful for migrating the repository content during maintenance mode.Note that
CommandType.NORMALIZING_PUSH
andCommandType.PUSH
are allowed as the delegate. -
type
CommandType type()Returns theCommandType
of the command. -
timestamp
long timestamp()Returns the time when performing the command, in milliseconds. -
author
Author author()Returns the author who initiated the command. -
executionPath
String executionPath()Returns the target that the command is supposed to affect, i.e. the project name for the commands affecting to the project, or the project and repository names for the commands affecting to the repository.
-