Codota Logo
de.holisticon.util.tracee.configuration
Code IndexAdd Codota to your IDE (free)

How to use de.holisticon.util.tracee.configuration

Best Java code snippets using de.holisticon.util.tracee.configuration (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public boolean shouldProcessParam(String paramName, Channel channel) {
  final String messageTypePropertyValue = getProfiledOrDefaultProperty(channel.name());
  final List<String> patterns = extractPatterns(messageTypePropertyValue);
  return anyPatternMatchesParamName(patterns, paramName);
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public int generatedRequestIdLength() {
  return parseIntOrZero(getProfiledOrDefaultProperty(GENERATE_REQUEST_ID));
}
origin: de.holisticon.util.tracee/tracee-core

private boolean anyPatternMatchesParamName(Iterable<String> patterns, String paramName) {
  for (String pattern : patterns) {
    if (patternMatchesParamName(pattern, paramName))
      return true;
  }
  return false;
}
origin: de.holisticon.util.tracee.inbound/tracee-servlet

void httpRequestInitialized(HttpServletRequest request) {
  final TraceeFilterConfiguration configuration = backend.getConfiguration();
  if (configuration.shouldProcessContext(IncomingRequest)) {
    mergeIncomingContextToBackend(request);
  }
  if (configuration.shouldGenerateRequestId() && !backend.containsKey(TraceeConstants.REQUEST_ID_KEY)) {
    backend.put(TraceeConstants.REQUEST_ID_KEY, Utilities.createRandomAlphanumeric(configuration.generatedRequestIdLength()));
  }
  if (configuration.shouldGenerateSessionId() && !backend.containsKey(TraceeConstants.SESSION_ID_KEY)) {
    final HttpSession session = request.getSession(false);
    if (session != null) {
      backend.put(TraceeConstants.SESSION_ID_KEY, anonymizedSessionKey(session.getId(), configuration.generatedSessionIdLength()));
    }
  }
}
origin: de.holisticon.util.tracee.inbound/tracee-servlet

private void writeContextToResponse(HttpServletResponse response, TraceeFilterConfiguration configuration) {
  if (configuration.shouldProcessContext(OutgoingResponse) && !backend.isEmpty()) {
    final Map<String, String> filteredContext = backend.getConfiguration(profile).filterDeniedParams(backend, OutgoingResponse);
    response.setHeader(HTTP_HEADER_NAME, transportSerialization.render(filteredContext));
  }
}
origin: de.holisticon.util.tracee.inbound/tracee-servlet

@Override
public final void sessionCreated(HttpSessionEvent httpSessionEvent) {
  if (backend.getConfiguration().shouldGenerateSessionId()) {
    final String sessionId = httpSessionEvent.getSession().getId();
    backend.put(TraceeConstants.SESSION_ID_KEY, anonymizedSessionKey(sessionId, backend.getConfiguration().generatedSessionIdLength()));
  }
}
origin: de.holisticon.util.tracee.inbound/tracee-servlet

private void mergeIncomingContextToBackend(HttpServletRequest request) {
  final Enumeration headers = request.getHeaders(HTTP_HEADER_NAME);
  if (headers == null) {
    throw new IllegalStateException("Could not read headers with name '"
        + HTTP_HEADER_NAME + "'. The access seem to be forbidden by the container.");
  }
  final Map<String, String> parsed = new HashMap<String, String>();
  while (headers.hasMoreElements()) {
    parsed.putAll(transportSerialization.parse((String) headers.nextElement()));
  }
  final Map<String, String> filtered = backend.getConfiguration().filterDeniedParams(parsed, IncomingRequest);
  backend.putAll(filtered);
}
origin: de.holisticon.util.tracee/tracee-core

private PropertyChain loadPropertyChain() {
  try {
    final Properties traceeDefaultFileProperties = new TraceePropertiesFileLoader().loadTraceeProperties(TRACEE_DEFAULT_PROPERTIES_FILE);
    final Properties traceeFileProperties = new TraceePropertiesFileLoader().loadTraceeProperties(TRACEE_PROPERTIES_FILE);
    return PropertyChain.build(System.getProperties(), traceeFileProperties, traceeDefaultFileProperties);
  } catch (IOException ioe) {
    throw new IllegalStateException("Could not load TraceeProperties: " + ioe.getMessage(), ioe);
  }
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public boolean shouldProcessContext(Channel channel) {
  final String messageTypePropertyValue = getProfiledOrDefaultProperty(channel.name());
  return !Utilities.isNullOrEmptyString(messageTypePropertyValue);
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public final TraceeFilterConfiguration getConfiguration(String profileName) {
  if (lazyPropertyChain == null) {
    lazyPropertyChain = loadPropertyChain();
  }
  return new PropertiesBasedTraceeFilterConfiguration(lazyPropertyChain, profileName);
}
origin: de.holisticon.util.tracee/tracee-core

private String getProfiledOrDefaultProperty(String propertyName) {
  if (profileName != null) {
    final String profiledProperty = propertyChain.getProperty(TRACEE_CONFIG_PREFIX + profileName + "." + propertyName);
    if (profiledProperty != null)
      return profiledProperty;
  }
  return propertyChain.getProperty(TRACEE_CONFIG_PREFIX + DEFAULT_PROFILE_PREFIX + propertyName);
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public boolean shouldGenerateSessionId() {
  return generatedSessionIdLength() > 0;
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public boolean shouldGenerateRequestId() {
  return generatedRequestIdLength() > 0;
}
origin: de.holisticon.util.tracee/tracee-core

public static PropertyChain build(Properties ... properties) {
  return new PropertyChain(Arrays.asList(properties));
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public Map<String, String> filterDeniedParams(Map<String, String> unfiltered, Channel channel) {
  final HashMap<String, String> filtered = new HashMap<String, String>(unfiltered.size());
  for (Map.Entry<String, String> entry : unfiltered.entrySet()) {
    if (shouldProcessParam(entry.getKey(), channel)) {
      filtered.put(entry.getKey(), entry.getValue());
    }
  }
  return filtered;
}
origin: de.holisticon.util.tracee.inbound/tracee-springmvc

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
  final TraceeFilterConfiguration configuration = backend.getConfiguration(profileName);
  if (configuration.shouldProcessContext(IncomingRequest))
    mergeIncomingContextToBackend(request, configuration);
  // create random RequestId if not already set
  if (!backend.containsKey(TraceeConstants.REQUEST_ID_KEY) && configuration.shouldGenerateRequestId()) {
    backend.put(TraceeConstants.REQUEST_ID_KEY, Utilities.createRandomAlphanumeric(configuration.generatedRequestIdLength()));
  }
  // create another random id to identify the http session
  if (!backend.containsKey(TraceeConstants.SESSION_ID_KEY) && configuration.shouldGenerateSessionId()) {
    final HttpSession session = request.getSession(false);
    if (session != null) {
      backend.put(TraceeConstants.SESSION_ID_KEY, Utilities.createAlphanumericHash(session.getId(),
          configuration.generatedSessionIdLength()));
    }
  }
  return true;
}
origin: de.holisticon.util.tracee.inbound/tracee-springmvc

@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object o, ModelAndView modelAndView) throws Exception {
  final TraceeFilterConfiguration configuration = backend.getConfiguration(profileName);
  if (configuration.shouldProcessContext(OutgoingResponse) && !backend.isEmpty()) {
    final Map<String, String> filteredContext = configuration.filterDeniedParams(backend, OutgoingResponse);
    response.setHeader(outgoingHeaderName, httpJsonHeaderSerialization.render(filteredContext));
  }
  backend.clear();
}
origin: de.holisticon.util.tracee/tracee-jaxws

final void parseSoapHeaderToBackend(SOAPHeader soapHeader) {
  final Map<String, String> parsedContext = transportSerialization.parse(soapHeader);
  final Map<String, String> filteredContext = getTraceeBackend().getConfiguration().filterDeniedParams(parsedContext, OutgoingRequest);
  getTraceeBackend().putAll(filteredContext);
}
origin: de.holisticon.util.tracee/tracee-core

@Override
public int generatedSessionIdLength() {
  return parseIntOrZero(getProfiledOrDefaultProperty(GENERATE_SESSION_ID));
}
origin: de.holisticon.util.tracee/tracee-core

/**
 * Lazily initializes the configuration for this MDCLikeTraceeBackend.
 */
@Override
public final TraceeFilterConfiguration getConfiguration() {
  if (lazyPropertyChain == null) {
    lazyPropertyChain = loadPropertyChain();
  }
  return new PropertiesBasedTraceeFilterConfiguration(lazyPropertyChain);
}
de.holisticon.util.tracee.configuration

Most used classes

  • TraceeFilterConfiguration
  • PropertiesBasedTraceeFilterConfiguration
  • PropertyChain
  • TraceeFilterConfiguration$Channel
  • TraceePropertiesFileLoader
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now