(file) Return to HTTPExportResponseDecoder.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ExportClient

File: [Pegasus] / pegasus / src / Pegasus / ExportClient / HTTPExportResponseDecoder.h (download)
Revision: 1.2, Fri Oct 6 18:38:06 2006 UTC (17 years, 8 months ago) by mike
Branch: MAIN
CVS Tags: TASK-TASK-BUG4011_WinLocalConnect-branch-New-root, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_out_to_branch, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_out_from_trunk, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_in_to_trunk, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_in_from_branch, TASK-TASK-BUG4011_WinLocalConnect-branch-New-branch, TASK-PEP268_SSLClientCertificatePropagation-root, TASK-PEP268_SSLClientCertificatePropagation-merged_out_to_branch, TASK-PEP268_SSLClientCertificatePropagation-merged_out_from_trunk, TASK-PEP268_SSLClientCertificatePropagation-merged_in_to_trunk, TASK-PEP268_SSLClientCertificatePropagation-merged_in_from_branch, TASK-PEP268_SSLClientCertificatePropagation-branch, TASK-PEP267_SLPReregistrationSupport-root, TASK-PEP267_SLPReregistrationSupport-merging_out_to_branch, TASK-PEP267_SLPReregistrationSupport-merging_out_from_trunk, TASK-PEP267_SLPReregistrationSupport-merged_out_to_branch, TASK-PEP267_SLPReregistrationSupport-merged_out_from_trunk, TASK-PEP267_SLPReregistrationSupport-merged_in_to_trunk, TASK-PEP267_SLPReregistrationSupport-merged_in_from_branch, TASK-PEP267_SLPReregistrationSupport-branch, TASK-Bugs5690_3913_RemoteCMPI-root, TASK-Bugs5690_3913_RemoteCMPI-merged_out_to_branch, TASK-Bugs5690_3913_RemoteCMPI-merged_out_from_trunk, TASK-Bugs5690_3913_RemoteCMPI-merged_in_to_trunk, TASK-Bugs5690_3913_RemoteCMPI-merged_in_from_branch, TASK-Bugs5690_3913_RemoteCMPI-branch, TASK-Bug2102_RCMPIWindows-root, TASK-Bug2102_RCMPIWindows-merged_out_to_branch, TASK-Bug2102_RCMPIWindows-merged_out_from_trunk, TASK-Bug2102_RCMPIWindows-merged_in_to_trunk, TASK-Bug2102_RCMPIWindows-merged_in_from_branch, TASK-Bug2102_RCMPIWindows-branch, TASK-Bug2021_RemoteCMPIonWindows-root, TASK-Bug2021_RemoteCMPIonWindows-merged_out_to_branch, TASK-Bug2021_RemoteCMPIonWindows-merged_out_from_trunk, TASK-Bug2021_RemoteCMPIonWindows-merged_in_to_trunk, TASK-Bug2021_RemoteCMPIonWindows-merged_in_from_branch, TASK-Bug2021_RemoteCMPIonWindows-branch, TASK-Bug2021_RCMPIonWindows-root, TASK-Bug2021_RCMPIonWindows-merged_out_to_branch, TASK-Bug2021_RCMPIonWindows-merged_out_from_trunk, TASK-Bug2021_RCMPIonWindows-merged_in_to_trunk, TASK-Bug2021_RCMPIonWindows-merged_in_from_branch, TASK-Bug2021_RCMPIonWindows-branch, TASK-BUG7240-root, TASK-BUG7240-branch, TASK-BUG4011_WinLocalConnect-branch-New, RELEASE_2_6_3-RC2, RELEASE_2_6_3-RC1, RELEASE_2_6_3, RELEASE_2_6_2-RC1, RELEASE_2_6_2, RELEASE_2_6_1-RC1, RELEASE_2_6_1, RELEASE_2_6_0-RC1, RELEASE_2_6_0-FC, RELEASE_2_6_0, RELEASE_2_6-root, RELEASE_2_6-branch-clean, RELEASE_2_6-branch, PEP286_PRIVILEGE_SEPARATION_ROOT, PEP286_PRIVILEGE_SEPARATION_CODE_FREEZE, PEP286_PRIVILEGE_SEPARATION_BRANCH, PEP286_PRIVILEGE_SEPARATION_1
Changes since 1.1: +1 -1 lines
BUG#: 5661
TITLE: Improve Branch coverage of CIMExportResponseDecoder.

DESCRIPTION: Added missing linkage macro to HTTPExportResponseDecoder class to
fix broken build on windows.

//%2006////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation, The Open Group.
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; Symantec Corporation; The Open Group.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
//
//%/////////////////////////////////////////////////////////////////////////////

#ifndef Pegasus_HTTPExportResponseDecoder_h
#define Pegasus_HTTPExportResponseDecoder_h

