Search in sources :

Example 51 with Endpoint

use of org.jboss.remoting3.Endpoint in project carbon-apimgt by wso2.

the class APIMWSDLReader method setServiceDefinitionForWSDL2.

private void setServiceDefinitionForWSDL2(org.apache.woden.wsdl20.Description definition, API api) throws APIManagementException {
    org.apache.woden.wsdl20.Service[] serviceMap = definition.getServices();
    String organization = api.getOrganization();
    // URL addressURI;
    try {
        for (org.apache.woden.wsdl20.Service svc : serviceMap) {
            Endpoint[] portMap = svc.getEndpoints();
            for (Endpoint endpoint : portMap) {
                EndpointElement element = endpoint.toElement();
                // addressURI = endpoint.getAddress().toURL();
                // if (addressURI == null) {
                // break;
                // } else {
                String endpointTransport = determineURLTransport(endpoint.getAddress().getScheme(), api.getTransports());
                setAddressUrl(element, new URI(APIUtil.getGatewayendpoint(endpointTransport, organization) + api.getContext() + '/' + api.getId().getVersion()));
            // }
            }
        }
    } catch (Exception e) {
        String errorMsg = "Error occurred while getting the wsdl address location";
        log.error(errorMsg, e);
        throw new APIManagementException(errorMsg, e);
    }
}
Also used : Service(javax.wsdl.Service) EndpointElement(org.apache.woden.wsdl20.xml.EndpointElement) URI(java.net.URI) APIUtil.handleException(org.wso2.carbon.apimgt.impl.utils.APIUtil.handleException) APIMgtWSDLException(org.wso2.carbon.apimgt.impl.wsdl.exceptions.APIMgtWSDLException) SAXException(org.xml.sax.SAXException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) WSDLException(javax.wsdl.WSDLException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) APIManagementException(org.wso2.carbon.apimgt.api.APIManagementException) Endpoint(org.apache.woden.wsdl20.Endpoint) APIManagementException(org.wso2.carbon.apimgt.api.APIManagementException)

Example 52 with Endpoint

use of org.jboss.remoting3.Endpoint in project cloudbreak by hortonworks.

the class OpenStackClient method getRegion.

public Set<String> getRegion(CloudCredential cloudCredential) {
    Access access = createAccess(cloudCredential);
    Token token = createToken(cloudCredential);
    Set<String> regions = new HashSet<>();
    if (token == null && access == null) {
        throw new CloudConnectorException("Unsupported keystone version");
    } else if (token != null) {
        for (Service service : token.getCatalog()) {
            for (Endpoint endpoint : service.getEndpoints()) {
                regions.add(endpoint.getRegion());
            }
        }
    } else {
        for (Access.Service service : access.getServiceCatalog()) {
            for (org.openstack4j.model.identity.v2.Endpoint endpoint : service.getEndpoints()) {
                regions.add(endpoint.getRegion());
            }
        }
    }
    LOGGER.info("regions from openstack: {}", regions);
    return regions;
}
Also used : Endpoint(org.openstack4j.model.identity.v3.Endpoint) CloudConnectorException(com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException) Access(org.openstack4j.model.identity.v2.Access) Service(org.openstack4j.model.identity.v3.Service) Token(org.openstack4j.model.identity.v3.Token) HashSet(java.util.HashSet)

Example 53 with Endpoint

use of org.jboss.remoting3.Endpoint in project vialer-android by VoIPGRID.

the class SipConfig method createEndpoint.

/**
 * Create the Endpoint and init/start the Endpoint.
 * @return
 * @throws LibraryInitFailedException
 */
