com.funambol.exchange.items.common.dao
Class ItemDAO

java.lang.Object
  extended bycom.funambol.exchange.items.common.dao.ItemDAO
Direct Known Subclasses:
CalendarDAO, ContactDAO, NoteDAO, TaskDAO

public class ItemDAO
extends java.lang.Object


Field Summary
protected static java.lang.String FILE_ENCODING
           
protected static int INITIAL_SIZE_SBUFFER
           
protected static java.lang.String NEW_LINE
           
protected static java.lang.String PROP_NO_FOLDER
           
protected static java.lang.String TAG_CREATION_DATE
           
protected static java.lang.String TAG_HREF
           
protected static java.lang.String TAG_IS_FOLDER
           
static java.lang.String TAG_RESPONSE
           
protected static java.lang.String WEBDAV_HEADER_PROPPATCH
           
protected static java.lang.String WEBDAV_HEADER_REMOVE
           
protected static java.lang.String WEBDAV_HEADER_SELECT
           
 
Constructor Summary
ItemDAO()
           
ItemDAO(java.lang.String host, int port, java.lang.String exchangeServer)
           
 
Method Summary
 void addItems(Item[] items, java.lang.String sourceURI, long principal)
          add local items
protected  void checkResponseStatus(int status)
          Check response message from Exchange server
 void deleteItems(Item[] items, java.lang.String sourceURI, long principal)
          delete local items
static java.lang.String getClause(java.lang.String[] ids)
          Build a clause to webdav select request between ids item array
 int getExchangeAccessStatus(java.lang.String exchangeServerName, java.lang.String userName, java.lang.String credentials)
          get all sourceURI type items from Exchange Server
 java.lang.String getHref(java.lang.String id, long principal, java.lang.String sourceURI)
          get href
static java.lang.String getIdFromReplUid(java.lang.String replUid)
          Make a id from replid webdavtag.
 Item[] getLocalItems(java.lang.String sourceURI, long principal)
          get local items
protected  java.lang.String getResourceFromExchangeFolder(java.lang.String uri)
           
protected  java.lang.String getServerFromExchangeFolder(java.lang.String uri)
           
protected  int getStatusFromResponse(java.lang.String msg)
          get status from response message
 Item[] getTwins(long crc, long principalId, java.lang.String sourceURI)
          get twin
 void updateItems(Item[] items, java.lang.String sourceURI, long principal)
          add local items
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_SIZE_SBUFFER

protected static final int INITIAL_SIZE_SBUFFER
See Also:
Constant Field Values

FILE_ENCODING

protected static final java.lang.String FILE_ENCODING
See Also:
Constant Field Values

WEBDAV_HEADER_PROPPATCH

protected static final java.lang.String WEBDAV_HEADER_PROPPATCH
See Also:
Constant Field Values

WEBDAV_HEADER_REMOVE

protected static final java.lang.String WEBDAV_HEADER_REMOVE
See Also:
Constant Field Values

WEBDAV_HEADER_SELECT

protected static final java.lang.String WEBDAV_HEADER_SELECT
See Also:
Constant Field Values

TAG_HREF

protected static final java.lang.String TAG_HREF
See Also:
Constant Field Values

TAG_CREATION_DATE

protected static final java.lang.String TAG_CREATION_DATE
See Also:
Constant Field Values

TAG_IS_FOLDER

protected static final java.lang.String TAG_IS_FOLDER
See Also:
Constant Field Values

PROP_NO_FOLDER

protected static final java.lang.String PROP_NO_FOLDER
See Also:
Constant Field Values

NEW_LINE

protected static final java.lang.String NEW_LINE
See Also:
Constant Field Values

TAG_RESPONSE

public static final java.lang.String TAG_RESPONSE
See Also:
Constant Field Values
Constructor Detail

ItemDAO

public ItemDAO()
        throws DataAccessException

ItemDAO

public ItemDAO(java.lang.String host,
               int port,
               java.lang.String exchangeServer)
        throws DataAccessException
Method Detail

getLocalItems

public Item[] getLocalItems(java.lang.String sourceURI,
                            long principal)
                     throws DataAccessException
get local items

Parameters:
sourceURI -
principal -
Returns:
array of find local items
Throws:
DataAccessException

getHref

public java.lang.String getHref(java.lang.String id,
                                long principal,
                                java.lang.String sourceURI)
                         throws DataAccessException
get href

Parameters:
id -
principal -
sourceURI -
Returns:
href
Throws:
DataAccessException

addItems

public void addItems(Item[] items,
                     java.lang.String sourceURI,
                     long principal)
              throws DataAccessException
add local items

Parameters:
items -
sourceURI -
principal -
Throws:
DataAccessException

updateItems

public void updateItems(Item[] items,
                        java.lang.String sourceURI,
                        long principal)
                 throws DataAccessException
add local items

Parameters:
items -
sourceURI -
principal -
Throws:
DataAccessException

deleteItems

public void deleteItems(Item[] items,
                        java.lang.String sourceURI,
                        long principal)
                 throws DataAccessException
delete local items

Parameters:
sourceURI -
principal -
Throws:
DataAccessException

getTwins

public Item[] getTwins(long crc,
                       long principalId,
                       java.lang.String sourceURI)
                throws DataAccessException
get twin

Parameters:
crc -
principalId -
sourceURI -
Returns:
twin
Throws:
DataAccessException

getExchangeAccessStatus

public int getExchangeAccessStatus(java.lang.String exchangeServerName,
                                   java.lang.String userName,
                                   java.lang.String credentials)
                            throws DataAccessException
get all sourceURI type items from Exchange Server

Parameters:
exchangeServerName -
userName -
credentials -
Returns:
array of find items
Throws:
DataAccessException

getClause

public static java.lang.String getClause(java.lang.String[] ids)
Build a clause to webdav select request between ids item array

Parameters:
ids -
Returns:
webdav select clause

getIdFromReplUid

public static java.lang.String getIdFromReplUid(java.lang.String replUid)
                                         throws XmlParseException
Make a id from replid webdavtag.

Parameters:
replUid -
Returns:
id
Throws:
XmlParseException

getStatusFromResponse

protected int getStatusFromResponse(java.lang.String msg)
                             throws ExchangeAccessException
get status from response message

Parameters:
msg -
Throws:
ExchangeAccessException - in case of other errors

checkResponseStatus

protected void checkResponseStatus(int status)
                            throws AuthenticationException,
                                   ExchangeAccessException,
                                   com.funambol.framework.server.store.NotFoundException
Check response message from Exchange server

Parameters:
status - the status to be checked
Throws:
AuthenticationException - in case the request has not been authenticated by the server
ExchangeAccessException - in case of other errors
com.funambol.framework.server.store.NotFoundException

getServerFromExchangeFolder

protected java.lang.String getServerFromExchangeFolder(java.lang.String uri)

getResourceFromExchangeFolder

protected java.lang.String getResourceFromExchangeFolder(java.lang.String uri)


Copyright © 2003-2006 Funambol.