com.partnersoft.v3x.io
Class AsynchronousStreamCopy

java.lang.Object
  extended by com.partnersoft.v3x.io.AsynchronousStreamCopy
All Implemented Interfaces:
java.io.Serializable

public class AsynchronousStreamCopy
extends java.lang.Object
implements java.io.Serializable

A single AsynchronousStreamCopy job. Includes all state of such a copy, plus methods to wait on a copy to finish etc., verify that it succeeded, etc.

See Also:
Serialized Form

Constructor Summary
AsynchronousStreamCopy()
          Create a new AsynchronousStreamCopy.
AsynchronousStreamCopy(AsynchronousStreamCopyManager manager, java.lang.String name, long byteCount, long checksum)
          Create a new AsynchronousStreamCopy.
 
Method Summary
 long getByteCount()
          Expected byteCount of copy.
 long getChecksum()
          Expected CRC32 of bytes.
 boolean getComplete()
          Transfer completed flag.
 java.lang.Throwable getException()
          If transfer failed is true, this is the reason why.
 boolean getFailed()
          Transfer failed flag.
 java.io.InputStream getInputStream()
          to copy from (null until ready).
 java.lang.String getName()
          Descriptive name for copy (e.g.
 java.io.OutputStream getOutputStream()
          to copy to (null until ready).
 boolean isReady()
           
 void performCopy()
          Performs the copy.
 void setByteCount(long newByteCount)
          Expected byteCount of copy.
 void setChecksum(long newChecksum)
          Expected CRC32 of bytes.
 void setComplete(boolean newComplete)
          Transfer completed flag.
 void setException(java.lang.Throwable newException)
          If transfer failed is true, this is the reason why.
 void setFailed(boolean newFailed)
          Transfer failed flag.
 void setInputStream(java.io.InputStream newInputStream)
          to copy from (null until ready).
 void setName(java.lang.String newName)
          Descriptive name for copy (e.g.
 void setOutputStream(java.io.OutputStream newOutputStream)
          to copy to (null until ready).
 java.lang.String toString()
           
 void waitForCompletion()
          Blocks until copy completes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AsynchronousStreamCopy

public AsynchronousStreamCopy()
Create a new AsynchronousStreamCopy.


AsynchronousStreamCopy

public AsynchronousStreamCopy(AsynchronousStreamCopyManager manager,
                              java.lang.String name,
                              long byteCount,
                              long checksum)
Create a new AsynchronousStreamCopy.

Method Detail

waitForCompletion

public void waitForCompletion()
Blocks until copy completes.


performCopy

public void performCopy()
Performs the copy.


isReady

public boolean isReady()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getChecksum

public long getChecksum()
Expected CRC32 of bytes.


setChecksum

public void setChecksum(long newChecksum)
Expected CRC32 of bytes.


getComplete

public boolean getComplete()
Transfer completed flag.


setComplete

public void setComplete(boolean newComplete)
Transfer completed flag.


getException

public java.lang.Throwable getException()
If transfer failed is true, this is the reason why.


setException

public void setException(java.lang.Throwable newException)
If transfer failed is true, this is the reason why.


getFailed

public boolean getFailed()
Transfer failed flag.


setFailed

public void setFailed(boolean newFailed)
Transfer failed flag.


getInputStream

public java.io.InputStream getInputStream()
to copy from (null until ready).


setInputStream

public void setInputStream(java.io.InputStream newInputStream)
to copy from (null until ready).


getName

public java.lang.String getName()
Descriptive name for copy (e.g. file path)


setName

public void setName(java.lang.String newName)
Descriptive name for copy (e.g. file path)


getOutputStream

public java.io.OutputStream getOutputStream()
to copy to (null until ready).


setOutputStream

public void setOutputStream(java.io.OutputStream newOutputStream)
to copy to (null until ready).


getByteCount

public long getByteCount()
Expected byteCount of copy.


setByteCount

public void setByteCount(long newByteCount)
Expected byteCount of copy.