using scope read from ScopeProvider avoiding jump of scope for UrlShortner
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/uri-resolver-manager@132007 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9c3513ffe6
commit
3beb5a9bd2
|
@ -42,7 +42,6 @@ public class UriResolverManager {
|
||||||
|
|
||||||
private UriResolverMapReader uriResolverMapReader;
|
private UriResolverMapReader uriResolverMapReader;
|
||||||
private Map<String, Resolver> applicationTypes;
|
private Map<String, Resolver> applicationTypes;
|
||||||
private String scope;
|
|
||||||
private String applicationType;
|
private String applicationType;
|
||||||
private RuntimeResourceReader reader;
|
private RuntimeResourceReader reader;
|
||||||
|
|
||||||
|
@ -92,10 +91,10 @@ public class UriResolverManager {
|
||||||
public UriResolverManager() throws UriResolverMapException, IllegalArgumentException{
|
public UriResolverManager() throws UriResolverMapException, IllegalArgumentException{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
this.scope = ScopeProvider.instance.get();
|
String scope = ScopeProvider.instance.get();
|
||||||
logger.info("UriResolverManager is using scope: "+scope+", read from ScopeProvider");
|
logger.info("UriResolverManager is using scope: "+scope+", read from ScopeProvider");
|
||||||
|
|
||||||
if(this.scope == null)
|
if(scope == null)
|
||||||
throw new UriResolverMapException("Scope is null, set scope into ScopeProvider!");
|
throw new UriResolverMapException("Scope is null, set scope into ScopeProvider!");
|
||||||
|
|
||||||
this.uriResolverMapReader = new UriResolverMapReader();
|
this.uriResolverMapReader = new UriResolverMapReader();
|
||||||
|
@ -216,7 +215,7 @@ public class UriResolverManager {
|
||||||
if(shortLink){
|
if(shortLink){
|
||||||
try{
|
try{
|
||||||
logger.info("Shortner start..");
|
logger.info("Shortner start..");
|
||||||
UrlShortener shortener = new UrlShortener(this.scope);
|
UrlShortener shortener = new UrlShortener();
|
||||||
link = shortener.shorten(link);
|
link = shortener.shorten(link);
|
||||||
logger.info("Shorted link is: "+link);
|
logger.info("Shorted link is: "+link);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
@ -253,8 +252,11 @@ public class UriResolverManager {
|
||||||
public List<ServiceParameter> discoveryServiceParameters(Resolver resolver) throws IllegalArgumentException, Exception{
|
public List<ServiceParameter> discoveryServiceParameters(Resolver resolver) throws IllegalArgumentException, Exception{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if(this.scope == null)
|
String scope = ScopeProvider.instance.get();
|
||||||
throw new IllegalArgumentException("Scope is null, set ScopeProvider");
|
logger.info("SiscoveryServiceParameters is using scope: "+scope+", read from ScopeProvider");
|
||||||
|
|
||||||
|
if(scope == null)
|
||||||
|
throw new UriResolverMapException("Scope is null, set scope into ScopeProvider!");
|
||||||
|
|
||||||
if(resolver == null)
|
if(resolver == null)
|
||||||
throw new IllegalArgumentException("Resolver is null, set Resolver");
|
throw new IllegalArgumentException("Resolver is null, set Resolver");
|
||||||
|
|
Loading…
Reference in New Issue