use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin-gcp by openzipkin.
the class LabelExtractorTest method testEndpointIsSetIpv6.
@Test
public void testEndpointIsSetIpv6() {
Endpoint.Builder serverEndpointBuilder = Endpoint.newBuilder().serviceName("service1").port(80);
serverEndpointBuilder.parseIp("::1");
Endpoint serverEndpoint = serverEndpointBuilder.build();
Endpoint.Builder clientEndpointBuilder = Endpoint.newBuilder().serviceName("service2").port(80);
clientEndpointBuilder.parseIp("::1");
Endpoint clientEndpoint = clientEndpointBuilder.build();
Span serverSpan = Span.newBuilder().kind(Kind.SERVER).traceId("4").name("test-span").id("5").localEndpoint(serverEndpoint).build();
Span clientSpan = Span.newBuilder().kind(Kind.CLIENT).traceId("4").name("test-span").id("6").parentId("5").localEndpoint(clientEndpoint).build();
String prefix = "test.prefix/";
LabelExtractor extractor = new LabelExtractor(Collections.<String, String>emptyMap(), prefix);
Map<String, String> serverLabels = extractor.extract(serverSpan);
assertNull(serverLabels.get(prefix + "endpoint.ipv4"));
assertEquals("::1", serverLabels.get(prefix + "endpoint.ipv6"));
Map<String, String> clientLabels = extractor.extract(clientSpan);
assertNull(clientLabels.get(prefix + "endpoint.ipv4"));
assertNull(clientLabels.get(prefix + "endpoint.ipv6"));
}
use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin-gcp by openzipkin.
the class LabelExtractorTest method testEndpointIsSetIpv4.
@Test
public void testEndpointIsSetIpv4() {
Endpoint.Builder serverEndpointBuilder = Endpoint.newBuilder().serviceName("service1").port(80);
serverEndpointBuilder.parseIp("10.0.0.1");
Endpoint serverEndpoint = serverEndpointBuilder.build();
Endpoint.Builder clientEndpointBuilder = Endpoint.newBuilder().serviceName("service2").port(80);
clientEndpointBuilder.parseIp("10.0.0.1");
Endpoint clientEndpoint = clientEndpointBuilder.build();
Span serverSpan = Span.newBuilder().kind(Kind.SERVER).traceId("4").name("test-span").id("5").localEndpoint(serverEndpoint).build();
Span clientSpan = Span.newBuilder().kind(Kind.CLIENT).traceId("4").name("test-span").id("6").parentId("5").localEndpoint(clientEndpoint).build();
String prefix = "test.prefix/";
LabelExtractor extractor = new LabelExtractor(Collections.<String, String>emptyMap(), prefix);
Map<String, String> serverLabels = extractor.extract(serverSpan);
assertEquals("10.0.0.1", serverLabels.get(prefix + "endpoint.ipv4"));
assertNull(serverLabels.get(prefix + "endpoint.ipv6"));
Map<String, String> clientLabels = extractor.extract(clientSpan);
assertNull(clientLabels.get(prefix + "endpoint.ipv4"));
assertNull(clientLabels.get(prefix + "endpoint.ipv6"));
}
use of com.google.cloud.aiplatform.v1.Endpoint in project ysoserial by frohoff.
the class JBoss method doRun.
private static void doRun(URI u, final Object payloadObject, String username, String password) {
ConnectionProvider instance = null;
ConnectionProviderContextImpl context = null;
ConnectionHandler ch = null;
Channel c = null;
VersionedConnection vc = null;
try {
Logger logger = LogManager.getLogManager().getLogger("");
logger.addHandler(new ConsoleLogHandler());
logger.setLevel(Level.INFO);
OptionMap options = OptionMap.builder().set(Options.SSL_ENABLED, u.getScheme().equals("https")).getMap();
context = new ConnectionProviderContextImpl(options, "endpoint");
instance = new HttpUpgradeConnectionProviderFactory().createInstance(context, options);
String host = u.getHost();
int port = u.getPort() > 0 ? u.getPort() : 9990;
SocketAddress destination = new InetSocketAddress(host, port);
ConnectionHandlerFactory chf = getConnection(destination, username, password, context, instance, options);
ch = chf.createInstance(new ConnectionHandlerContextImpl(context));
c = getChannel(context, ch, options);
System.err.println("Connected");
vc = makeVersionedConnection(c);
MBeanServerConnection mbc = vc.getMBeanServerConnection(null);
doExploit(payloadObject, mbc);
System.err.println("DONE");
} catch (Throwable e) {
e.printStackTrace(System.err);
} finally {
cleanup(instance, context, ch, c, vc);
}
}
use of com.google.cloud.aiplatform.v1.Endpoint in project crnk-framework by crnk-project.
the class AbstractBraveModuleTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() {
Endpoint localEndpoint = Endpoint.newBuilder().serviceName("testClient").build();
clientReporter = Mockito.mock(Reporter.class);
Tracing clientTracing = Tracing.newBuilder().spanReporter(clientReporter).localEndpoint(localEndpoint).build();
client = new CrnkClient(getBaseUri().toString());
client.setHttpAdapter(httpAdapter);
client.addModule(BraveClientModule.create(clientTracing));
taskRepo = client.getRepositoryForType(Task.class);
TaskRepository.clear();
ProjectRepository.clear();
httpAdapter.setReceiveTimeout(10000, TimeUnit.SECONDS);
}
use of com.google.cloud.aiplatform.v1.Endpoint in project axis-axis2-java-core by apache.
the class WSDL20ToAxisServiceBuilder method setup.
/**
* contains all code which gathers non-wsdlService specific information from the
* wsdl.
* <p/>
* After all the setup completes successfully, the setupComplete field is
* set so that any subsequent calls to setup() will result in a no-op. Note
* that subclass WSDL20ToAllAxisServicesBuilder will call populateService
* for each endpoint in the WSDL. Separating the non-wsdlService specific
* information here allows WSDL20ToAllAxisServicesBuilder to only do this
* work 1 time per WSDL, instead of for each endpoint on each wsdlService.
*
* @throws AxisFault - Thrown in case the necessary resources are not available in the WSDL
* @throws WSDLException - Thrown in case Woden throws an exception
*/
protected void setup() throws AxisFault, WSDLException {
if (setupComplete) {
// already setup, just do nothing and return
return;
}
try {
if (description == null) {
Description description;
DescriptionElement descriptionElement;
if (wsdlURI != null && !"".equals(wsdlURI)) {
description = readInTheWSDLFile(wsdlURI);
descriptionElement = description.toElement();
} else if (in != null) {
description = readInTheWSDLFile(in);
descriptionElement = description.toElement();
} else {
throw new AxisFault("No resources found to read the wsdl");
}
savedTargetNamespace = descriptionElement.getTargetNamespace().toString();
namespacemap = descriptionElement.getDeclaredNamespaces();
this.description = description;
}
// Create the namespacemap
stringBasedNamespaceMap = new NamespaceMap();
for (int i = 0; i < namespacemap.length; i++) {
NamespaceDeclaration namespaceDeclaration = namespacemap[i];
stringBasedNamespaceMap.put(namespaceDeclaration.getPrefix(), namespaceDeclaration.getNamespaceURI().toString());
}
DescriptionElement descriptionElement = description.toElement();
createNamespaceMap(descriptionElement);
setupComplete = true;
} catch (AxisFault e) {
// just rethrow AxisFaults
throw e;
} catch (WSDLException e) {
// Preserve the WSDLException
throw e;
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
}
Aggregations