Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package artoria.track;
import artoria.servlet.RequestUtils;
import artoria.spring.RequestContextUtils;
import artoria.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.Map;
/**
* The abstract web track provider.
* @author Kahle
*/
public abstract class AbstractWebTrackProvider extends SimpleTrackProvider {
protected AbstractWebTrackProvider(Map commonProperties) {
super(commonProperties);
}
public AbstractWebTrackProvider() {
}
public AbstractWebTrackProvider(Collection showKeys) {
super(showKeys);
}
/**
* Get the value from the properties based on the key.
* @param properties The properties
* @param key The key
* @param defaultValue The default value
* @return The value
*/
protected String takeOut(Map, ?> properties, Object key, String defaultValue) {
Object valueObj = properties.get(key);
if (valueObj == null) { return defaultValue; }
String value = String.valueOf(valueObj);
properties.remove(key);
return StringUtils.isNotBlank(value) ? value : defaultValue;
}
/**
* Process and fill the principal information.
* @param event The event data object
* @param request The HTTP request object
*/
protected void principalInfo(Event event, HttpServletRequest request, HttpServletResponse response) {
if (request == null) { return; }
Map