git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/authorization-common-library@131608 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
eb941576f5
commit
2f2620b800
|
@ -38,6 +38,7 @@ public class AuthorizationEndpointScanner {
|
||||||
Unmarshaller um = context.createUnmarshaller();
|
Unmarshaller um = context.createUnmarshaller();
|
||||||
|
|
||||||
String defaultInfrastructure = null;
|
String defaultInfrastructure = null;
|
||||||
|
int defaultInfraPriority= Integer.MAX_VALUE;
|
||||||
|
|
||||||
ClasspathScanner scanner = ClasspathScannerFactory.scanner();
|
ClasspathScanner scanner = ClasspathScannerFactory.scanner();
|
||||||
for (ClasspathResource r : scanner.scan(new NameMatcher(configurationPattern))){
|
for (ClasspathResource r : scanner.scan(new NameMatcher(configurationPattern))){
|
||||||
|
@ -45,10 +46,13 @@ public class AuthorizationEndpointScanner {
|
||||||
if (defaultInfrastructure==null)
|
if (defaultInfrastructure==null)
|
||||||
defaultInfrastructure = endpoint.getInfrastructure();
|
defaultInfrastructure = endpoint.getInfrastructure();
|
||||||
|
|
||||||
|
|
||||||
if (!endpointsMap.containsKey(endpoint.getInfrastructure())
|
if (!endpointsMap.containsKey(endpoint.getInfrastructure())
|
||||||
|| endpointsMap.get(endpoint.getInfrastructure()).getPriority()> endpoint.getPriority()){
|
|| endpointsMap.get(endpoint.getInfrastructure()).getPriority()> endpoint.getPriority()){
|
||||||
if ((r.name()).startsWith("default"))
|
if ((r.name()).startsWith("default") && endpoint.getPriority()<defaultInfraPriority ){
|
||||||
defaultInfrastructure = endpoint.getInfrastructure();
|
defaultInfrastructure = endpoint.getInfrastructure();
|
||||||
|
defaultInfraPriority = endpoint.getPriority();
|
||||||
|
}
|
||||||
endpointsMap.put(endpoint.getInfrastructure().hashCode(), endpoint);
|
endpointsMap.put(endpoint.getInfrastructure().hashCode(), endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue