hudson.plugins.pxe
Class BootConfiguration

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.plugins.pxe.BootConfiguration
All Implemented Interfaces:
hudson.model.Describable<BootConfiguration>, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem
Direct Known Subclasses:
ChainBootConfiguration, IsoBasedBootConfiguration

public abstract class BootConfiguration
extends hudson.model.AbstractModelObject
implements hudson.model.Describable<BootConfiguration>

Configuration of a bootable operating system.

Say "Ubuntu 2008.10 + such and such preseed config".

These objects are bound to URL as "/pxe/configuration/ID/"

Author:
Kohsuke Kawaguchi

Constructor Summary
BootConfiguration()
           
 
Method Summary
static hudson.DescriptorExtensionList<BootConfiguration,BootConfigurationDescriptor> all()
          Returns all the registered BootConfigurationDescriptors.
 java.lang.String getAbsoluteUrl()
          Gets the absolute URL to this BootConfiguration.
 BootConfigurationDescriptor getDescriptor()
           
 java.lang.String getId()
          Returns a unique ID that distinguishes BootConfigurations among other siblings.
protected abstract  java.lang.String getIdSeed()
          Returns the string that becomes the seed of the getId().
abstract  java.lang.String getPxeLinuxConfigFragment()
          Returns the fragment to be merged into pxelinux.cfg/default.
protected  java.io.InputStream getResourceAsStream(java.lang.String fileName)
          Convenience method to load a resource from the same place as Jelly views are loaded.
 java.lang.String getSearchUrl()
           
 java.lang.String getUrl()
           
protected  void shutdown()
          Called before the BootConfiguration instances are let go because of the reconfiguration.
 org.jvnet.hudson.tftpd.Data tftp(java.lang.String fileName)
          Serves data from TFTP.
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.model.ModelObject
getDisplayName
 

Constructor Detail

BootConfiguration

public BootConfiguration()
Method Detail

getId

public java.lang.String getId()
Returns a unique ID that distinguishes BootConfigurations among other siblings. For serving dynamic data from TFTP, it's often useful to have an unique ID per BootConfiguration. This method provides that.


getIdSeed

protected abstract java.lang.String getIdSeed()
Returns the string that becomes the seed of the getId(). The ID is in turn used for HTTP URLs and TFTP file names, so this method should return something stable and not entirely illegible. But avoid unsafe characters like spaces, '/', etc. A good example would be "OpenSolaris2008.11" or "Ubuntu8.10".

Several BootConfigurations can return the same ID seed, and getId() handles those situations correctly.


getSearchUrl

public final java.lang.String getSearchUrl()
Specified by:
getSearchUrl in interface hudson.search.SearchItem

getUrl

public final java.lang.String getUrl()

getAbsoluteUrl

public final java.lang.String getAbsoluteUrl()
Gets the absolute URL to this BootConfiguration.

Returns:
String like "http://foobar/path/to/hudson/pxe/configuration/me" without trailing '/'.

getDescriptor

public BootConfigurationDescriptor getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<BootConfiguration>

getResourceAsStream

protected java.io.InputStream getResourceAsStream(java.lang.String fileName)
Convenience method to load a resource from the same place as Jelly views are loaded.


tftp

public org.jvnet.hudson.tftpd.Data tftp(java.lang.String fileName)
                                 throws java.io.IOException
Serves data from TFTP.

This mechanism is useful when you need to generate the data to be served on the fly. Static resources can be more easily served by simply placing them as resources under /tftp.

The TFTP file namespace is divided for each BootConfigurations as /ID/... to avoid collisions between different configurations.

Parameters:
fileName - Relative path within the space designated for this boot configuration. For example, if the client requests "foo/bar/zot" and the ID of this configuration is "foo", this parameter will be "bar/zot".
Returns:
null if no such file exists, as far as this plugin is concerned. The PXE plugin will continue to search other BootConfigurations to see if anyone understands it.
Throws:
java.io.IOException - If a problem occurs. The PXE plugin will abort the search and the download will fail.

shutdown

protected void shutdown()
                 throws java.io.IOException
Called before the BootConfiguration instances are let go because of the reconfiguration. This is a good place to clean up background threads, etc.

Throws:
java.io.IOException

getPxeLinuxConfigFragment

public abstract java.lang.String getPxeLinuxConfigFragment()
                                                    throws java.io.IOException
Returns the fragment to be merged into pxelinux.cfg/default.

Throws:
java.io.IOException

all

public static hudson.DescriptorExtensionList<BootConfiguration,BootConfigurationDescriptor> all()
Returns all the registered BootConfigurationDescriptors.



Copyright © 2009. All Rights Reserved.