private Endpoint createEndpoint() throws LibraryInitFailedException {
    mRemoteLogger.d("createEndpoint");
    Endpoint endpoint = new Endpoint();
    EpConfig endpointConfig = new EpConfig();
    // Set echo cancellation options for endpoint.
    MediaConfig mediaConfig = createMediaConfig(endpointConfig);
    endpointConfig.setMedConfig(mediaConfig);
    try {
        endpoint.libCreate();
    } catch (Exception e) {
        Log.e(TAG, "Unable to create the PJSIP library");
        mRemoteLogger.e("" + Log.getStackTraceString(e));
        e.printStackTrace();
        throw new LibraryInitFailedException();
    }
    if (BuildConfig.DEBUG || mSipService.getPreferences().remoteLoggingIsActive()) {
        setSipLogging(endpointConfig);
    }
    UaConfig uaConfig = endpointConfig.getUaConfig();
    uaConfig.setUserAgent(getUserAgentHeader(mSipService));
    configureStunServer(uaConfig);
    try {
        endpoint.libInit(endpointConfig);
    } catch (Exception e) {
        Log.e(TAG, "Unable to init the PJSIP library");
        mRemoteLogger.e("" + Log.getStackTraceString(e));
        e.printStackTrace();
        throw new LibraryInitFailedException();
    }
    TransportConfig transportConfig = createTransportConfig();
    try {
        mCurrentTransportId = endpoint.transportCreate(getTransportType(), transportConfig);
        endpoint.libStart();
    } catch (Exception exception) {
        Log.e(TAG, "Unable to start the PJSIP library");
        mRemoteLogger.e("" + Log.getStackTraceString(exception));
        throw new LibraryInitFailedException();
    }
    return endpoint;
}
Also used : EpConfig(org.pjsip.pjsua2.EpConfig) Endpoint(org.pjsip.pjsua2.Endpoint) UaConfig(org.pjsip.pjsua2.UaConfig) MediaConfig(org.pjsip.pjsua2.MediaConfig) TransportConfig(org.pjsip.pjsua2.TransportConfig)

Example 54 with Endpoint

use of org.jboss.remoting3.Endpoint in project zipkin by openzipkin.

the class SelectSpansAndAnnotations method endpoint.

static Endpoint endpoint(Record a) {
    Endpoint.Builder result = Endpoint.newBuilder().serviceName(a.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME)).port(Schema.maybeGet(a, ZIPKIN_ANNOTATIONS.ENDPOINT_PORT, (short) 0));
    int ipv4 = maybeGet(a, ZIPKIN_ANNOTATIONS.ENDPOINT_IPV4, 0);
    if (ipv4 != 0) {
        // allocation is ok here as Endpoint.ipv4Bytes would anyway
        result.parseIp(new byte[] { (byte) (ipv4 >> 24 & 0xff), (byte) (ipv4 >> 16 & 0xff), (byte) (ipv4 >> 8 & 0xff), (byte) (ipv4 & 0xff) });
    }
    result.parseIp(Schema.maybeGet(a, ZIPKIN_ANNOTATIONS.ENDPOINT_IPV6, null));
    return result.build();
}
Also used : Endpoint(zipkin2.Endpoint) Endpoint(zipkin2.Endpoint)

Example 55 with Endpoint

use of org.jboss.remoting3.Endpoint in project zipkin by openzipkin.

the class JacksonSpanDecoder method parseEndpoint.

static Endpoint parseEndpoint(JsonParser jsonParser) throws IOException {
    if (!jsonParser.isExpectedStartObjectToken()) {
        throw new IOException("Not a valid JSON object, start token: " + jsonParser.currentToken());
    }
    String serviceName = null, ipv4 = null, ipv6 = null;
    int port = 0;
    while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
        String fieldName = jsonParser.currentName();
        JsonToken value = jsonParser.nextToken();
        if (value == JsonToken.VALUE_NULL) {
            continue;
        }
        switch(fieldName) {
            case "serviceName":
                serviceName = jsonParser.getValueAsString();
                break;
            case "ipv4":
                ipv4 = jsonParser.getValueAsString();
                break;
            case "ipv6":
                ipv6 = jsonParser.getValueAsString();
                break;
            case "port":
                port = jsonParser.getValueAsInt();
                break;
            default:
                jsonParser.skipChildren();
        }
    }
    if (serviceName == null && ipv4 == null && ipv6 == null && port == 0)
        return null;
    return Endpoint.newBuilder().serviceName(serviceName).ip(ipv4).ip(ipv6).port(port).build();
}
Also used : JsonToken(com.fasterxml.jackson.core.JsonToken) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) Endpoint(zipkin2.Endpoint)

Aggregations

Endpoint (zipkin2.Endpoint)60 Span (zipkin2.Span)27 Test (org.junit.jupiter.api.Test)18 V1Span (zipkin2.v1.V1Span)16 Test (org.junit.Test)15 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)5 SpanSampler (com.wavefront.agent.sampler.SpanSampler)5 ByteBuf (io.netty.buffer.ByteBuf)5 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)5 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)5 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)5 ArrayList (java.util.ArrayList)5 Span (wavefront.report.Span)5 Endpoint (org.apache.woden.wsdl20.Endpoint)4 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)4 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)3 IOException (java.io.IOException)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Service (org.apache.woden.wsdl20.Service)3