Package org.jclouds.cloudstack.functions
Class ReuseOrAssociateNewPublicIPAddress
- java.lang.Object
-
- org.jclouds.cloudstack.functions.ReuseOrAssociateNewPublicIPAddress
-
- All Implemented Interfaces:
com.google.common.base.Function<Network,PublicIPAddress>
,Function<Network,PublicIPAddress>
@Singleton public class ReuseOrAssociateNewPublicIPAddress extends Object implements com.google.common.base.Function<Network,PublicIPAddress>
-
-
Constructor Summary
Constructors Constructor Description ReuseOrAssociateNewPublicIPAddress(CloudStackApi client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PublicIPAddress
apply(Network input)
static PublicIPAddress
associateIPAddressInNetwork(Network network, CloudStackApi client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
static PublicIPAddress
findAvailableAndAssociatedWithNetwork(String networkId, AddressApi client)
Finds existing addresses who are ready for use and not assigned to a machine.
-
-
-
Field Detail
-
logger
@Named("jclouds.compute") protected Logger logger
-
-
Constructor Detail
-
ReuseOrAssociateNewPublicIPAddress
@Inject public ReuseOrAssociateNewPublicIPAddress(CloudStackApi client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
-
-
Method Detail
-
findAvailableAndAssociatedWithNetwork
public static PublicIPAddress findAvailableAndAssociatedWithNetwork(String networkId, AddressApi client)
Finds existing addresses who are ready for use and not assigned to a machine.- Parameters:
networkId
- network id to searchclient
- address client- Returns:
- address to use
- Throws:
NoSuchElementException
- if there's no existing ip address that is free for use
-
associateIPAddressInNetwork
public static PublicIPAddress associateIPAddressInNetwork(Network network, CloudStackApi client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
-
apply
public PublicIPAddress apply(Network input)
- Specified by:
apply
in interfacecom.google.common.base.Function<Network,PublicIPAddress>
- Specified by:
apply
in interfaceFunction<Network,PublicIPAddress>
-
-