tigase.pubsub.repository
Class PubSubDAO

java.lang.Object
  extended by tigase.pubsub.repository.PubSubDAO
All Implemented Interfaces:
IPubSubDAO
Direct Known Subclasses:
PubSubDAOJDBC, PubSubDAOPool

public class PubSubDAO
extends Object
implements IPubSubDAO

Class description

Version:
5.0.0, 2010.03.27 at 05:19:00 GMT
Author:
Artur Hefczyc

Field Summary
static String CREATION_DATE_KEY
          Field description
protected  Logger log
           
static String NODES_KEY
          Field description
 
Constructor Summary
PubSubDAO(tigase.db.UserRepository repository, PubSubConfig pubSubConfig)
          Constructs ...
 
Method Summary
 void addToRootCollection(String nodeName)
          Method description
 void createNode(String nodeName, String ownerJid, AbstractNodeConfig nodeConfig, NodeType nodeType, String collection)
          Method description
 void deleteItem(String nodeName, String id)
          Method description
 void deleteNode(String nodeName)
          Method description
 void destroy()
          Method description
 String[] getBuddyGroups(tigase.xmpp.BareJID owner, String buddy)
          Method description
 String getBuddySubscription(tigase.xmpp.BareJID owner, String buddy)
          Method description
 tigase.xml.Element getItem(String nodeName, String id)
          Method description
 Date getItemCreationDate(String nodeName, String id)
          Method description
 String getItemPublisher(String nodeName, String id)
          Method description
 String[] getItemsIds(String nodeName)
          Method description
 Date getItemUpdateDate(String nodeName, String id)
          Method description
 NodeAffiliations getNodeAffiliations(String nodeName)
          Method description
<T extends AbstractNodeConfig>
T
getNodeConfig(Class<T> nodeConfigClass, String nodeName, tigase.form.Form configForm)
          Method description
 AbstractNodeConfig getNodeConfig(String nodeName)
          Method description
 Date getNodeCreationDate(String nodeName)
          Method description
 String[] getNodesList()
          Method description
 NodeSubscriptions getNodeSubscriptions(String nodeName)
          Method description
 String[] getRootNodes()
          Method description
 String[] getUserRoster(tigase.xmpp.BareJID owner)
          Method description
 void init()
          Method description
protected  tigase.xml.Element itemDataToElement(char[] data)
           
protected  String readNodeConfigFormData(String nodeName)
           
 void removeAllFromRootCollection()
          Method description
 void removeFromRootCollection(String nodeName)
          Method description
 void removeSubscriptions(String nodeName, int changedIndex)
          Method description
 void update(String nodeName, AbstractNodeConfig nodeConfig)
          Method description
 void update(String nodeName, IAffiliations affiliations)
          Method description
 void updateAffiliations(String nodeName, String serializedData)
          Method description
 void updateNodeConfig(String nodeName, String serializedData)
          Method description
 void updateSubscriptions(String nodeName, int changedIndex, String serializedData)
          Method description
 void writeItem(String nodeName, long timeInMilis, String id, String publisher, tigase.xml.Element item)
          Method description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATION_DATE_KEY

public static final String CREATION_DATE_KEY
Field description

See Also:
Constant Field Values

NODES_KEY

public static final String NODES_KEY
Field description

See Also:
Constant Field Values

log

protected Logger log
Constructor Detail

PubSubDAO

public PubSubDAO(tigase.db.UserRepository repository,
                 PubSubConfig pubSubConfig)
Constructs ...

Parameters:
repository -
pubSubConfig -
Method Detail

addToRootCollection

public void addToRootCollection(String nodeName)
                         throws RepositoryException
Method description

Specified by:
addToRootCollection in interface IPubSubDAO
Parameters:
nodeName -
Throws:
RepositoryException

createNode

public void createNode(String nodeName,
                       String ownerJid,
                       AbstractNodeConfig nodeConfig,
                       NodeType nodeType,
                       String collection)
                throws RepositoryException
Method description

Specified by:
createNode in interface IPubSubDAO
Parameters:
nodeName -
ownerJid -
nodeConfig -
nodeType -
collection -
Throws:
RepositoryException

deleteItem

public void deleteItem(String nodeName,
                       String id)
                throws RepositoryException
Method description

Specified by:
deleteItem in interface IPubSubDAO
Parameters:
nodeName -
id -
Throws:
RepositoryException

deleteNode

public void deleteNode(String nodeName)
                throws RepositoryException
Method description

Specified by:
deleteNode in interface IPubSubDAO
Parameters:
nodeName -
Throws:
RepositoryException

destroy

public void destroy()
Method description

Specified by:
destroy in interface IPubSubDAO

getBuddyGroups

public String[] getBuddyGroups(tigase.xmpp.BareJID owner,
                               String buddy)
                        throws RepositoryException
Method description

Specified by:
getBuddyGroups in interface IPubSubDAO
Parameters:
owner -
buddy -
Returns:
Throws:
RepositoryException

getBuddySubscription

public String getBuddySubscription(tigase.xmpp.BareJID owner,
                                   String buddy)
                            throws RepositoryException
Method description

Specified by:
getBuddySubscription in interface IPubSubDAO
Parameters:
owner -
buddy -
Returns:
Throws:
RepositoryException

getItem

public tigase.xml.Element getItem(String nodeName,
                                  String id)
                           throws RepositoryException
Method description

Specified by:
getItem in interface IPubSubDAO
Parameters:
nodeName -
id -
Returns:
Throws:
RepositoryException

