All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sitewhere.grpc.client.common.tracing.OperationNameConstructor Maven / Gradle / Ivy

There is a newer version: 3.0.13
Show newest version
package com.sitewhere.grpc.client.common.tracing;

import io.grpc.MethodDescriptor;

/**
 * Interface that allows span operation names to be constructed from an RPC's
 * method descriptor.
 */
public interface OperationNameConstructor {

    /**
     * Default span operation name constructor, that will return an RPC's method
     * name when constructOperationName is called.
     */
    public static OperationNameConstructor DEFAULT = new OperationNameConstructor() {
	@Override
	public  String constructOperationName(MethodDescriptor method) {
	    return method.getFullMethodName();
	}
    };

    /**
     * Constructs a span's operation name from the RPC's method.
     * 
     * @param method
     *            the rpc method to extract a name from
     * @param 
     *            the rpc request type
     * @param 
     *            the rpc response type
     * @return the operation name
     */
    public  String constructOperationName(MethodDescriptor method);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy