public void callback(DataSetMetadata metatada) { // Push the data set to client if and only if the push feature is enabled, the data set is // pushable & the data set is smaller than the max push size defined. DataSetDef dsetDef = metatada.getDefinition(); int estimatedSize = metatada.getEstimatedSize() / 1000; boolean isPushable = dsetDef != null && dsetDef.isPushEnabled() && estimatedSize < dsetDef.getPushMaxSize(); if (pushRemoteDataSetEnabled && isPushable) { // Check if a push is already in progress. // (This is necessary in order to avoid repeating multiple push requests over the same data set). DataSetPushHandler pushHandler = pushRequestMap.get(request.getDataSetUUID()); if (pushHandler == null) { // Create a push handler. pushHandler = new DataSetPushHandler(metatada); // Send the lookup request to the server... DataSetLookup lookupSourceDataSet = new DataSetLookup(request.getDataSetUUID()); _lookupDataSet(lookupSourceDataSet, pushHandler); } // Register the lookup request into the current handler. pushHandler.registerLookup(request, listener); } // Lookup the remote data set otherwise. else { _lookupDataSet(request, listener); } }
public void callback(DataSetMetadata metatada) { // Push the data set to client if and only if the push feature is enabled, the data set is // pushable & the data set is smaller than the max push size defined. DataSetDef dsetDef = metatada.getDefinition(); int estimatedSize = metatada.getEstimatedSize() / 1000; boolean isPushable = dsetDef != null && dsetDef.isPushEnabled() && estimatedSize < dsetDef.getPushMaxSize(); if (pushRemoteDataSetEnabled && isPushable) { // Check if a push is already in progress. // (This is necessary in order to avoid repeating multiple push requests over the same data set). DataSetPushHandler pushHandler = pushRequestMap.get(request.getDataSetUUID()); if (pushHandler == null) { // Create a push handler. pushHandler = new DataSetPushHandler(metatada); // Send the lookup request to the server... DataSetLookup lookupSourceDataSet = new DataSetLookup(request.getDataSetUUID()); _lookupDataSet(lookupSourceDataSet, pushHandler); } // Register the lookup request into the current handler. pushHandler.registerLookup(request, listener); } // Lookup the remote data set otherwise. else { _lookupDataSet(request, listener); } }