#include <Pegasus/Common/Config.h>
#include <Pegasus/Common/Message.h>
#include <Pegasus/Common/Exception.h>
#include <Pegasus/Common/HTTPMessage.h>
#include <Pegasus/Common/String.h>
#include <Pegasus/Common/XmlParser.h>
#include <Pegasus/Common/CIMMessage.h>
#include <Pegasus/ExportClient/Linkage.h>

PEGASUS_NAMESPACE_BEGIN

/**
    The ClientExceptionMessage class represents an exception encapsulated in a
    response message.  A ClientExceptionMessage is generated by the HTTP Export
    Response Decoder when an error is detected in the export response.
*/
class ClientExceptionMessage : public Message
{
public:
    /**
        Constructs a ClientExceptionMessage.

        @param  clientException_  INPUT   Exception* exception to be
                                            encapsulated in the message
     */
    ClientExceptionMessage(Exception* clientException_)
        :
        Message(CLIENT_EXCEPTION_MESSAGE),
        clientException(clientException_)
    {
    }

    Exception* clientException;
};

/**
    The HTTPExportResponseDecoder class provides interfaces to parse and
    validate HTTP headers, and decode an export response message.
*/
class PEGASUS_EXPORT_CLIENT_LINKAGE HTTPExportResponseDecoder
{
public:

    /**
        Parses the headers and status line of the HTTP message.

        This method is called by the CIMExportResponseDecoder before calling
        the client authenticator to check the response header for an
        authentication challenge.

        @param  httpMessage       INPUT   HTTPMessage* message to be processed
        @param  exceptionMessage  OUTPUT  ClientExceptionMessage* response
                                            containing exception when error is
                                            detected in export response message
        @param  headers           OUTPUT  Array<HTTPHeader> containing headers
        @param  contentLength     OUTPUT  Uint32 length of message content
        @param  statusCode        OUTPUT  Uint32 status code from status line
        @param  reasonPhrase      OUTPUT  String reasonPhrase from status line
        @param  cimReconnect      OUTPUT  Boolean indicating whether close and
                                            reconnect are necessary
        @param  valid             OUTPUT  Boolean indicating whether any errors
                                            were encountered
     */
    static void parseHTTPHeaders(
        HTTPMessage* httpMessage,
        ClientExceptionMessage*& exceptionMessage,
        Array<HTTPHeader>& headers,
        Uint32& contentLength,
        Uint32& statusCode,
        String& reasonPhrase,
        Boolean& cimReconnect,
        Boolean& valid);

    /**
        Validates the HTTP headers of the HTTP message.

        This method is called by the CIMExportResponseDecoder after calling
        the client authenticator to check the response header for an
        authentication challenge.

        @param  httpMessage       INPUT   HTTPMessage* message to be processed
        @param  headers           INPUT   Array<HTTPHeader> containing headers
        @param  contentLength     INPUT   Uint32 length of message content
        @param  statusCode        INPUT   Uint32 status code from status line
        @param  cimReconnect      INPUT   Boolean indicating whether close and
                                            reconnect are necessary
        @param  reasonPhrase      INPUT   String reasonPhrase from status line
        @param  content           OUTPUT  char* containing message content
        @param  exceptionMessage  OUTPUT  ClientExceptionMessage* response
                                            containing exception when error is
                                            detected in export response message
        @param  valid             OUTPUT  Boolean indicating whether any errors
                                            were encountered
     */
    static void validateHTTPHeaders(
        HTTPMessage* httpMessage,
        Array<HTTPHeader>& headers,
        Uint32 contentLength,
        Uint32 statusCode,
        Boolean cimReconnect,
        const String& reasonPhrase,
        char*& content,
        ClientExceptionMessage*& exceptionMessage,
        Boolean& valid);

    /**
        Decodes the Export Response in the HTTP message.

        @param  content           INPUT   char* containing message content
        @param  cimReconnect      INPUT   Boolean indicating whether close and
                                            reconnect are necessary
        @param  responseMessage   OUTPUT  Message* response containing either 
                                            export indication response, or
                                            exception when error is detected
     */
    static void decodeExportResponse(
        char* content,
        Boolean cimReconnect,
        Message*& responseMessage);

private:

    /**
        Decodes an Export Indication response.

        @param   parser                       XmlParser the XML parser
        @param   messageId                    String ID from MESSAGE element
        @param   isEmptyExpMethodResponseTag  Boolean indicating whether
                                                EXPMETHODRESPONSE was empty tag

        @return  pointer to a CIM Export Indication Response Message
     */
    static CIMExportIndicationResponseMessage* _decodeExportIndicationResponse(
        XmlParser& parser,
        const String& messageId,
        Boolean isEmptyExpMethodResponseTag);
};

PEGASUS_NAMESPACE_END

#endif /* Pegasus_HTTPExportResponseDecoder_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2