@Singleton public class ReuseOrAssociateNewPublicIPAddress extends Object implements com.google.common.base.Function<Network,PublicIPAddress>
Constructor and Description |
---|
ReuseOrAssociateNewPublicIPAddress(CloudStackClient client,
BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult) |
Modifier and Type | Method and Description |
---|---|
PublicIPAddress |
apply(Network input) |
static PublicIPAddress |
associateIPAddressInNetwork(Network network,
CloudStackClient client,
BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult) |
static PublicIPAddress |
findAvailableAndAssociatedWithNetwork(long networkId,
AddressClient client)
Finds existing addresses who are ready for use and not assigned to a
machine.
|
@Inject public ReuseOrAssociateNewPublicIPAddress(CloudStackClient client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
public static PublicIPAddress findAvailableAndAssociatedWithNetwork(long networkId, AddressClient client)
networkId
- network id to searchclient
- address clientNoSuchElementException
- if there's no existing ip address that is free for usepublic static PublicIPAddress associateIPAddressInNetwork(Network network, CloudStackClient client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
public PublicIPAddress apply(Network input)
apply
in interface com.google.common.base.Function<Network,PublicIPAddress>
Copyright © 2009-2012 jclouds. All Rights Reserved.