Search in sources :

Example 11 with Address

use of org.hl7.fhir.dstu3.model.Address in project gpconnect-demonstrator by nhsconnect.

the class StaticElementsHelper method getValidAddress.

public Address getValidAddress() {
    Address orgAddress = new Address();
    orgAddress.setType(AddressType.PHYSICAL);
    orgAddress.setUse(AddressUse.WORK);
    return orgAddress;
}
Also used : Address(org.hl7.fhir.dstu3.model.Address)

Example 12 with Address

use of org.hl7.fhir.dstu3.model.Address in project gpconnect-demonstrator by nhsconnect.

the class OrganizationResourceProvider method getValidAddress.

private Address getValidAddress() {
    Address orgAddress = new Address();
    orgAddress.setType(AddressType.PHYSICAL);
    orgAddress.setUse(AddressUse.WORK);
    return orgAddress;
}
Also used : Address(org.hl7.fhir.dstu3.model.Address)

Example 13 with Address

use of org.hl7.fhir.dstu3.model.Address in project cloudbreak by hortonworks.

the class AwsResourceConnector method releaseReservedIp.

private void releaseReservedIp(AmazonEC2 client, Iterable<CloudResource> resources) {
    CloudResource elasticIpResource = getReservedIp(resources);
    if (elasticIpResource != null && elasticIpResource.getName() != null) {
        Address address;
        try {
            DescribeAddressesResult describeResult = client.describeAddresses(new DescribeAddressesRequest().withAllocationIds(elasticIpResource.getName()));
            address = describeResult.getAddresses().get(0);
        } catch (AmazonServiceException e) {
            if (e.getErrorMessage().equals("The allocation ID '" + elasticIpResource.getName() + "' does not exist")) {
                LOGGER.warn("Elastic IP with allocation ID '{}' not found. Ignoring IP release.", elasticIpResource.getName());
                return;
            } else {
                throw e;
            }
        }
        if (address.getAssociationId() != null) {
            client.disassociateAddress(new DisassociateAddressRequest().withAssociationId(elasticIpResource.getName()));
        }
        client.releaseAddress(new ReleaseAddressRequest().withAllocationId(elasticIpResource.getName()));
    }
}
Also used : Address(com.amazonaws.services.ec2.model.Address) DisassociateAddressRequest(com.amazonaws.services.ec2.model.DisassociateAddressRequest) DescribeAddressesResult(com.amazonaws.services.ec2.model.DescribeAddressesResult) DescribeAddressesRequest(com.amazonaws.services.ec2.model.DescribeAddressesRequest) AmazonServiceException(com.amazonaws.AmazonServiceException) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) ReleaseAddressRequest(com.amazonaws.services.ec2.model.ReleaseAddressRequest)

Aggregations

Address (com.amazonaws.services.ec2.model.Address)7 DescribeAddressesResult (com.amazonaws.services.ec2.model.DescribeAddressesResult)5 DescribeAddressesRequest (com.amazonaws.services.ec2.model.DescribeAddressesRequest)4 AmazonEC2 (com.amazonaws.services.ec2.AmazonEC2)3 Address (com.google.api.services.people.v1.model.Address)3 Person (com.google.api.services.people.v1.model.Person)3 Address (org.hl7.fhir.dstu3.model.Address)3 Test (org.junit.Test)3 AssociateAddressRequest (com.amazonaws.services.ec2.model.AssociateAddressRequest)2 DisassociateAddressRequest (com.amazonaws.services.ec2.model.DisassociateAddressRequest)2 EmailAddress (com.google.api.services.people.v1.model.EmailAddress)2 Name (com.google.api.services.people.v1.model.Name)2 PhoneNumber (com.google.api.services.people.v1.model.PhoneNumber)2 Truth.assertThat (com.google.common.truth.Truth.assertThat)2 Nullable (com.google.gdata.util.common.base.Nullable)2 Pair (com.google.gdata.util.common.base.Pair)2 InstanceInfo (com.netflix.appinfo.InstanceInfo)2 VCard (ezvcard.VCard)2 Email (ezvcard.property.Email)2 StructuredName (ezvcard.property.StructuredName)2