Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.data
Class NamedBlob

java.lang.Object
  extended by ch.elexis.data.PersistentObject
      extended by ch.elexis.data.NamedBlob
All Implemented Interfaces:
IPersistentObject, ISelectable

public class NamedBlob
extends PersistentObject

A named Blob is just that: An arbitrarly named piece of arbitrary data. The name must be unique (among NamedBlobs). We provide methods to store and retrieve data as Hashtables and Strings (Both will be stored in zip-compressed form)

Author:
Gerry

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.elexis.data.PersistentObject
PersistentObject.FieldType
 
Field Summary
static java.lang.String CONTENTS
           
static java.lang.String TABLENAME
           
 
Fields inherited from class ch.elexis.data.PersistentObject
CACHE_DEFAULT_LIFETIME, CACHE_MIN_LIFETIME, CFG_CONNECTSTRING, CFG_DRIVER, CFG_PWD, CFG_TYPE, CFG_USER, DELETED, EXISTS, INEXISTENT, INVALID_ID, MATCH_AUTO, MATCH_CONTAINS, MATCH_EXACT, MATCH_REGEXP, MATCH_START
 
Fields inherited from interface ch.elexis.core.data.IPersistentObject
FLD_DATE, FLD_DELETED, FLD_EXTINFO, FLD_ID, FLD_LASTUPDATE, STATE_EXISTING, STATE_INEXISTENT, STATE_INVALID_ID
 
Method Summary
static void cleanup(java.lang.String prefix, TimeTool older)
          remove all BLOBS with a given name prefix and a last write time older than the given value needs the administrative right AC_PURGE
static void createTable()
           
static boolean exists(java.lang.String id)
          Ask if this NamedBlob exists
static java.util.List<NamedBlob> findFromPrefix(java.lang.String prefix)
          find all NamedBlox with a name with a given prefix.
static java.util.List<NamedBlob> findSimilar(java.lang.String name)
          Find all namedBlobs whose name match the given regular expression
 java.util.Hashtable getHashtable()
          return the contents as Hashtable (will probably fail if the data was not stored using put(Hashtable)
 java.lang.String getLabel()
          Einen menschenlesbaren Identifikationsstring für dieses Objet liefern
 java.lang.String getString()
          return the contents as String (will probably fail if the data was not stored using putString)
static NamedBlob load(java.lang.String id)
          Load or create a NamedBlob with a given Name.
 void put(java.util.Hashtable in)
          Put the contents as Hashtable.
 void putString(java.lang.String string)
          Store a String.
 
Methods inherited from class ch.elexis.data.PersistentObject
addChangeListener, addSticker, addToList, addXid, begin, checkNull, checkZero, checkZeroDouble, clearCache, connect, connect, delete, deleteList, disconnect, equals, executeSQLScript, exists, exportData, fireChangeEvent, flatten, fold, get, get, getCacheTime, getConnection, getDefaultCacheLifetime, getFieldType, getId, getInt, getLastUpdate, getList, getList, getMap, getSticker, getStickers, getWrappedId, getXid, getXid, getXids, hashCode, isAvailable, isDeleted, isDragOK, isMatching, isMatching, isMatching, isMatching, isShowDeleted, isValid, lock, map, relock, removeChangeListener, removeFromList, removeFromList, removeSticker, resetCache, set, set, setDefaultCacheLifetime, setInt, setMap, setShowDeleted, setTrace, state, storeToString, tableExists, ts, undelete, unlock
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLENAME

public static final java.lang.String TABLENAME
See Also:
Constant Field Values

CONTENTS

public static final java.lang.String CONTENTS
See Also:
Constant Field Values
Method Detail

getHashtable

public java.util.Hashtable getHashtable()
return the contents as Hashtable (will probably fail if the data was not stored using put(Hashtable)

Returns:
the previously stored Hashtable

put

public void put(java.util.Hashtable in)
Put the contents as Hashtable. The Hashtable will be compressed

Parameters:
in - a Hashtable

getString

public java.lang.String getString()
return the contents as String (will probably fail if the data was not stored using putString)

Returns:
the previously stored string.

putString

public void putString(java.lang.String string)
Store a String. The String will be stored as compressed byte[]

Parameters:
string -

getLabel

public java.lang.String getLabel()
Description copied from class: PersistentObject
Einen menschenlesbaren Identifikationsstring für dieses Objet liefern

Specified by:
getLabel in interface IPersistentObject
Specified by:
getLabel in class PersistentObject

exists

public static boolean exists(java.lang.String id)
Ask if this NamedBlob exists

Parameters:
id - the unique name of the NamedBlob to query
Returns:
true if a NamedBlob with this name exists

load

public static NamedBlob load(java.lang.String id)
Load or create a NamedBlob with a given Name. Caution: This will never return an inexistent NamedBlob, because it will be created if necessary. Use exists() to check, whether a NamedBlob exists.

Parameters:
id - the unique name
Returns:
the NamedBlob with that Name (which may be just newly created)

findFromPrefix

public static java.util.List<NamedBlob> findFromPrefix(java.lang.String prefix)
find all NamedBlox with a name with a given prefix. Muxh faster than findSimilar.

Parameters:
prefix - the orefix to look for
Returns:
list with all NamedBlobs wohse name matches (case sensitively) the prefix

findSimilar

public static java.util.List<NamedBlob> findSimilar(java.lang.String name)
Find all namedBlobs whose name match the given regular expression

Parameters:
name - a regular expression to match
Returns:
a list of all NamedBlobs with a name that matches the regular expression

cleanup

public static void cleanup(java.lang.String prefix,
                           TimeTool older)
remove all BLOBS with a given name prefix and a last write time older than the given value needs the administrative right AC_PURGE

Parameters:
prefix -
older -

createTable

public static void createTable()

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis