info.aduna.gee.publication.net
Class WStorable

java.lang.Object
  extended by info.aduna.gee.publication.net.WStorable
Direct Known Subclasses:
CLabelDefinitions, Config, Database, Generator, Local, SubscriptionDefinitions

public abstract class WStorable
extends Object


Field Summary
protected  boolean _isStorable
           
protected  long _lastModified
          The last modified date returned by the server at loading time
static char BASE64ENCODING
           
static char GZIPCOMPRESSION
           
static char NONE
           
static char WLZ77COMPRESSION
           
 
Constructor Summary
WStorable()
           
 
Method Summary
abstract  Object clone()
          Clone the storable object.
 void destroy()
          Destroy yourself, i.e.
 char getCompression()
          Get the Compression to be used on this storable.
 char getEncoding()
          Get the Encoding to be used on this storable.
 long getLastModified()
           
 char getVersion()
          Get the version number of the storable output.
 boolean isStorable()
          By default, any WStorable is storable (as it's name suggests).
abstract  void load(InputStream input, int version)
          Load the storable object from an inputstream.
 void setLastModified(long lm)
          Keep the Last Modified Time in Seconds!
 void setStorable(boolean isStorable)
          By default, any WStorable is storable (as it's name suggests).
abstract  void store(OutputStream output)
          Store the storable to an output stream.
static long toSeconds(long time)
          Adapt the Last Modified Time to seconds.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_lastModified

protected long _lastModified
The last modified date returned by the server at loading time


NONE

public static final char NONE
See Also:
Constant Field Values

BASE64ENCODING

public static final char BASE64ENCODING
See Also:
Constant Field Values

GZIPCOMPRESSION

public static final char GZIPCOMPRESSION
See Also:
Constant Field Values

WLZ77COMPRESSION

public static final char WLZ77COMPRESSION
See Also:
Constant Field Values

_isStorable

protected boolean _isStorable
Constructor Detail

WStorable

public WStorable()
Method Detail

setLastModified

public void setLastModified(long lm)
Keep the Last Modified Time in Seconds!


toSeconds

public static long toSeconds(long time)
Adapt the Last Modified Time to seconds. Some browser implementors were not reading the comments very good. They return the last Modified Time of a connection in Milliseconds.


getLastModified

public long getLastModified()
Returns:
the last modified time

store

public abstract void store(OutputStream output)
                    throws IOException
Store the storable to an output stream.

Parameters:
output - the output stream to store to.
Throws:
IOException

load

public abstract void load(InputStream input,
                          int version)
                   throws IOException
Load the storable object from an inputstream.

Parameters:
input - the input stream to load from.
version - the version of the input.
Throws:
IOException

getVersion

public char getVersion()
Get the version number of the storable output. By default getVersion returns '1'.

Returns:
a valid integer in the lower range.

getEncoding

public char getEncoding()
Get the Encoding to be used on this storable. By default, the BASE64ENCODING is used.


getCompression

public char getCompression()
Get the Compression to be used on this storable. By default, the GZIPCOMPRESSION is used.


destroy

public void destroy()
Destroy yourself, i.e. free all resources involved. For almost all WStorable's the destroy will be empty.


isStorable

public boolean isStorable()
By default, any WStorable is storable (as it's name suggests). However, subclasses of WStorable might be non storable.


setStorable

public void setStorable(boolean isStorable)
By default, any WStorable is storable (as it's name suggests). However, even individual WStorable's might choose to be non-storable.


clone

public abstract Object clone()
Clone the storable object.

Overrides:
clone in class Object
Returns:
an object of the same type that is a thread-safe clone.


Copyright © 1997-2008 Aduna. All Rights Reserved.