javacommons/javastorage/src/client/javastorageimpl.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  JavaStorageImpl
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef JAVASTORAGEIMPL_H
       
    20 #define JAVASTORAGEIMPL_H
       
    21 
       
    22 #include <string>
       
    23 #include <memory>
       
    24 
       
    25 #include "javastorage.h"
       
    26 #include "javastorageentry.h"
       
    27 
       
    28 namespace java
       
    29 {
       
    30 namespace storage
       
    31 {
       
    32 class MessageDispatcher;
       
    33 
       
    34 /**
       
    35  * JavaStorageImpl implements JavaStorage interface. This class takes care of
       
    36  * connection status handling.
       
    37  */
       
    38 OS_NONSHARABLE_CLASS(JavaStorageImpl) : public JavaStorage
       
    39 {
       
    40 
       
    41     friend class JavaStorage;
       
    42 
       
    43 public:
       
    44     OS_IMPORT virtual ~JavaStorageImpl();
       
    45 
       
    46     OS_IMPORT virtual void open() throw(JavaStorageException);
       
    47 
       
    48     OS_IMPORT virtual void open(const std::string& aStorageName)
       
    49     throw(JavaStorageException);
       
    50 
       
    51     OS_IMPORT virtual void close() throw(JavaStorageException);
       
    52 
       
    53     OS_IMPORT virtual void startTransaction() throw(JavaStorageException);
       
    54 
       
    55     OS_IMPORT virtual void commitTransaction() throw(JavaStorageException);
       
    56 
       
    57     OS_IMPORT virtual void rollbackTransaction() throw(JavaStorageException);
       
    58 
       
    59     OS_IMPORT virtual void read(
       
    60         const std::string& aTablename,
       
    61         const java::util::Uid& aUid,
       
    62         JavaStorageApplicationEntry_t& aEntries) throw(JavaStorageException);
       
    63 
       
    64     OS_IMPORT virtual void write(
       
    65         const std::string& aTablename,
       
    66         const JavaStorageApplicationEntry_t& aEntries
       
    67     ) throw(JavaStorageException);
       
    68 
       
    69     OS_IMPORT virtual void update(
       
    70         const std::string& aTablename,
       
    71         const JavaStorageApplicationEntry_t& aUpdateEntry,
       
    72         const JavaStorageApplicationEntry_t& aMatchEntry
       
    73     ) throw(JavaStorageException);
       
    74 
       
    75     OS_IMPORT virtual void search(
       
    76         const std::string& aTablename,
       
    77         const JavaStorageApplicationEntry_t& aSearchPattern,
       
    78         JavaStorageApplicationList_t& aApplicationList
       
    79     ) throw(JavaStorageException);
       
    80 
       
    81     OS_IMPORT virtual int remove(
       
    82         const std::string& aTablename,
       
    83         const JavaStorageApplicationEntry_t& aRemoveQuery
       
    84     ) throw(JavaStorageException);
       
    85 
       
    86     OS_IMPORT virtual void createTable(
       
    87         const std::string& aTablename,
       
    88         const JavaStorageApplicationEntry_t& aTableColumns
       
    89     ) throw(JavaStorageException);
       
    90 
       
    91     OS_IMPORT virtual void appendTable(
       
    92         const std::string& aTablename,
       
    93         const JavaStorageApplicationEntry_t& aTableColumns
       
    94     ) throw(JavaStorageException);
       
    95 
       
    96 private:
       
    97     JavaStorageImpl();
       
    98 
       
    99 private:
       
   100     std::auto_ptr<MessageDispatcher> mMsgDispatcher;
       
   101     std::string mSessionID;
       
   102     int mConnectionStatus;
       
   103     int mTransactionStatus;
       
   104 };
       
   105 
       
   106 } // end namespace storage
       
   107 } // end namespace java
       
   108 
       
   109 #endif // JAVASTORAGEIMPL_H
       
   110