
artoria.event.AbstractWebEventProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of artoria-extend Show documentation
Show all versions of artoria-extend Show documentation
Artoria is a java technology framework based on the facade pattern.
The newest version!
package artoria.event;
import artoria.servlet.RequestUtils;
import artoria.spring.RequestContextUtils;
import artoria.track.SimpleTrackProvider;
import artoria.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.Map;
/**
* The abstract web track provider.
* @author Kahle
*/
@Deprecated // TODO: Deletable
public abstract class AbstractWebEventProvider extends SimpleTrackProvider {
protected AbstractWebEventProvider(Map commonProperties) {
super(commonProperties);
}
public AbstractWebEventProvider() {
}
public AbstractWebEventProvider(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) {
if (request == null) { return; }
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy