org.apache.activemq.kaha.impl
Class KahaStore

java.lang.Object
  extended by org.apache.activemq.kaha.impl.KahaStore
All Implemented Interfaces:
Store

public class KahaStore
extends Object
implements Store

Store Implementation


Field Summary
 
Fields inherited from interface org.apache.activemq.kaha.Store
BYTES_MARSHALLER, COMMAND_MARSHALLER, DEFAULT_CONTAINER_NAME, MESSAGEID_MARSHALLER, OBJECT_MARSHALLER, STRING_MARSHALLER
 
Constructor Summary
KahaStore(File directory, String mode)
           
KahaStore(File directory, String mode, AtomicLong storeSize)
           
KahaStore(String name, String mode)
           
KahaStore(String name, String mode, AtomicLong storeSize)
           
 
Method Summary
 void clear()
          empty all the contents of the store
 void close()
          close the store
 boolean delete()
          delete the store
 void deleteListContainer(ContainerId containerId)
          delete a list container
 void deleteListContainer(Object id)
          delete a ListContainer from the default container
 void deleteListContainer(Object id, String containerName)
          delete a ListContainer from the named container
 void deleteMapContainer(ContainerId containerId)
          Delete Map container
 void deleteMapContainer(Object id)
          delete a container from the default container
 void deleteMapContainer(Object id, String containerName)
          delete a MapContainer from the name container
 boolean doesListContainerExist(Object id)
          Checks if a ListContainer exists in the default container
 boolean doesListContainerExist(Object id, String containerName)
          Checks if a ListContainer exists in the named container
 boolean doesMapContainerExist(Object id)
          Checks if a MapContainer exists in the default container
 boolean doesMapContainerExist(Object id, String containerName)
          Checks if a MapContainer exists in the named container
 void force()
          Force all writes to disk
 DataManager getDataManager(String name)
           
 String getDefaultContainerName()
           
 IndexManager getIndexManager(DataManager dm, String name)
           
 String getIndexTypeAsString()
           
 ListContainer getListContainer(Object id)
          Get a ListContainer with the given id and creates it if it doesn't exist
 ListContainer getListContainer(Object id, String containerName)
          Get a ListContainer with the given id and creates it if it doesn't exist
 ListContainer getListContainer(Object id, String containerName, boolean persistentIndex)
          Get a ListContainer with the given id and creates it if it doesn't exist
 Set<ContainerId> getListContainerIds()
          Get a Set of call ListContainer Ids
 org.apache.activemq.kaha.impl.IndexRootContainer getListsContainer()
           
 MapContainer getMapContainer(Object id)
          Get a MapContainer with the given id - the MapContainer is created if needed
 MapContainer getMapContainer(Object id, String containerName)
          Get a MapContainer with the given id - the MapContainer is created if needed
 MapContainer getMapContainer(Object id, String containerName, boolean persistentIndex)
          Get a MapContainer with the given id - the MapContainer is created if needed
 Set<ContainerId> getMapContainerIds()
          Get a Set of call MapContainer Ids
 org.apache.activemq.kaha.impl.IndexRootContainer getMapsContainer()
           
 long getMaxDataFileLength()
           
 void initialize()
          An explict call to initialize - this will also be called implicitly for any other operation on the store.
 boolean isInitialized()
           
 boolean isLogIndexChanges()
           
 boolean isPersistentIndex()
           
 boolean isUseAsyncDataManager()
           
 void setDefaultContainerName(String defaultContainerName)
          set the default container name
 void setIndexTypeAsString(String type)
          Set the default index type
 void setLogIndexChanges(boolean logIndexChanges)
           
 void setMaxDataFileLength(long maxDataFileLength)
           
 void setPersistentIndex(boolean persistentIndex)
          Set a persistent index as the default if the parameter is true
 void setUseAsyncDataManager(boolean useAsyncWriter)
           
 long size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KahaStore

public KahaStore(String name,
                 String mode)
          throws IOException
Throws:
IOException

KahaStore

public KahaStore(File directory,
                 String mode)
          throws IOException
Throws:
IOException

