@ -36,6 +36,7 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.service.UserLocalServiceUtil ;
import net.spy.memcached.MemcachedClient ;
import net.spy.memcached.internal.OperationFuture ;
/ * *
* The server side implementation of the RPC service .
@ -45,9 +46,7 @@ import net.spy.memcached.MemcachedClient;
public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsService {
private static final Logger _log = LoggerFactory . getLogger ( MyVREsServiceImpl . class ) ;
/ * *
*
* /
public static final String CACHED_VOS = "CACHED_VRES" ;
/ * *
* needed when querying for authorised services in authentication
@ -96,7 +95,6 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
LinkedHashMap < String , ArrayList < VRE > > toReturn = new LinkedHashMap < String , ArrayList < VRE > > ( ) ;
List < VirtualGroup > currentSiteVGroups = gm . getVirtualGroups ( ManagementUtils . getSiteGroupIdFromServletRequest ( getThreadLocalRequest ( ) . getServerName ( ) ) ) ;
for ( VirtualGroup vg : currentSiteVGroups ) {
String gName = vg . getName ( ) ;
@ -349,6 +347,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
* /
@SuppressWarnings ( "unchecked" )
private boolean authorizeApplication ( String infrastructureName , String qToken , String tempCode , String clientId , String redirectURL ) {
OperationFuture < Boolean > writeOp = null ;
try {
//instance the client if first time
if ( entries = = null )
@ -361,12 +360,14 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
object . put ( "redirect_uri" , redirectURL ) ;
object . put ( "client_id" , clientId ) ;
String JSONData = object . toJSONString ( ) ;
entries . set ( tempCode , CACHE_SECONDS_EXPIRATION , JSONData ) ;
writeOp = entries . set ( tempCode , CACHE_SECONDS_EXPIRATION , JSONData ) ;
} catch ( Exception e ) {
e . printStackTrace ( ) ;
return false ;
return writeOp . getStatus ( ) . isSuccess ( ) ;
}
return true ;
return writeOp . getStatus ( ) . isSuccess ( ) ;
}