io.tracee.Utilities.generateInvocationIdIfNecessary()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中io.tracee.Utilities.generateInvocationIdIfNecessary()方法的一些代码示例,展示了Utilities.generateInvocationIdIfNecessary()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.generateInvocationIdIfNecessary()方法的具体详情如下:
包路径:io.tracee.Utilities
类名称:Utilities
方法名:generateInvocationIdIfNecessary

Utilities.generateInvocationIdIfNecessary介绍

[英]Generate invocation id if it doesn't exist in TraceeBackend and configuration asks for one
[中]如果TraceeBackend中不存在调用id,并且配置要求生成调用id,则生成调用id

代码示例

代码示例来源:origin: tracee/tracee

  1. @Override
  2. public boolean handleRequest(MessageContext messageContext, Object o) {
  3. parseContextFromSoapHeader(messageContext.getRequest(), IncomingRequest);
  4. Utilities.generateInvocationIdIfNecessary(backend);
  5. return true;
  6. }

代码示例来源:origin: tracee/tracee

  1. @Override
  2. public void handleMessage(Message message) {
  3. super.handleMessage(message);
  4. if (shouldHandleMessage(message)) {
  5. Utilities.generateInvocationIdIfNecessary(backend);
  6. }
  7. }

代码示例来源:origin: tracee/tracee

  1. @Override
  2. public void jobToBeExecuted(JobExecutionContext context) {
  3. final TraceeFilterConfiguration configuration = backend.getConfiguration(profile);
  4. if (configuration.shouldProcessContext(AsyncProcess)) {
  5. @SuppressWarnings("unchecked")
  6. final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER);
  7. if (traceeContext != null && !traceeContext.isEmpty()) {
  8. final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess);
  9. backend.putAll(filteredContext);
  10. }
  11. }
  12. Utilities.generateInvocationIdIfNecessary(backend);
  13. }

代码示例来源:origin: tracee/tracee

  1. private void httpRequestInitialized(final HttpServletRequest request) {
  2. final TraceeFilterConfiguration configuration = backend.getConfiguration();
  3. if (configuration.shouldProcessContext(IncomingRequest)) {
  4. final Enumeration<String> headers = request.getHeaders(HTTP_HEADER_NAME);
  5. if (headers != null && headers.hasMoreElements()) {
  6. final Map<String, String> contextMap = transportSerialization.parse(Collections.list(headers));
  7. backend.putAll(backend.getConfiguration().filterDeniedParams(contextMap, IncomingRequest));
  8. }
  9. }
  10. Utilities.generateInvocationIdIfNecessary(backend);
  11. final HttpSession session = request.getSession(false);
  12. if (session != null) {
  13. Utilities.generateSessionIdIfNecessary(backend, session.getId());
  14. }
  15. }
  16. }

代码示例来源:origin: tracee/tracee

  1. @Override
  2. public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, final Object o) {
  3. final TraceeFilterConfiguration configuration = backend.getConfiguration(profileName);
  4. if (configuration.shouldProcessContext(IncomingRequest)) {
  5. @SuppressWarnings("unchecked")
  6. final Enumeration<String> headers = request.getHeaders(incomingHeaderName);
  7. if (headers != null && headers.hasMoreElements()) {
  8. final Map<String, String> parsedContext = httpHeaderSerialization.parse(Collections.list(headers));
  9. backend.putAll(configuration.filterDeniedParams(parsedContext, IncomingResponse));
  10. }
  11. }
  12. Utilities.generateInvocationIdIfNecessary(backend);
  13. final HttpSession session = request.getSession(false);
  14. if (session != null) {
  15. Utilities.generateSessionIdIfNecessary(backend, session.getId());
  16. }
  17. // We add the current TPIC to the response. If the response is commited before we can replace the values with the current state
  18. // the current state is on the wire. -- better than nothing :-) (See #96)
  19. writeHeaderIfUncommitted(response);
  20. return true;
  21. }