KahaStore

public KahaStore(String name,
                 String mode,
                 AtomicLong storeSize)
          throws IOException
Throws:
IOException

KahaStore

public KahaStore(File directory,
                 String mode,
                 AtomicLong storeSize)
          throws IOException
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Description copied from interface: Store
close the store

Specified by:
close in interface Store
Throws:
IOException

force

public void force()
           throws IOException
Description copied from interface: Store
Force all writes to disk

Specified by:
force in interface Store
Throws:
IOException

clear

public void clear()
           throws IOException
Description copied from interface: Store
empty all the contents of the store

Specified by:
clear in interface Store
Throws:
IOException

delete

public boolean delete()
               throws IOException
Description copied from interface: Store
delete the store

Specified by:
delete in interface Store
Returns:
true if the delete was successful
Throws:
IOException

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Store
Returns:
true if the store has been initialized

doesMapContainerExist

public boolean doesMapContainerExist(Object id)
                              throws IOException
Description copied from interface: Store
Checks if a MapContainer exists in the default container

Specified by:
doesMapContainerExist in interface Store
Returns:
new MapContainer
Throws:
IOException

doesMapContainerExist

public boolean doesMapContainerExist(Object id,
                                     String containerName)
                              throws IOException
Description copied from interface: Store
Checks if a MapContainer exists in the named container

Specified by:
doesMapContainerExist in interface Store
Returns:
new MapContainer
Throws:
IOException

getMapContainer

public MapContainer getMapContainer(Object id)
                             throws IOException
Description copied from interface: Store
Get a MapContainer with the given id - the MapContainer is created if needed

Specified by:
getMapContainer in interface Store
Returns:
container for the associated id or null if it doesn't exist
Throws:
IOException

getMapContainer

public MapContainer getMapContainer(Object id,
                                    String containerName)
                             throws IOException
Description copied from interface: Store
Get a MapContainer with the given id - the MapContainer is created if needed

Specified by:
getMapContainer in interface Store
Returns:
container for the associated id or null if it doesn't exist
Throws:
IOException

getMapContainer

public MapContainer getMapContainer(Object id,
                                    String containerName,
                                    boolean persistentIndex)
                             throws IOException
Description copied from interface: Store
Get a MapContainer with the given id - the MapContainer is created if needed

Specified by:
getMapContainer in interface Store
Returns:
container for the associated id or null if it doesn't exist
Throws:
IOException

deleteMapContainer

public void deleteMapContainer(Object id)
                        throws IOException
Description copied from interface: Store
delete a container from the default container

Specified by:
deleteMapContainer in interface Store
Throws:
IOException

deleteMapContainer

public void deleteMapContainer(Object id,
                               String containerName)
                        throws IOException
Description copied from interface: Store
delete a MapContainer from the name container

Specified by:
deleteMapContainer in interface Store
Throws:
IOException

deleteMapContainer

public void deleteMapContainer(ContainerId containerId)
                        throws IOException
Description copied from interface: Store
Delete Map container

Specified by:
deleteMapContainer in interface Store
Throws:
IOException

getMapContainerIds

public Set<ContainerId> getMapContainerIds()
                                    throws IOException
Description copied from interface: Store
Get a Set of call MapContainer Ids

Specified by:
getMapContainerIds in interface Store
Returns:
the set of ids
Throws:
IOException

doesListContainerExist

public boolean doesListContainerExist(Object id)
                               throws IOException
Description copied from interface: Store
Checks if a ListContainer exists in the default container

Specified by:
doesListContainerExist in interface Store
Returns:
new MapContainer
Throws:
IOException

doesListContainerExist

public boolean doesListContainerExist(Object id,
                                      String containerName)
                               throws IOException
Description copied from interface: Store
Checks if a ListContainer exists in the named container

Specified by:
doesListContainerExist in interface Store
Returns:
new MapContainer
Throws:
IOException

getListContainer

public ListContainer getListContainer(Object id)
                               throws IOException
Description copied from interface: Store
Get a ListContainer with the given id and creates it if it doesn't exist

