javamanager/javaregistry/legacy/server/inc/javaregserver.h
changeset 21 2a9601315dfc
child 23 98ccebc37403
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2005-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:  javaregserver definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef JAVAREGSERVER_H
       
    20 #define JAVAREGSERVER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "javaregdef.h"
       
    25 #include "javaregburstates.h"
       
    26 
       
    27 namespace Java
       
    28 {
       
    29 namespace Manager
       
    30 {
       
    31 namespace Registry
       
    32 {
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CJavaRegServerSession;
       
    36 class CJavaRegStore;
       
    37 class CJavaPropertyArray;
       
    38 
       
    39 /**
       
    40  * Java Registry Server class.
       
    41  *
       
    42  * @since S60 v3.2
       
    43  */
       
    44 class CJavaRegServer :
       
    45         public CPolicyServer
       
    46 {
       
    47 
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Creates new java registry server object.
       
    52      */
       
    53     static CJavaRegServer* NewL();
       
    54 
       
    55     /**
       
    56      * Destructor
       
    57      */
       
    58     virtual ~CJavaRegServer();
       
    59 
       
    60     /**
       
    61      * Sends panic to client.
       
    62      *
       
    63      * @since S60 v3.2
       
    64      * @param aMessage client message
       
    65      * @param aPanic panic code
       
    66      */
       
    67     void PanicClient(const RMessage2& aMessage, TInt aPanic) const;
       
    68 
       
    69     /**
       
    70      * Checks if an entry with specified uid exist or not
       
    71      * in the registry.
       
    72      *
       
    73      * @since S60 v3.2
       
    74      * @param aUid uid of the entry to be checked
       
    75      * @return true if the entry exists and false if not
       
    76      */
       
    77     TBool EntryExistsL(TUid aUid);
       
    78 
       
    79     /**
       
    80      * Returns the stored uids for the given drive.
       
    81      *
       
    82      * @since S60 v3.2
       
    83      * @param[out] aUids stored uids are returned in this parameter
       
    84      * @param aDrive drive whose entries must be returned
       
    85      */
       
    86     void GetEntryUidsL(RArray<TUid>& aUids, TInt aDrive);
       
    87 
       
    88     /**
       
    89      * Gets entry for the given uid.
       
    90      * If no entry found for the given uid aProperties is null else
       
    91      * it is allocated a new CJavaPropertyArray object containing the read
       
    92      * entry.
       
    93      *
       
    94      * @since S60 v3.2
       
    95      * @param aUid uid of the required entry
       
    96      * @param[out] aProperties entry are read in this parameter
       
    97      */
       
    98     void CJavaRegServer::GetEntryL(
       
    99         TUid aUid,
       
   100         CJavaPropertyArray*& aProperties, TBool aAllEntries = EFalse);
       
   101 
       
   102     /**
       
   103      * Returns with a set of uids whose entries contains the properties (and
       
   104      * has the same values) given in the aProperties parameter.
       
   105      *
       
   106      * @since S60 v3.2
       
   107      * @param aProperties the set of properties which must exists
       
   108      *          (and must have the same values) in the looked entries
       
   109      * @param[out] aFoundUids uids of the found entries are returned
       
   110      *          in this parameter
       
   111      */
       
   112     void FindEntriesL(CJavaPropertyArray& aProperties,
       
   113                       RArray<TUid>& aFoundUids);
       
   114 
       
   115     /**
       
   116      * Returns with a set of uids whose entries contains the properties (and
       
   117      * has the same values) given in the aProperties parameter. This version
       
   118      * returns all uids including whose represent midlets in not presented
       
   119      * removeable media
       
   120      *
       
   121      * @since S60 v5.0
       
   122      * @param aProperties the set of properties which must exists
       
   123      *          (and must have the same values) in the looked entries
       
   124      * @param[out] aFoundUids uids of the found entries are returned
       
   125      *          in this parameter
       
   126      */
       
   127     void FindAllEntriesL(CJavaPropertyArray& aProperties,
       
   128                          RArray<TUid>& aFoundUids);
       
   129 
       
   130     /**
       
   131      * Sets backup state.
       
   132      *
       
   133      * @since S60 v3.2
       
   134      * @param aState backup state to be set
       
   135      */
       
   136     void SetBackupState(TBackupState aState);
       
   137 
       
   138     /**
       
   139      * Check backup state.
       
   140      * In case of server state is backing up or restoring this method leaves
       
   141      * with the KErrServerBusy.
       
   142      *
       
   143      * @since S60 v3.2
       
   144      */
       
   145     void LeaveIfBackingUpOrRestoringL();
       
   146 
       
   147     /**
       
   148      * Check backup state.
       
   149      * In case of server state is restoring this method leaves
       
   150      * with the KErrServerBusy.
       
   151      *
       
   152      * @since S60 v3.2
       
   153      */
       
   154     void LeaveIfRestoringL();
       
   155 
       
   156 private:
       
   157 
       
   158     /**
       
   159      * Constructor
       
   160      */
       
   161     CJavaRegServer();
       
   162 
       
   163     /**
       
   164      * ConstructL
       
   165      */
       
   166     void ConstructL();
       
   167 
       
   168 private:    // From CPolicyServer
       
   169 
       
   170     /**
       
   171      * Creates a new server session object.
       
   172      */
       
   173     CSession2*  NewSessionL(const TVersion&  aVersion,
       
   174                             const RMessage2&  aMessage) const;
       
   175 
       
   176     /**
       
   177      * Performs a custom security check for the setter methods.
       
   178      *
       
   179      * @since S60 v3.2
       
   180      * @param aMsg The message to check.
       
   181      * @param aAction A reference to the action to take if the security
       
   182      *                check fails.
       
   183      * @param aMissing A reference to the list of security attributes
       
   184      *                 missing from the checked process.
       
   185      */
       
   186     virtual TCustomResult CustomSecurityCheckL(
       
   187         const RMessage2&  aMsg,
       
   188         TInt&  aAction,
       
   189         TSecurityInfo&  aMissing);
       
   190 
       
   191 private:    // data
       
   192 
       
   193     // state of backup
       
   194     TBackupState iBackupState;
       
   195 
       
   196     // java registry store object
       
   197     CJavaRegStore* iStore;
       
   198 
       
   199 };
       
   200 
       
   201 }//namespace Registry
       
   202 }//namespace Manager
       
   203 }//namespace Java
       
   204 
       
   205 #endif // JAVAREGSERVER_H
       
   206