git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/authorization-common-client@128603 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
25d931a9a1
commit
23e77bcc81
|
@ -12,6 +12,8 @@ import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.gcube.common.authorization.client.Binder;
|
import org.gcube.common.authorization.client.Binder;
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
||||||
|
@ -30,7 +32,7 @@ public class DefaultAuthorizationProxy implements AuthorizationProxy {
|
||||||
|
|
||||||
private static Logger log = LoggerFactory.getLogger(AuthorizationProxy.class);
|
private static Logger log = LoggerFactory.getLogger(AuthorizationProxy.class);
|
||||||
|
|
||||||
//private static Map<String, AuthorizationEntryCache> cache = new HashMap<String, AuthorizationEntryCache>();
|
private static Map<String, AuthorizationEntryCache> cache = new ConcurrentHashMap<String, AuthorizationEntryCache>();
|
||||||
|
|
||||||
private List<AuthorizationEndpoint> endpoints;
|
private List<AuthorizationEndpoint> endpoints;
|
||||||
|
|
||||||
|
@ -86,8 +88,8 @@ public class DefaultAuthorizationProxy implements AuthorizationProxy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuthorizationEntry get(String token) throws ObjectNotFound, Exception{
|
public AuthorizationEntry get(String token) throws ObjectNotFound, Exception{
|
||||||
/*if (cache.containsKey(token) && cache.get(token).isValid())
|
if (cache.containsKey(token) && cache.get(token).isValid())
|
||||||
return cache.get(token).getEntry();*/
|
return cache.get(token).getEntry();
|
||||||
|
|
||||||
final String methodPath = "/retrieve/";
|
final String methodPath = "/retrieve/";
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
||||||
|
import org.gcube.common.authorization.library.AuthorizationEntry;
|
||||||
import org.gcube.common.authorization.library.policies.Action;
|
import org.gcube.common.authorization.library.policies.Action;
|
||||||
import org.gcube.common.authorization.library.policies.Policy;
|
import org.gcube.common.authorization.library.policies.Policy;
|
||||||
import org.gcube.common.authorization.library.policies.ServiceAccess;
|
import org.gcube.common.authorization.library.policies.ServiceAccess;
|
||||||
|
@ -19,7 +20,9 @@ public class CallTest {
|
||||||
@Test
|
@Test
|
||||||
public void call() throws Exception{
|
public void call() throws Exception{
|
||||||
try{
|
try{
|
||||||
System.out.println(authorizationService().get("3b34750e-d39b-4d3c-924d-efcf7cc907c1"));
|
AuthorizationEntry entry = authorizationService().get("3b34750e-d39b-4d3c-924d-efcf7cc907c1");
|
||||||
|
|
||||||
|
System.out.println(entry);
|
||||||
}catch(ObjectNotFound onf){
|
}catch(ObjectNotFound onf){
|
||||||
onf.printStackTrace();
|
onf.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue