public abstract class AbstractArchiveChartWriter extends AbstractChartWriter
AbstractChartWriter
whose implementations save
ChartOuterClass.ChartOrBuilder
objects to a destination that can
be considered an archive of some sort.AbstractChartWriter.Context
Modifier | Constructor and Description |
---|---|
protected |
AbstractArchiveChartWriter()
Creates a new
AbstractArchiveChartWriter . |
createYaml, toYAML, write, write, writeSubchart
protected AbstractArchiveChartWriter()
AbstractArchiveChartWriter
.protected void beginWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
AbstractChartWriter.write(Context,
ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
method has been invoked.
The default implementation of this method does nothing.
The AbstractArchiveChartWriter
implementation stores a
String
representing the required path layout under a
"path
" key in the supplied Context
.
beginWrite
in class AbstractChartWriter
context
- the AbstractChartWriter.Context
representing the write
operation; must not be null
parent
- the ChartOuterClass.ChartOrBuilder
functioning as the
parent chart; may be, and often is, null
; must not be
identical to the chartBuilder
parameter valuechartBuilder
- the ChartOuterClass.ChartOrBuilder
to actually write;
must not be null
; must not be identical to the parent
parameter valueIOException
- if a write error occursprotected void writeMetadata(AbstractChartWriter.Context context, MetadataOuterClass.MetadataOrBuilder metadata) throws IOException
AbstractChartWriter.write(Context,
ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
method has been invoked and it
is time to write a relevant MetadataOuterClass.MetadataOrBuilder
object.
The AbstractArchiveChartWriter
implementation writes
the YAML representation of
the supplied MetadataOuterClass.MetadataOrBuilder
to an appropriate archive
entry named Chart.yaml
within the current chart path.
writeMetadata
in class AbstractChartWriter
context
- the AbstractChartWriter.Context
representing the write
operation; must not be null
metadata
- the MetadataOuterClass.MetadataOrBuilder
to write; must not
be null
NullPointerException
- if either context
or
metadata
is null
IOException
- if a write error occursprotected void writeConfig(AbstractChartWriter.Context context, ConfigOuterClass.ConfigOrBuilder config) throws IOException
AbstractChartWriter.write(Context,
ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
method has been invoked and it
is time to write a relevant ConfigOuterClass.ConfigOrBuilder
object.
This implementation writes the YAML representation of the supplied ConfigOuterClass.ConfigOrBuilder
to an appropriate archive entry named values.yaml
within the current chart path.
writeConfig
in class AbstractChartWriter
context
- the AbstractChartWriter.Context
representing the write
operation; must not be null
config
- the ConfigOuterClass.ConfigOrBuilder
to write; must not
be null
NullPointerException
- if context
is null
IOException
- if a write error occursprotected void writeTemplate(AbstractChartWriter.Context context, TemplateOuterClass.TemplateOrBuilder template) throws IOException
AbstractChartWriter.write(Context,
ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
method has been invoked and it
is time to write a relevant TemplateOuterClass.TemplateOrBuilder
object.
This implementation writes the data of the supplied TemplateOuterClass.TemplateOrBuilder
to an appropriate archive entry named in part
by the return value of the TemplateOuterClass.TemplateOrBuilder.getName()
method within the current chart path.
writeTemplate
in class AbstractChartWriter
context
- the AbstractChartWriter.Context
representing the write
operation; must not be null
template
- the TemplateOuterClass.TemplateOrBuilder
to write; must not
be null
NullPointerException
- if context
is null
IOException
- if a write error occursprotected void writeFile(AbstractChartWriter.Context context, AnyOrBuilder file) throws IOException
AbstractChartWriter.write(Context,
ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
method has been invoked and it
is time to write a relevant AnyOrBuilder
object
(representing an otherwise undifferentiated Helm chart file).
This implementation writes the contents of the supplied AnyOrBuilder
to an appropriate archive entry named in part by
the return value of the AnyOrBuilder.getTypeUrl()
method
within the current chart path.
writeFile
in class AbstractChartWriter
context
- the AbstractChartWriter.Context
representing the write
operation; must not be null
file
- the AnyOrBuilder
to write; must not be null
NullPointerException
- if context
is null
IOException
- if a write error occursprotected void endWrite(AbstractChartWriter.Context context, ChartOuterClass.ChartOrBuilder parent, ChartOuterClass.ChartOrBuilder chartBuilder) throws IOException
AbstractChartWriter.write(Context,
ChartOuterClass.ChartOrBuilder, ChartOuterClass.ChartOrBuilder)
method has been invoked and it
is time to end the write operation.
The default implementation of this method does nothing.
This implementation ensures that the current chart path,
residing under the "path
" key in the supplied AbstractChartWriter.Context
, is reset properly.
endWrite
in class AbstractChartWriter
context
- the AbstractChartWriter.Context
representing the write
operation; must not be null
parent
- the ChartOuterClass.ChartOrBuilder
representing the Helm
chart that parents the chartBuilder
parameter value; may be,
and often is, null
chartBuilder
- the ChartOuterClass.ChartOrBuilder
representing the
chart currently involved in the write operation; must not be
null
NullPointerException
- if either context
or
chartBuilder
is null
IOException
- if a write error occursprotected abstract void writeEntry(AbstractChartWriter.Context context, String path, String contents) throws IOException
contents
to an appropriate archive
entry that is expected to be suffixed with the supplied path
in the context of the write operation described by the
supplied Context
.context
- the Context
describing the write operation
in effect; must not be null
path
- the path within an abstract archive to write;
interpreted as being relative to the current notional chart path,
whatever that might be; must not be null
or emptycontents
- the contents to write; must not be null
IOException
- if a write error occursNullPointerException
- if context
, path
or contents
is null
IllegalArgumentException
- if path
is emptyCopyright © 2017–2018, microBean. All rights reserved.