public class CacheEntry extends Object implements Externalizable
StringRepresentation
or ByteArrayRepresentation
instances can
be created.
Instances are not thread safe.
Cache
,
Serialized FormConstructor and Description |
---|
CacheEntry()
Constructor.
|
CacheEntry(byte[] bytes)
Deserializing construction.
|
CacheEntry(byte[] bytes,
MediaType mediaType,
Language language,
CharacterSet characterSet,
Encoding encoding,
Series<Header> headers,
Date modificationDate,
Tag tag,
Date expirationDate,
Date documentModificationDate)
Constructor.
|
CacheEntry(byte[] bytes,
MediaType mediaType,
Language language,
CharacterSet characterSet,
Encoding encoding,
Series<Header> headers,
long modificationTimestamp,
Tag tag,
long expirationTimestamp,
long documentModificationTimestamp)
Constructor.
|
CacheEntry(CacheEntry cacheEntry,
Encoding encoding)
Construction with re-encoding.
|
CacheEntry(CacheEntry cacheEntry,
String string)
Construction with different string.
|
CacheEntry(Representation representation,
Series<Header> headers,
long modificationTimestamp,
Tag tag,
long expirationTimestamp,
long documentModificationTimestamp)
Constructor.
|
CacheEntry(String string,
MediaType mediaType,
Language language,
CharacterSet characterSet,
Encoding encoding,
Series<Header> headers,
Date modificationDate,
Tag tag,
Date expirationDate,
Date documentModificationDate)
Constructor.
|
CacheEntry(String string,
MediaType mediaType,
Language language,
CharacterSet characterSet,
Encoding encoding,
Series<Header> headers,
long modificationTimestamp,
Tag tag,
long expirationTimestamp,
long documentModificationTimestamp)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes() |
CharacterSet |
getCharacterSet() |
Date |
getDocumentModificationDate() |
Encoding |
getEncoding() |
Date |
getExpirationDate() |
Series<Header> |
getHeaders() |
RepresentationInfo |
getInfo()
Create a
RepresentationInfo . |
Language |
getLanguage() |
MediaType |
getMediaType() |
Date |
getModificationDate() |
int |
getSize() |
String |
getString() |
Tag |
getTag() |
String[] |
getTags() |
void |
readExternal(ObjectInput in) |
Representation |
represent()
Creates a
StringRepresentation or a
ByteArrayRepresentation . |
void |
setTags(String[] tags) |
byte[] |
toBytes()
Serialize into a byte array.
|
void |
writeExternal(ObjectOutput out) |
public CacheEntry()
Externalizable
.public CacheEntry(CacheEntry cacheEntry, Encoding encoding) throws IOException
cacheEntry
- The cache entry to clone (must be un-encoded)encoding
- The new encoding to useIOException
- In case of a compression errorpublic CacheEntry(CacheEntry cacheEntry, String string) throws IOException
cacheEntry
- The cache entry to clonestring
- The new string to useIOException
- In case of a compression errorpublic CacheEntry(String string, MediaType mediaType, Language language, CharacterSet characterSet, Encoding encoding, Series<Header> headers, Date modificationDate, Tag tag, Date expirationDate, Date documentModificationDate) throws IOException
string
- The stringmediaType
- The media typelanguage
- The languagecharacterSet
- The character setencoding
- The encodingheaders
- The headersmodificationDate
- The modification date or nulltag
- The tagexpirationDate
- The expiration datedocumentModificationDate
- The document modification dateIOException
- In case of a compression errorpublic CacheEntry(byte[] bytes, MediaType mediaType, Language language, CharacterSet characterSet, Encoding encoding, Series<Header> headers, Date modificationDate, Tag tag, Date expirationDate, Date documentModificationDate)
bytes
- The bytesmediaType
- The media typelanguage
- The languagecharacterSet
- The character setencoding
- The encodingheaders
- The headersmodificationDate
- The modification date or nulltag
- The tagexpirationDate
- The expiration datedocumentModificationDate
- The document modification datepublic CacheEntry(String string, MediaType mediaType, Language language, CharacterSet characterSet, Encoding encoding, Series<Header> headers, long modificationTimestamp, Tag tag, long expirationTimestamp, long documentModificationTimestamp) throws IOException
string
- The stringmediaType
- The media typelanguage
- The languagecharacterSet
- The character setencoding
- The encodingheaders
- The headersmodificationTimestamp
- The modification timestamp or 0tag
- The tagexpirationTimestamp
- The expiration timestamp or 0 for no expirationdocumentModificationTimestamp
- The document modification timestampIOException
- In case of a compression errorpublic CacheEntry(byte[] bytes, MediaType mediaType, Language language, CharacterSet characterSet, Encoding encoding, Series<Header> headers, long modificationTimestamp, Tag tag, long expirationTimestamp, long documentModificationTimestamp)
bytes
- The bytesmediaType
- The media typelanguage
- The languagecharacterSet
- The character setencoding
- The encodingheaders
- The headersmodificationTimestamp
- The modification timestamp or 0tag
- The tagexpirationTimestamp
- The expiration timestamp or 0 for no expirationdocumentModificationTimestamp
- The document modification timestamppublic CacheEntry(Representation representation, Series<Header> headers, long modificationTimestamp, Tag tag, long expirationTimestamp, long documentModificationTimestamp) throws IOException
representation
- The representationheaders
- The headersmodificationTimestamp
- The modification timestamp or 0tag
- The tagexpirationTimestamp
- The expiration timestamp or 0 for no expirationdocumentModificationTimestamp
- The document modification timestampIOException
- In case of a compression errorpublic CacheEntry(byte[] bytes) throws IOException, ClassNotFoundException
bytes
- An array of bytesIOException
- In case of a reading errorClassNotFoundException
- In case an unknown class has been serializedtoBytes()
public String[] getTags()
public void setTags(String[] tags)
public String getString()
public byte[] getBytes()
public int getSize()
public MediaType getMediaType()
public Language getLanguage()
public CharacterSet getCharacterSet()
public Encoding getEncoding()
public Tag getTag()
public Date getDocumentModificationDate()
public Date getModificationDate()
public Date getExpirationDate()
public byte[] toBytes() throws IOException
Note that unlike IoUtil.serialize(Object)
, this will not include
the type header.
IOException
- In case of a serialization errorCacheEntry(byte[])
public Representation represent()
StringRepresentation
or a
ByteArrayRepresentation
.Representation
public RepresentationInfo getInfo()
RepresentationInfo
.RepresentationInfo
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Copyright © 2009-2016 Three Crickets LLC.