org.jclouds.cloudstack.functions
Class ReuseOrAssociateNewPublicIPAddress
java.lang.Object
org.jclouds.cloudstack.functions.ReuseOrAssociateNewPublicIPAddress
- All Implemented Interfaces:
- com.google.common.base.Function<Network,PublicIPAddress>
@Singleton
public class ReuseOrAssociateNewPublicIPAddress
- extends Object
- implements com.google.common.base.Function<Network,PublicIPAddress>
- Author:
- Adrian Cole
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.common.base.Function |
equals |
logger
@Named(value="jclouds.compute")
protected Logger logger
ReuseOrAssociateNewPublicIPAddress
@Inject
public ReuseOrAssociateNewPublicIPAddress(CloudStackClient client,
BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
findAvailableAndAssociatedWithNetwork
public static PublicIPAddress findAvailableAndAssociatedWithNetwork(long networkId,
AddressClient 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,
CloudStackClient client,
BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult)
apply
public PublicIPAddress apply(Network input)
- Specified by:
apply
in interface com.google.common.base.Function<Network,PublicIPAddress>
Copyright © 2009-2012 jclouds. All Rights Reserved.