use of org.dcache.srm.util.Configuration in project dcache by dCache.
the class QOSPluginFactory method createInstance.
public static QOSPlugin createInstance(SRM srm) {
Configuration configuration = srm.getConfiguration();
QOSPlugin qosPlugin = null;
String qosPluginClass = configuration.getQosPluginClass();
if (qosPluginClass != null) {
try {
Class<? extends QOSPlugin> pluginClass = Thread.currentThread().getContextClassLoader().loadClass(qosPluginClass).asSubclass(QOSPlugin.class);
qosPlugin = pluginClass.newInstance();
qosPlugin.setSrm(srm);
LOGGER.debug("Created new qos plugin of type {}", qosPluginClass);
} catch (Exception e) {
LOGGER.error("Could not create class " + qosPluginClass, e);
}
}
return qosPlugin;
}
use of org.dcache.srm.util.Configuration in project dcache by dCache.
the class FileRequest method reassessLifetime.
protected void reassessLifetime(long fileSize) {
long currentLifetime = getLifetime();
Configuration config = SRM.getSRM().getConfiguration();
long newLifetime = Lifetimes.calculateRequestLifetimeWithWorkaround(currentLifetime, fileSize, config.getMaximumClientAssumedBandwidth(), config.getGetLifetime());
try {
if (newLifetime > currentLifetime) {
extendLifetime(newLifetime);
}
} catch (SRMException e) {
LOGGER.debug("Unable to adjust lifetime: {}", e.getMessage());
}
}
Aggregations