Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
149cc7d7
Commit
149cc7d7
authored
Feb 13, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement ServiceInstance.{getUri,isSecure}
fixes gh-210
parent
043732ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
EurekaDiscoveryClient.java
...framework/cloud/netflix/eureka/EurekaDiscoveryClient.java
+22
-0
RibbonLoadBalancerClient.java
...mework/cloud/netflix/ribbon/RibbonLoadBalancerClient.java
+11
-0
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka/EurekaDiscoveryClient.java
View file @
149cc7d7
...
...
@@ -16,11 +16,13 @@
package
org
.
springframework
.
cloud
.
netflix
.
eureka
;
import
java.net.URI
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.client.DefaultServiceInstance
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
...
...
@@ -63,6 +65,16 @@ public class EurekaDiscoveryClient implements DiscoveryClient {
public
int
getPort
()
{
return
EurekaDiscoveryClient
.
this
.
config
.
getNonSecurePort
();
}
@Override
public
boolean
isSecure
()
{
return
EurekaDiscoveryClient
.
this
.
config
.
getSecurePortEnabled
();
}
@Override
public
URI
getUri
()
{
return
DefaultServiceInstance
.
getUri
(
this
);
}
};
}
...
...
@@ -98,6 +110,16 @@ public class EurekaDiscoveryClient implements DiscoveryClient {
public
int
getPort
()
{
return
this
.
instance
.
getPort
();
}
@Override
public
boolean
isSecure
()
{
return
this
.
instance
.
isPortEnabled
(
InstanceInfo
.
PortType
.
SECURE
);
}
@Override
public
URI
getUri
()
{
return
DefaultServiceInstance
.
getUri
(
this
);
}
}
@Override
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonLoadBalancerClient.java
View file @
149cc7d7
...
...
@@ -19,6 +19,7 @@ package org.springframework.cloud.netflix.ribbon;
import
java.net.URI
;
import
java.util.concurrent.TimeUnit
;
import
org.springframework.cloud.client.DefaultServiceInstance
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.loadbalancer.LoadBalancerClient
;
import
org.springframework.cloud.client.loadbalancer.LoadBalancerRequest
;
...
...
@@ -127,6 +128,16 @@ public class RibbonLoadBalancerClient implements LoadBalancerClient {
return
this
.
server
.
getPort
();
}
@Override
public
boolean
isSecure
()
{
return
false
;
//TODO: howto determine https from ribbon Server
}
@Override
public
URI
getUri
()
{
return
DefaultServiceInstance
.
getUri
(
this
);
}
public
Server
getServer
()
{
return
this
.
server
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment