1   /*
2    * Copyright 2021 LINE Corporation
3    *
4    * LINE Corporation licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package com.linecorp.centraldogma.server.command;
17  
18  import javax.annotation.Nullable;
19  
20  import com.fasterxml.jackson.annotation.JsonCreator;
21  import com.fasterxml.jackson.annotation.JsonProperty;
22  
23  import com.linecorp.centraldogma.common.Author;
24  import com.linecorp.centraldogma.common.Change;
25  import com.linecorp.centraldogma.common.Markup;
26  import com.linecorp.centraldogma.common.Revision;
27  
28  /**
29   * A {@link Command} which is used replicate a {@link NormalizingPushCommand} to other replicas.
30   * Unlike {@link NormalizingPushCommand}, the changes of this {@link Command}
31   * are not normalized and applied as they are.
32   */
33  public final class PushAsIsCommand extends AbstractPushCommand<Revision> {
34  
35      /**
36       * Creates a new instance.
37       */
38      @JsonCreator
39      PushAsIsCommand(@JsonProperty("timestamp") @Nullable Long timestamp,
40                      @JsonProperty("author") @Nullable Author author,
41                      @JsonProperty("projectName") String projectName,
42                      @JsonProperty("repositoryName") String repositoryName,
43                      @JsonProperty("baseRevision") Revision baseRevision,
44                      @JsonProperty("summary") String summary,
45                      @JsonProperty("detail") String detail,
46                      @JsonProperty("markup") Markup markup,
47                      @JsonProperty("changes") Iterable<Change<?>> changes) {
48          super(CommandType.PUSH, timestamp, author, projectName, repositoryName,
49                baseRevision, summary, detail, markup, changes);
50      }
51  }