getItemCreationDate

public Date getItemCreationDate(String nodeName,
                                String id)
                         throws RepositoryException
Method description

Specified by:
getItemCreationDate in interface IPubSubDAO
Parameters:
nodeName -
id -
Returns:
Throws:
RepositoryException

getItemPublisher

public String getItemPublisher(String nodeName,
                               String id)
                        throws RepositoryException
Method description

Parameters:
nodeName -
id -
Returns:
Throws:
RepositoryException

getItemsIds

public String[] getItemsIds(String nodeName)
                     throws RepositoryException
Method description

Specified by:
getItemsIds in interface IPubSubDAO
Parameters:
nodeName -
Returns:
Throws:
RepositoryException

getItemUpdateDate

public Date getItemUpdateDate(String nodeName,
                              String id)
                       throws RepositoryException
Method description

Specified by:
getItemUpdateDate in interface IPubSubDAO
Parameters:
nodeName -
id -
Returns:
Throws:
RepositoryException

getNodeAffiliations

public NodeAffiliations getNodeAffiliations(String nodeName)
                                     throws RepositoryException
Method description

Specified by:
getNodeAffiliations in interface IPubSubDAO
Parameters:
nodeName -
Returns:
Throws:
RepositoryException

getNodeConfig

public <T extends AbstractNodeConfig> T getNodeConfig(Class<T> nodeConfigClass,
                                                      String nodeName,
                                                      tigase.form.Form configForm)
                                           throws RepositoryException
Method description

Type Parameters:
T -
Parameters:
nodeConfigClass -
nodeName -
configForm -
Returns:
Throws:
RepositoryException

getNodeConfig

public AbstractNodeConfig getNodeConfig(String nodeName)
                                 throws RepositoryException
Method description

Specified by:
getNodeConfig in interface IPubSubDAO
Parameters:
nodeName -
Returns:
Throws:
RepositoryException

getNodeCreationDate

public Date getNodeCreationDate(String nodeName)
                         throws RepositoryException
Method description

Parameters:
nodeName -
Returns:
Throws:
RepositoryException

getNodesList

public String[] getNodesList()
                      throws RepositoryException
Method description

Specified by:
getNodesList in interface IPubSubDAO
Returns:
Throws:
RepositoryException

getNodeSubscriptions

public NodeSubscriptions getNodeSubscriptions(String nodeName)
                                       throws RepositoryException
Method description

Specified by:
getNodeSubscriptions in interface IPubSubDAO
Parameters:
nodeName -
Returns:
Throws:
RepositoryException

getRootNodes

public String[] getRootNodes()
                      throws RepositoryException
Method description

Specified by:
getRootNodes in interface IPubSubDAO
Returns:
Throws:
RepositoryException

getUserRoster

public String[] getUserRoster(tigase.xmpp.BareJID owner)
                       throws RepositoryException
Method description

Specified by:
getUserRoster in interface IPubSubDAO
Parameters:
owner -
Returns:
Throws:
RepositoryException

init

public void init()
          throws RepositoryException
Method description

Specified by:
init in interface IPubSubDAO
Throws:
RepositoryException

itemDataToElement

protected tigase.xml.Element itemDataToElement(char[] data)

readNodeConfigFormData

protected String readNodeConfigFormData(String nodeName)
                                 throws tigase.db.TigaseDBException
Throws:
tigase.db.TigaseDBException

removeAllFromRootCollection

public void removeAllFromRootCollection()
                                 throws RepositoryException
Method description

Throws:
RepositoryException

removeFromRootCollection

public void removeFromRootCollection(String nodeName)
                              throws RepositoryException
Method description

Specified by:
removeFromRootCollection in interface IPubSubDAO
Parameters:
nodeName -
Throws:
RepositoryException

removeSubscriptions

public void removeSubscriptions(String nodeName,
                                int changedIndex)
                         throws RepositoryException
Method description

Parameters:
nodeName -
changedIndex -
Throws:
RepositoryException

update

public void update(String nodeName,
                   AbstractNodeConfig nodeConfig)
            throws RepositoryException
Method description

Specified by:
update in interface IPubSubDAO
Parameters:
nodeName -
nodeConfig -
Throws:
RepositoryException

update

public void update(String nodeName,
                   IAffiliations affiliations)
            throws RepositoryException
Method description

Specified by:
update in interface IPubSubDAO
Parameters:
nodeName -
affiliations -
Throws:
RepositoryException

updateAffiliations

public void updateAffiliations(String nodeName,
                               String serializedData)
                        throws RepositoryException
Method description

Parameters:
nodeName -
serializedData -
Throws:
RepositoryException

updateNodeConfig

public void updateNodeConfig(String nodeName,
                             String serializedData)
                      throws RepositoryException
Method description

Parameters:
nodeName -
serializedData -
Throws:
RepositoryException

updateSubscriptions

public void updateSubscriptions(String nodeName,
                                int changedIndex,
                                String serializedData)
                         throws RepositoryException
Method description

Parameters:
nodeName -
changedIndex -
serializedData -
Throws:
RepositoryException

writeItem

public void writeItem(String nodeName,
                      long timeInMilis,
                      String id,
                      String publisher,
                      tigase.xml.Element item)
               throws RepositoryException
Method description

Specified by:
writeItem in interface IPubSubDAO
Parameters:
nodeName -
timeInMilis -
id -
publisher -
item -
Throws:
RepositoryException


Copyright © 2008-2012 Tigase. All Rights Reserved.