public class HostOnlyNetwork extends AbstractNetwork
Option to specify a HostOnlyNetwork for a VagrantPlatform.
Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
| Constructor and Description |
|---|
HostOnlyNetwork(String id,
String macAddress,
Iterator<String> addresses)
Constructs a
HostOnlyNetwork. |
| Modifier and Type | Method and Description |
|---|---|
static HostOnlyNetwork |
dhcp()
Create a
HostOnlyNetwork that will create a
Vagrant private network that will use DHCP to obtain
an IP address. |
static HostOnlyNetwork |
from(Iterator<String> addresses)
Create a
HostOnlyNetwork that will create a
Vagrant private network with the specified address. |
boolean |
isPublic()
Determines if the
Network is visible outside of the Virtual Machine
represented by the VagrantPlatform. |
static HostOnlyNetwork |
of(String address)
Create a
HostOnlyNetwork that will create a
Vagrant private network with the specified address. |
static HostOnlyNetwork |
startingAt(String startingAddress)
Create a
HostOnlyNetwork that will create a
Vagrant private network with the specified address. |
HostOnlyNetwork |
withMacAddress(String macAddress)
Obtain a new
HostOnlyNetwork option that is a copy of this
HostOnlyNetwork with the addition of the specified MAC address. |
Optional<com.oracle.bedrock.runtime.remote.options.HostName> |
write(PrintWriter writer,
String prefix,
String padding)
Write the configuration of the network to the vagrantFile
|
getId, getMacAddressclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCollectorClasspublic HostOnlyNetwork(String id, String macAddress, Iterator<String> addresses)
HostOnlyNetwork.id - the network identifiermacAddress - the mac addressaddresses - the addressespublic boolean isPublic()
NetworkNetwork is visible outside of the Virtual Machine
represented by the VagrantPlatform.true if the Network is visible outside fo the
VagrantPlatform, false otherwisepublic HostOnlyNetwork withMacAddress(String macAddress)
HostOnlyNetwork option that is a copy of this
HostOnlyNetwork with the addition of the specified MAC address.macAddress - that MAC address to apply.HostOnlyNetwork option that is a copy of this
HostOnlyNetwork with the addition of the specified
MAC addresspublic Optional<com.oracle.bedrock.runtime.remote.options.HostName> write(PrintWriter writer, String prefix, String padding)
writer - the PrintWriter being used to write the vagrantFileprefix - the prefix of the VM namepadding - the padding to prefix to any lines written to the vagrantFileHostName of the network interface just created if applicablepublic static HostOnlyNetwork dhcp()
HostOnlyNetwork that will create a
Vagrant private network that will use DHCP to obtain
an IP address.HostOnlyNetwork that will create a
Vagrant private network that will use DHCP to
obtain an IP addresspublic static HostOnlyNetwork of(String address)
HostOnlyNetwork that will create a
Vagrant private network with the specified address.address - the IP address to useHostOnlyNetwork that will create a
Vagrant private network with the specified
addresspublic static HostOnlyNetwork from(Iterator<String> addresses)
HostOnlyNetwork that will create a
Vagrant private network with the specified address.addresses - the Iterator to use to provide
IP addressesHostOnlyNetwork that will create a
Vagrant private network with the specified
addresspublic static HostOnlyNetwork startingAt(String startingAddress)
HostOnlyNetwork that will create a
Vagrant private network with the specified address.startingAddress - the starting address to use
to allocate IP addressesHostOnlyNetwork that will create a
Vagrant private network with the specified
addressCopyright © 2017. All rights reserved.