use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.
the class Bug250313Test method testKeywordConversion_01.
@Test
public void testKeywordConversion_01() throws Exception {
Model model = (Model) getModel("1 mykeyword1");
assertEquals("mykeyword1", model.getValue());
// XXX value converter is not called for keywords?
// if this is a bug, all assertions 'assertEquals(1, convertCallCount)' have to be increased
assertEquals(lexerRule, 0, convertCallCount);
}
use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.
the class Bug250313Test method testDatatypeConversion_04.
@Test
public void testDatatypeConversion_04() throws Exception {
Model model = (Model) getModel("1+ foo - bar");
assertEquals("[str]", model.getMultiValue().toString());
assertEquals("org.eclipse.xtext.valueconverter.Bug250313.Datatype", lexerRule);
assertTrue(node instanceof ICompositeNode);
assertEquals(6, Iterables.size(((ICompositeNode) node).getChildren()));
assertEquals("foo - bar", string);
assertEquals(1, convertCallCount);
}
use of com.amazonaws.services.ec2.model in project xtext-core by eclipse.
the class Bug250313SemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == Bug250313Package.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case Bug250313Package.CHILD1:
sequence_Child1(context, (Child1) semanticObject);
return;
case Bug250313Package.CHILD2:
sequence_Child2(context, (Child2) semanticObject);
return;
case Bug250313Package.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of com.amazonaws.services.ec2.model in project ignite by apache.
the class TcpDiscoveryElbIpFinder method getRegisteredAddresses.
/**
* {@inheritDoc}
*/
@Override
public Collection<InetSocketAddress> getRegisteredAddresses() throws IgniteSpiException {
initClients();
List<String> instanceIds = new ArrayList<>();
DescribeLoadBalancersRequest req = new DescribeLoadBalancersRequest().withLoadBalancerNames(loadBalancerName);
List<LoadBalancerDescription> descs = amazonELBClient.describeLoadBalancers(req).getLoadBalancerDescriptions();
for (LoadBalancerDescription desc : descs) {
for (Instance instance : desc.getInstances()) instanceIds.add(instance.getInstanceId());
}
DescribeInstancesRequest instReq = new DescribeInstancesRequest().withInstanceIds(instanceIds);
List<Reservation> reservations = amazonEC2Client.describeInstances(instReq).getReservations();
List<InetSocketAddress> addrs = new ArrayList<>();
for (Reservation reservation : reservations) {
List<com.amazonaws.services.ec2.model.Instance> instances = reservation.getInstances();
for (com.amazonaws.services.ec2.model.Instance instance : instances) addrs.add(new InetSocketAddress(instance.getPrivateIpAddress(), 0));
}
return addrs;
}
use of com.amazonaws.services.ec2.model in project photon-model by vmware.
the class AWSDiskService method updateDiskState.
/**
* Update photon-model disk state with the properties of ebs volume.
*/
private void updateDiskState(Volume volume, AWSDiskContext context, AwsDiskStage next) {
DiskState diskState = context.disk;
diskState.id = volume.getVolumeId();
if (volume.getCreateTime() != null) {
diskState.creationTimeMicros = TimeUnit.MILLISECONDS.toMicros(volume.getCreateTime().getTime());
}
diskState.status = DiskService.DiskStatus.AVAILABLE;
diskState.origin = DiskService.DiskOrigin.DEPLOYED;
diskState.encrypted = volume.getEncrypted();
// calculate disk name, default to volume-id if 'Name' tag is not present
if (diskState.name == null) {
if (volume.getTags() == null) {
diskState.name = volume.getVolumeId();
} else {
diskState.name = volume.getTags().stream().filter(tag -> tag.getKey().equals(AWS_TAG_NAME)).map(tag -> tag.getValue()).findFirst().orElse(volume.getVolumeId());
}
}
diskState.zoneId = volume.getAvailabilityZone();
sendRequest(Operation.createPatch(createInventoryUri(this.getHost(), context.diskRequest.resourceLink())).setBody(diskState).setCompletion((o, e) -> {
if (e != null) {
handleStages(context, e);
return;
}
handleStages(context, next);
}));
}
Aggregations