// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
// static String resolveNodeName(URIish uri) {
//   StringBuilder sb = new StringBuilder();
//   if (uri.isRemote()) {
//     sb.append(uri.getHost());
//     if (uri.getPort() != -1) {
//       sb.append(":");
//       sb.append(uri.getPort());
//     }
//   } else {
//     sb.append(uri.getPath());
//   }
//   return sb.toString();
// }
// 
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java
// public enum RefPushResult {
//   /** The ref was not successfully replicated. */
//   FAILED,
// 
//   /** The ref is not configured to be replicated. */
//   NOT_ATTEMPTED,
// 
//   /** The ref was successfully replicated. */
//   SUCCEEDED;
// 
//   @Override
//   public String toString() {
//     return name().toLowerCase().replace("_", "-");
//   }
// }


import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName;
import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult;
import java.util.Objects;
import org.eclipse.jgit.transport.RemoteRefUpdate;
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
import org.eclipse.jgit.transport.URIish;
// Copyright (C) 2013 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.googlesource.gerrit.plugins.replication.events;



public class RefReplicatedEvent extends RemoteRefReplicationEvent {
  public static final String TYPE = "ref-replicated";

  @Deprecated public final String targetNode;
  public final Status refStatus;

  public RefReplicatedEvent(
      String project,
      String ref,
      URIish targetUri,
      RefPushResult status,
      RemoteRefUpdate.Status refStatus) {
    super(TYPE, project, ref, targetUri, status.toString());
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
// static String resolveNodeName(URIish uri) {
//   StringBuilder sb = new StringBuilder();
//   if (uri.isRemote()) {
//     sb.append(uri.getHost());
//     if (uri.getPort() != -1) {
//       sb.append(":");
//       sb.append(uri.getPort());
//     }
//   } else {
//     sb.append(uri.getPath());
//   }
//   return sb.toString();
// }
// 
// Path: src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java
// public enum RefPushResult {
//   /** The ref was not successfully replicated. */
//   FAILED,
// 
//   /** The ref is not configured to be replicated. */
//   NOT_ATTEMPTED,
// 
//   /** The ref was successfully replicated. */
//   SUCCEEDED;
// 
//   @Override
//   public String toString() {
//     return name().toLowerCase().replace("_", "-");
//   }
// }


// Path: src/main/java/com/googlesource/gerrit/plugins/replication/events/RefReplicatedEvent.java
import static com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName;
import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult;
import java.util.Objects;
import org.eclipse.jgit.transport.RemoteRefUpdate;
import org.eclipse.jgit.transport.RemoteRefUpdate.Status;
import org.eclipse.jgit.transport.URIish;

// Copyright (C) 2013 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.googlesource.gerrit.plugins.replication.events;



public class RefReplicatedEvent extends RemoteRefReplicationEvent {
  public static final String TYPE = "ref-replicated";

  @Deprecated public final String targetNode;
  public final Status refStatus;

  public RefReplicatedEvent(
      String project,
      String ref,
      URIish targetUri,
      RefPushResult status,
      RemoteRefUpdate.Status refStatus) {
    super(TYPE, project, ref, targetUri, status.toString());
    this.targetNode = resolveNodeName(targetUri);