Specified by:
getListContainer in interface Store
Returns:
container for the associated id or null if it doesn't exist
Throws:
IOException

getListContainer

public ListContainer getListContainer(Object id,
                                      String containerName)
                               throws IOException
Description copied from interface: Store
Get a ListContainer with the given id and creates it if it doesn't exist

Specified by:
getListContainer in interface Store
Returns:
container for the associated id or null if it doesn't exist
Throws:
IOException

getListContainer

public ListContainer getListContainer(Object id,
                                      String containerName,
                                      boolean persistentIndex)
                               throws IOException
Description copied from interface: Store
Get a ListContainer with the given id and creates it if it doesn't exist

Specified by:
getListContainer in interface Store
Returns:
container for the associated id or null if it doesn't exist
Throws:
IOException

deleteListContainer

public void deleteListContainer(Object id)
                         throws IOException
Description copied from interface: Store
delete a ListContainer from the default container

Specified by:
deleteListContainer in interface Store
Throws:
IOException

deleteListContainer

public void deleteListContainer(Object id,
                                String containerName)
                         throws IOException
Description copied from interface: Store
delete a ListContainer from the named container

Specified by:
deleteListContainer in interface Store
Throws:
IOException

deleteListContainer

public void deleteListContainer(ContainerId containerId)
                         throws IOException
Description copied from interface: Store
delete a list container

Specified by:
deleteListContainer in interface Store
Throws:
IOException

getListContainerIds

public Set<ContainerId> getListContainerIds()
                                     throws IOException
Description copied from interface: Store
Get a Set of call ListContainer Ids

Specified by:
getListContainerIds in interface Store
Returns:
the set of ids
Throws:
IOException

getListsContainer

public org.apache.activemq.kaha.impl.IndexRootContainer getListsContainer()
Returns:
the listsContainer

getMapsContainer

public org.apache.activemq.kaha.impl.IndexRootContainer getMapsContainer()
Returns:
the mapsContainer

getDataManager

public DataManager getDataManager(String name)
                           throws IOException
Throws:
IOException

getIndexManager

public IndexManager getIndexManager(DataManager dm,
                                    String name)
                             throws IOException
Throws:
IOException

isLogIndexChanges

public boolean isLogIndexChanges()

setLogIndexChanges

public void setLogIndexChanges(boolean logIndexChanges)

getMaxDataFileLength

public long getMaxDataFileLength()
Specified by:
getMaxDataFileLength in interface Store
Returns:
the maxDataFileLength

setMaxDataFileLength

public void setMaxDataFileLength(long maxDataFileLength)
Specified by:
setMaxDataFileLength in interface Store
Parameters:
maxDataFileLength - the maxDataFileLength to set

getIndexTypeAsString

public String getIndexTypeAsString()
Returns:
the default index type

setIndexTypeAsString

public void setIndexTypeAsString(String type)
Set the default index type

Parameters:
type - "PERSISTENT" or "VM"

isPersistentIndex

public boolean isPersistentIndex()
Specified by:
isPersistentIndex in interface Store
Returns:
true if persistent indexes are used by default

setPersistentIndex

public void setPersistentIndex(boolean persistentIndex)
Description copied from interface: Store
Set a persistent index as the default if the parameter is true

Specified by:
setPersistentIndex in interface Store

isUseAsyncDataManager

public boolean isUseAsyncDataManager()

setUseAsyncDataManager

public void setUseAsyncDataManager(boolean useAsyncWriter)

size

public long size()
Specified by:
size in interface Store
Returns:
size of store
See Also:
Store.size()

getDefaultContainerName

public String getDefaultContainerName()
Specified by:
getDefaultContainerName in interface Store
Returns:
the default container name

setDefaultContainerName

public void setDefaultContainerName(String defaultContainerName)
Description copied from interface: Store
set the default container name

Specified by:
setDefaultContainerName in interface Store

initialize

public void initialize()
                throws IOException
Description copied from interface: Store
An explict call to initialize - this will also be called implicitly for any other operation on the store.

Specified by:
initialize in interface Store
Throws:
IOException


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.