Remove spring-cloud-kubernetes-compat

fixes gh-15
This commit is contained in:
Spencer Gibb
2016-12-16 18:21:24 -07:00
parent 9891a64c86
commit 33531b82c9
3 changed files with 0 additions and 91 deletions

View File

@@ -77,7 +77,6 @@
<module>spring-cloud-kubernetes-discovery</module>
<module>spring-cloud-kubernetes-ribbon</module>
<module>spring-cloud-kubernetes-zipkin</module>
<module>spring-cloud-kubernetes-compat</module>
<module>spring-cloud-kubernetes-hystrix</module>
<module>spring-cloud-kubernetes-archaius</module>
<module>spring-cloud-starter-kubernetes</module>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016 to the original authors.
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>0.2.0.BUILD-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-compat</artifactId>
<name>Spring Cloud Kubernetes :: Compatibility</name>
<description>Compatibility module to cover for the lack of InetUtils in older version of Spring Cloud Commons.</description>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.8</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@@ -1,45 +0,0 @@
package org.springframework.cloud.commons.util;
import lombok.Data;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
/**
* Copied from spring-cloud-commons as a workaround for version incompatibilities
*/
public class InetUtils {
public static int getIpAddressAsInt(String host) {
return new HostInfo(host).getIpAddressAsInt();
}
@Data
public static final class HostInfo {
public boolean override;
private String ipAddress;
private String hostname;
HostInfo(String hostname) {
this.hostname = hostname;
}
HostInfo() {
}
public int getIpAddressAsInt() {
InetAddress inetAddress = null;
String host = this.ipAddress;
if (host == null) {
host = this.hostname;
}
try {
inetAddress = InetAddress.getByName(host);
} catch (final UnknownHostException e) {
throw new IllegalArgumentException(e);
}
return ByteBuffer.wrap(inetAddress.getAddress()).getInt();
}
}
}