com.nepxion.discovery.plugin.framework.event.VersionUpdatedEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discovery-plugin-framework-starter Show documentation
Show all versions of discovery-plugin-framework-starter Show documentation
Nepxion Discovery is a solution for Spring Cloud with blue green, gray, weight, limitation, circuit breaker, degrade, isolation, monitor, tracing, dye, failover, async agent
The newest version!
package com.nepxion.discovery.plugin.framework.event;
/**
* Title: Nepxion Discovery
* Description: Nepxion Discovery
* Copyright: Copyright (c) 2017-2050
* Company: Nepxion
* @author Haojun Ren
* @version 1.0
*/
import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import com.nepxion.discovery.common.exception.DiscoveryException;
public class VersionUpdatedEvent implements Serializable {
private static final long serialVersionUID = 7749946311426379329L;
private String dynamicVersion;
private String localVersion;
public VersionUpdatedEvent(String dynamicVersion) {
this(dynamicVersion, null);
}
public VersionUpdatedEvent(String dynamicVersion, String localVersion) {
if (StringUtils.isNotEmpty(dynamicVersion)) {
this.dynamicVersion = dynamicVersion.trim();
}
if (StringUtils.isEmpty(this.dynamicVersion)) {
throw new DiscoveryException("Dynamic version can't be null or empty while updating");
}
if (StringUtils.isNotEmpty(localVersion)) {
this.localVersion = localVersion.trim();
}
}
public String getDynamicVersion() {
return dynamicVersion;
}
public String getLocalVersion() {
return localVersion;
}
}