webservices/wsstar/wsstarpolicy/inc/wspolicyreader.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef C_WS_POLICY_READER_H
       
    26 #define C_WS_POLICY_READER_H
       
    27 
       
    28 
       
    29 #include <e32std.h>
       
    30 #include <f32file.h>
       
    31 
       
    32 #include "SenDomFragment.h"
       
    33 #include "policyassertion.h"
       
    34 #include "primitiveassertion.h"
       
    35 
       
    36 class CPolicyAssertion;
       
    37 class CAndCompositeAssertion;
       
    38 class CXorCompositeAssertion;
       
    39 class CAssertion;
       
    40 class CPrimitiveAssertion;
       
    41 class CPolicyReferenceAssertion;
       
    42 namespace WSPolicy
       
    43 {
       
    44 
       
    45 	_LIT8( KAndCompositeAssertion , "All");             // Tag name of AndComposteAssertion
       
    46 	_LIT8( KXorCompositeAssertion , "ExactlyOne");      // Tag name of XorCompositeAssertion
       
    47 	_LIT8( KWsPolicy , "Policy");                       // Tag name of Policy
       
    48 	_LIT8( KWsPolicyPrefix , "wsp");                    // Prefix of WS-Policy namespace
       
    49 	_LIT8( KWsuNsPrefix , "wsu");                       // Prefix of WSU namespace
       
    50 	_LIT8( KWsPolicyReference , "PolicyReference");     // Tag name of PolicyReference
       
    51 	_LIT8( KWspOptinal , "wsp:Optional");             // Tag name of Optional Attribute
       
    52 	_LIT8( KWspOptinalTrue , "true");             // Tag name of Optional Attribute TRUE
       
    53 	_LIT8( KWspOptinalFalse , "false");             // Tag name of Optional Attribute FALSE
       
    54 	_LIT8( KWsPolicyNsUri , "http://schemas.xmlsoap.org/ws/2004/09/policy"); // Namespace of WS-Policy
       
    55     
       
    56     _LIT8( KWsuPrefix , "wsu"); // Namespace of WSU	
       
    57 	_LIT8( KWsuNsUri , "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); // Namespace of WSU
       
    58 	_LIT8( KXmlNsUri , "http://www.w3.org/XML/1998/namespace"); // XML namespace
       
    59 	
       
    60 	_LIT8( KWsuId , "wsu:Id");                       // Prefix ID
       
    61 	_LIT8( KId , "Id");                       // Prefix ID
       
    62 	_LIT8( KName, "Name"); 
       
    63 	_LIT8( KWsSecuritypolicyPrefix , "sp");                    // Prefix of WS-Security Policy namespace
       
    64 	_LIT8( KWsSecurityPolicyNsUri , "http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"); // Namespace of WS-Security Policy
       
    65 	
       
    66 	_LIT8( KUri , "URI");                       // PolicyReference URI
       
    67 
       
    68 }
       
    69 
       
    70 namespace  MSWSPolicy
       
    71 {
       
    72  	_LIT8( KMSNsPrefix, "mws");
       
    73  	_LIT8( KMetaDataValidity, "metadatavalidity");
       
    74 	_LIT8( KExpiry, "Expiry");
       
    75 	_LIT8(KMetaDataLocalName, "MetadataEndpoint");    
       
    76 }
       
    77 
       
    78 class CWSPolicyReader : public CBase
       
    79 {
       
    80 public:
       
    81     static  CWSPolicyReader* NewL();
       
    82     static  CWSPolicyReader* NewLC();
       
    83     ~CWSPolicyReader();
       
    84 
       
    85     CPolicyAssertion* GetPolicyL(CSenElement* aPolicy);
       
    86 private:
       
    87      CPolicyAssertion* ReadPolicyL(CSenElement* aEle);
       
    88      CAndCompositeAssertion* ReadAndAssertionL(CSenElement* aEle);
       
    89      CXorCompositeAssertion* ReadXorAssertionL(CSenElement* aEle);
       
    90      CAssertion* ReadAssertionL(CSenElement* aEle);
       
    91      CPolicyReferenceAssertion* ReadPolicyReferenceL(CSenElement* aEle);
       
    92      CPrimitiveAssertion* ReadPrimitiveAssertionL(CSenElement* aEle);
       
    93      void ReadTermsL(CSenElement* aEle, RPointerArray<MAssertion>& aTerms);
       
    94      void GetAttributesL(CSenElement* aEle, RAttributeMap& aAttributes);
       
    95      
       
    96      TPtrC8 GetAttribL(TPtrC8 aReference, CSenElement* aEle);
       
    97      
       
    98      CWSPolicyReader();
       
    99      void ConstructL();
       
   100 private:
       
   101     TInt count;
       
   102 };
       
   103 #endif //C_WS_POLICY_READER_H