org.rhq.plugins.platform.content.yum
Class Content

java.lang.Object
  extended by org.rhq.plugins.platform.content.yum.Content
Direct Known Subclasses:
Package, Primary, Repomd

public abstract class Content
extends Object

The content class is the base class for yum file content. This includes the medatadata as well as the packages (rpms).

Author:
jortel

Field Summary
protected  byte[] bfr
          A stream copy buffer.
protected  org.apache.commons.logging.Log log
          Logger
protected  org.rhq.plugins.platform.content.yum.Request request
          The current yum request.
 
Constructor Summary
protected Content(org.rhq.plugins.platform.content.yum.Request request)
          Construct a new content object.
 
Method Summary
protected  YumContext context()
           
 void delete()
          Delete the local content artifact.
abstract  long length()
           
abstract  InputStream openStream()
           
protected  void transfer(InputStream istr, OutputStream ostr)
          Transfer bytes from the input stream to the output stream.
abstract  void writeContent(OutputStream ostr)
           
abstract  void writeHeader(OutputStream ostr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

protected org.rhq.plugins.platform.content.yum.Request request
The current yum request.


bfr

protected byte[] bfr
A stream copy buffer.


log

protected final org.apache.commons.logging.Log log
Logger

Constructor Detail

Content

protected Content(org.rhq.plugins.platform.content.yum.Request request)
Construct a new content object.

Parameters:
request - The request that is constructing the object.
Method Detail

length

public abstract long length()
                     throws Exception
Throws:
Exception

writeContent

public abstract void writeContent(OutputStream ostr)
                           throws Exception
Throws:
Exception

writeHeader

public abstract void writeHeader(OutputStream ostr)
                          throws Exception
Throws:
Exception

openStream

public abstract InputStream openStream()
                                throws Exception
Throws:
Exception

delete

public void delete()
Delete the local content artifact.


transfer

protected void transfer(InputStream istr,
                        OutputStream ostr)
                 throws IOException
Transfer bytes from the input stream to the output stream.

Parameters:
istr - An input stream.
ostr - An output stream.
Throws:
IOException - On all errors.

context

protected YumContext context()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.