代码示例来源:origin: tracee/tracee

  1. /**
  2. * This method handles the incoming request
  3. */
  4. @Override
  5. public void filter(final ContainerRequestContext containerRequestContext) {
  6. if (backend.getConfiguration().shouldProcessContext(IncomingRequest)) {
  7. final List<String> serializedTraceeHeaders = containerRequestContext.getHeaders().get(TraceeConstants.TPIC_HEADER);
  8. if (serializedTraceeHeaders != null && !serializedTraceeHeaders.isEmpty()) {
  9. final Map<String, String> parsed = transportSerialization.parse(serializedTraceeHeaders);
  10. backend.putAll(backend.getConfiguration().filterDeniedParams(parsed, IncomingRequest));
  11. }
  12. }
  13. Utilities.generateInvocationIdIfNecessary(backend);
  14. }

代码示例来源:origin: tracee/tracee

  1. @SuppressWarnings("unchecked")
  2. public void beforeProcessing(final Message message) throws JMSException {
  3. if (backend.getConfiguration().shouldProcessContext(AsyncProcess)) {
  4. final String encodedTraceeContext = message.getStringProperty(TraceeConstants.TPIC_HEADER);
  5. if (encodedTraceeContext != null) {
  6. final Map<String, String> contextFromMessage = httpHeaderSerialization.parse(singletonList(encodedTraceeContext));
  7. backend.putAll(backend.getConfiguration().filterDeniedParams(contextFromMessage, AsyncProcess));
  8. }
  9. }
  10. Utilities.generateInvocationIdIfNecessary(backend);
  11. }

代码示例来源:origin: tracee/tracee

  1. /**
  2. * Incoming messages
  3. */
  4. @Override
  5. public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) {
  6. final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset);
  7. final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile);
  8. if (filterConfiguration.shouldProcessContext(AsyncProcess)) {
  9. // Values are stored as type of LongStringHelper.ByteArrayLongString - but it's private
  10. final Map<String, String> traceeContextMap = transformToTraceeContextMap(
  11. (Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER));
  12. if (traceeContextMap != null && !traceeContextMap.isEmpty()) {
  13. backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess));
  14. }
  15. }
  16. Utilities.generateInvocationIdIfNecessary(backend);
  17. return messageProperties;
  18. }

代码示例来源:origin: io.tracee.binding/tracee-jaxws

  1. protected final void handleIncoming(SOAPMessageContext context) {
  2. final SOAPMessage soapMessage = context.getMessage();
  3. try {
  4. final SOAPHeader header = soapMessage.getSOAPHeader();
  5. if (header != null && traceeBackend.getConfiguration().shouldProcessContext(IncomingRequest)) {
  6. final Map<String, String> parsedContext = transportSerialization.parseSoapHeader(header);
  7. final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(parsedContext, IncomingRequest);
  8. traceeBackend.putAll(filteredContext);
  9. }
  10. } catch (final SOAPException e) {
  11. logger.warn("Error during precessing of inbound soap header: {}", e.getMessage());
  12. logger.debug("Detailed: Error during precessing of inbound soap header: {}", e.getMessage(), e);
  13. }
  14. Utilities.generateInvocationIdIfNecessary(traceeBackend);
  15. }

代码示例来源:origin: tracee/tracee

  1. protected final void handleIncoming(SOAPMessageContext context) {
  2. final SOAPMessage soapMessage = context.getMessage();
  3. try {
  4. final SOAPHeader header = soapMessage.getSOAPHeader();
  5. if (header != null && traceeBackend.getConfiguration().shouldProcessContext(IncomingRequest)) {
  6. final Map<String, String> parsedContext = transportSerialization.parseSoapHeader(header);
  7. final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(parsedContext, IncomingRequest);
  8. traceeBackend.putAll(filteredContext);
  9. }
  10. } catch (final SOAPException e) {
  11. logger.warn("Error during precessing of inbound soap header: {}", e.getMessage());
  12. logger.debug("Detailed: Error during precessing of inbound soap header: {}", e.getMessage(), e);
  13. }
  14. Utilities.generateInvocationIdIfNecessary(traceeBackend);
  15. }

相关文章