@Singleton public class ReuseOrAssociateNewPublicIPAddress extends Object implements com.google.common.base.Function<Network,PublicIPAddress>
Constructor and Description |
---|
ReuseOrAssociateNewPublicIPAddress(CloudStackApi client,
BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult) |
Modifier and Type | Method and 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.
|
@Named(value="jclouds.compute") protected Logger logger
@Inject public ReuseOrAssociateNewPublicIPAddress(CloudStackApi client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
public static PublicIPAddress findAvailableAndAssociatedWithNetwork(String networkId, AddressApi 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, CloudStackApi client, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
public PublicIPAddress apply(Network input)
apply
in interface com.google.common.base.Function<Network,PublicIPAddress>
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.