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);
}
}
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;
}
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;
}
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();
}
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();
}
Aggregations