Lucio Lelii 2019-02-20 15:38:59 +00:00
parent d4c76f9e23
commit e7280994da
4 changed files with 8 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<version>2.1.4-SNAPSHOT</version>
<version>2.1.5-SNAPSHOT</version>
<name>authorization service common library</name>
<parent>

View File

@ -34,7 +34,7 @@ public class AuthorizationEndpointScanner {
if (endpoints==null || endpoints.getEndpoints().size()==0){
log.trace("starting authorization endpoint retrieving");
Map<Integer, AuthorizationEndpoint> endpointsMap = new HashMap<Integer, AuthorizationEndpoint>();
Map<String, AuthorizationEndpoint> endpointsMap = new HashMap<String, AuthorizationEndpoint>();
try {
@ -60,7 +60,7 @@ public class AuthorizationEndpointScanner {
defaultInfrastructure = endpoint.getInfrastructure();
defaultInfraPriority = endpoint.getPriority();
}
endpointsMap.put(endpoint.getInfrastructure().hashCode(), endpoint);
endpointsMap.put(endpoint.getInfrastructure(), endpoint);
}
log.info("loaded endpoint {} ",endpoint.toString());

View File

@ -4,15 +4,16 @@ import java.util.Map;
public class EndpointsContainer {
private Map<Integer, AuthorizationEndpoint> endpoints;
private Map<String, AuthorizationEndpoint> endpoints;
private String defaultInfrastructure;
protected EndpointsContainer(Map<Integer, AuthorizationEndpoint> endpoints,
protected EndpointsContainer(Map<String, AuthorizationEndpoint> endpoints,
String defaultInfrastructure) {
super();
this.endpoints = endpoints;
this.defaultInfrastructure = defaultInfrastructure;
}
public Map<Integer, AuthorizationEndpoint> getEndpoints() {
public Map<String, AuthorizationEndpoint> getEndpoints() {
return endpoints;
}
public String getDefaultInfrastructure() {

View File

@ -59,7 +59,7 @@ public class EndpointBinder {
@Test
public void scan(){
Map<Integer, AuthorizationEndpoint> endpoints = AuthorizationEndpointScanner.endpoints().getEndpoints();
Map<String, AuthorizationEndpoint> endpoints = AuthorizationEndpointScanner.endpoints().getEndpoints();
System.out.println(endpoints);
}