net.sf.advjavacalendar.data
Class DataRegistry

java.lang.Object
  extended by net.sf.advjavacalendar.data.DataRegistry

public class DataRegistry
extends java.lang.Object

Registry class for register all types of data elements which provide access to calendar items

Author:
probstl

Constructor Summary
protected DataRegistry()
          Private constructor
 
Method Summary
 void addDataEventListener(DataEventListener listener)
          Register a new listener for changes in the data registry
 void delete(CalendarItem item)
          Removes an element from the registry
 void delete(java.lang.String data, CalendarItem item)
          Removes an element from the registry
protected  void fireDataInsertedEvent(CalendarItem item)
          The given item has been added to the registry, notify all listeners
protected  void fireDataReleoadEvent()
          Data in the registry has been completeley reloaded.
static DataRegistry getInstance()
          Returns the singleton instance of the registry
 java.util.List<CalendarItem> getItems()
          Retrieves the collected items over all data elements
 void init()
          Initialize the elements of the registry
 void insert(CalendarItem item)
          Creates a new element in the registry
 void insert(java.lang.String data, CalendarItem item)
          Creates a new element in the given data registry
 void removeDataEventListener(DataEventListener listener)
          Unregister a new listener for changes in the data registry
 void searchItems(java.lang.String searchString)
          Searches an element in the registry.
 void start()
          Starts all elements in the registry.
 void stop()
          Stops all elements in the registry.
 void update(CalendarItem item)
          Changes an element in the registry
 void update(java.lang.String data, CalendarItem item)
          Changes an element in the given data registry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataRegistry

protected DataRegistry()
Private constructor

Method Detail

getInstance

public static DataRegistry getInstance()
Returns the singleton instance of the registry

Returns:

getItems

public java.util.List<CalendarItem> getItems()
Retrieves the collected items over all data elements

Returns:

addDataEventListener

public void addDataEventListener(DataEventListener listener)
Register a new listener for changes in the data registry

Parameters:
listener -

removeDataEventListener

public void removeDataEventListener(DataEventListener listener)
Unregister a new listener for changes in the data registry

Parameters:
listener -

init

public void init()
Initialize the elements of the registry


stop

public void stop()
Stops all elements in the registry. The method is automatically called on shutting down the application


start

public void start()
Starts all elements in the registry. The method is called just after initializing all elements in the registry


searchItems

public void searchItems(java.lang.String searchString)
                 throws DataException
Searches an element in the registry. After the search all listeners are notified.

Parameters:
searchString -
Throws:
DataException

delete

public void delete(CalendarItem item)
            throws DataException
Removes an element from the registry

Parameters:
item -
Throws:
DataException

insert

public void insert(CalendarItem item)
            throws DataException
Creates a new element in the registry

Parameters:
item -
Throws:
DataException

update

public void update(CalendarItem item)
            throws DataException
Changes an element in the registry

Parameters:
item -
Throws:
DataException

delete

public void delete(java.lang.String data,
                   CalendarItem item)
            throws DataException
Removes an element from the registry

Parameters:
data -
item -
Throws:
DataException

insert

public void insert(java.lang.String data,
                   CalendarItem item)
            throws DataException
Creates a new element in the given data registry

Parameters:
data -
item -
Throws:
DataException

update

public void update(java.lang.String data,
                   CalendarItem item)
            throws DataException
Changes an element in the given data registry

Parameters:
data -
item -
Throws:
DataException

fireDataInsertedEvent

protected void fireDataInsertedEvent(CalendarItem item)
The given item has been added to the registry, notify all listeners

Parameters:
item -

fireDataReleoadEvent

protected void fireDataReleoadEvent()
Data in the registry has been completeley reloaded. Notify all registred listeners.



Copyright © 2008 null. All Rights Reserved.