use of org.openstack4j.model.identity.v3.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 org.openstack4j.model.identity.v3.Endpoint in project wildfly-camel by wildfly-extras.
the class OpenstackIntegrationTest method createKeystoneProject.
@Test
public void createKeystoneProject() throws Exception {
CamelContext camelContext = Mockito.mock(CamelContext.class);
when(camelContext.getHeadersMapFactory()).thenReturn(new DefaultHeadersMapFactory());
Message msg = new DefaultMessage(camelContext);
Exchange exchange = Mockito.mock(Exchange.class);
when(exchange.getIn()).thenReturn(msg);
msg.setHeader(OpenstackConstants.OPERATION, OpenstackConstants.CREATE);
msg.setHeader(OpenstackConstants.NAME, dummyProject.getName());
msg.setHeader(KeystoneConstants.DESCRIPTION, dummyProject.getDescription());
msg.setHeader(KeystoneConstants.DOMAIN_ID, dummyProject.getDomainId());
msg.setHeader(KeystoneConstants.PARENT_ID, dummyProject.getParentId());
KeystoneEndpoint endpoint = Mockito.mock(KeystoneEndpoint.class);
Producer producer = new ProjectProducer(endpoint, client);
producer.process(exchange);
ArgumentCaptor<Project> captor = ArgumentCaptor.forClass(Project.class);
verify(projectService).create(captor.capture());
assertEqualsProject(dummyProject, captor.getValue());
}
use of org.openstack4j.model.identity.v3.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.openstack4j.model.identity.v3.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;
}
Aggregations