tigase.server.ext
Class CompSQLRepository

java.lang.Object
  extended by tigase.server.ext.CompSQLRepository
All Implemented Interfaces:
Iterable<CompRepoItem>, ComponentRepository<CompRepoItem>

public class CompSQLRepository
extends Object
implements ComponentRepository<CompRepoItem>

Created: Nov 7, 2009 11:26:10 AM

Version:
$Rev: 2996 $
Author:
Artur Hefczyc

Field Summary
static String REPO_URI_PROP_KEY
          Field description
static String TABLE_NAME
          Field description
 
Fields inherited from interface tigase.db.comp.ComponentRepository
COMP_REPO_BIND
 
Constructor Summary
CompSQLRepository()
           
 
Method Summary
 void addItem(CompRepoItem item)
          Method description
 void addRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
          Adds a listener for repository Item change.
 Collection<CompRepoItem> allItems()
          Method description
 boolean contains(String key)
          Method description
 void getDefaults(Map<String,Object> defs, Map<String,Object> params)
          Method description
 CompRepoItem getItem(String key)
          Method description
 CompRepoItem getItemInstance()
          Method description
 void initRepository(String conn_str, Map<String,String> params)
          Method description
 Iterator<CompRepoItem> iterator()
          Method description
 void reload()
          Method description
 void removeItem(String key)
          Method description
 void removeRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
          Removes a listener for repository Item change.
 void setProperties(Map<String,Object> properties)
          Method description
 int size()
          Method description
 void store()
          Method description
 String validateItem(CompRepoItem item)
          Method description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPO_URI_PROP_KEY

public static final String REPO_URI_PROP_KEY
Field description

See Also:
Constant Field Values

TABLE_NAME

public static final String TABLE_NAME
Field description

See Also:
Constant Field Values
Constructor Detail

CompSQLRepository

public CompSQLRepository()
Method Detail

addRepoChangeListener

public void addRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
Description copied from interface: ComponentRepository
Adds a listener for repository Item change.

Specified by:
addRepoChangeListener in interface ComponentRepository<CompRepoItem>

removeRepoChangeListener

public void removeRepoChangeListener(RepositoryChangeListenerIfc<CompRepoItem> repoChangeListener)
Description copied from interface: ComponentRepository
Removes a listener for repository Item change.

Specified by:
removeRepoChangeListener in interface ComponentRepository<CompRepoItem>

addItem

public void addItem(CompRepoItem item)
Method description

Specified by:
addItem in interface ComponentRepository<CompRepoItem>
Parameters:
item -

allItems

public Collection<CompRepoItem> allItems()
Method description

Specified by:
allItems in interface ComponentRepository<CompRepoItem>
Returns:

contains

public boolean contains(String key)
Method description

Specified by:
contains in interface ComponentRepository<CompRepoItem>
Parameters:
key -
Returns:

getDefaults

public void getDefaults(Map<String,Object> defs,
                        Map<String,Object> params)
Method description

Specified by:
getDefaults in interface ComponentRepository<CompRepoItem>
Parameters:
defs -
params -

getItem

public CompRepoItem getItem(String key)
Method description

Specified by:
getItem in interface ComponentRepository<CompRepoItem>
Parameters:
key -
Returns:

getItemInstance

public CompRepoItem getItemInstance()
Method description

Specified by:
getItemInstance in interface ComponentRepository<CompRepoItem>
Returns:

initRepository

public void initRepository(String conn_str,
                           Map<String,String> params)
                    throws SQLException
Method description

Parameters:
conn_str -
params -
Throws:
SQLException

iterator

public Iterator<CompRepoItem> iterator()
Method description

Specified by:
iterator in interface Iterable<CompRepoItem>
Returns:

reload

public void reload()
Method description

Specified by:
reload in interface ComponentRepository<CompRepoItem>

removeItem

public void removeItem(String key)
Method description

Specified by:
removeItem in interface ComponentRepository<CompRepoItem>
Parameters:
key -

setProperties

public void setProperties(Map<String,Object> properties)
Method description

Specified by:
setProperties in interface ComponentRepository<CompRepoItem>
Parameters:
properties -

size

public int size()
Method description

Specified by:
size in interface ComponentRepository<CompRepoItem>
Returns:

store

public void store()
Method description

Specified by:
store in interface ComponentRepository<CompRepoItem>

validateItem

public String validateItem(CompRepoItem item)
Method description

Specified by:
validateItem in interface ComponentRepository<CompRepoItem>
Parameters:
item -
Returns:


Copyright © 2012 Tigase. All Rights Reserved.