Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
Arc::Message Class Reference

Object being passed through chain of MCCs. More...

#include <Message.h>

Collaboration diagram for Arc::Message:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Message (void)
 true if auth_ctx_ was created internally
 Message (Message &msg)
 Copy constructor.
 Message (long msg_ptr_addr)
 Copy constructor.
 ~Message (void)
 Destructor does not affect refered objects except those created internally.
Messageoperator= (Message &msg)
 Assignment.
MessagePayloadPayload (void)
 Returns pointer to current payload or NULL if no payload assigned.
MessagePayloadPayload (MessagePayload *payload)
 Replaces payload with new one.
MessageAttributesAttributes (void)
 Returns a pointer to the current attributes object or creates it if no attributes object has been assigned.
void Attributes (MessageAttributes *attr)
MessageAuthAuth (void)
 Returns a pointer to the current authentication/authorization object or creates it if no object has been assigned.
void Auth (MessageAuth *auth)
MessageContextContext (void)
 Returns a pointer to the current context object or creates it if no object has been assigned.
MessageAuthContextAuthContext (void)
 Returns a pointer to the current auth* context object or creates it if no object has been assigned.
void Context (MessageContext *ctx)
 Assigns message context object.
void AuthContext (MessageAuthContext *auth_ctx)
 Assigns auth* context object.

Private Attributes

MessagePayloadpayload_
MessageAuthauth_
 Main content of message.
bool auth_created_
 Authentication and authorization related information.
MessageAttributesattr_
 true if auth_ was created internally
bool attr_created_
 Various useful attributes.
MessageContextctx_
 true if attr_ was created internally
bool ctx_created_
MessageAuthContextauth_ctx_
 true if ctx_ was created internally
bool auth_ctx_created_

Detailed Description

Object being passed through chain of MCCs.

An instance of this class refers to objects with main content (MessagePayload), authentication/authorization information (MessageAuth) and common purpose attributes (MessageAttributes). Message class does not manage pointers to objects and their content. It only serves for grouping those objects. Message objects are supposed to be processed by MCCs and Services implementing MCCInterface method process(). All objects constituting content of Message object are subject to following policies:

  1. All objects created inside call to process() method using new command must be explicitely destroyed within same call using delete command with following exceptions. a) Objects which are assigned to 'response' Message. b) Objects whose management is completely acquired by objects assigned to 'response' Message.
  1. All objects not created inside call to process() method are not explicitely destroyed within that call with following exception. a) Objects which are part of 'response' Method returned from call to next's process() method. Unless those objects are passed further to calling process(), of course.
  1. It is not allowed to make 'response' point to same objects as 'request' does on entry to process() method. That is needed to avoid double destruction of same object. (Note: if in a future such need arises it may be solved by storing additional flags in Message object).
  1. It is allowed to change content of pointers of 'request' Message. Calling process() method must not rely on that object to stay intact.
  1. Called process() method should either fill 'response' Message with pointers to valid objects or to keep them intact. This makes it possible for calling process() to preload 'response' with valid error message.

Definition at line 88 of file Message.h.


Constructor & Destructor Documentation

Arc::Message::Message ( void  ) [inline]

true if auth_ctx_ was created internally

Dummy constructor

Definition at line 107 of file Message.h.

:payload_(NULL),auth_(NULL),auth_created_(false),attr_(NULL),attr_created_(false),ctx_(NULL),ctx_created_(false),auth_ctx_(NULL),auth_ctx_created_(false) { };
Arc::Message::Message ( Message msg) [inline]

Copy constructor.

Ensures shallow copy.

Definition at line 109 of file Message.h.

:payload_(msg.payload_),auth_(msg.auth_),auth_created_(false),attr_(msg.attr_),attr_created_(false),ctx_(msg.ctx_),ctx_created_(false),auth_ctx_(msg.auth_ctx_),auth_ctx_created_(false) { };
Arc::Message::Message ( long  msg_ptr_addr)

Copy constructor.

Used by language bindigs

Definition at line 33 of file Message.cpp.

{
    Message *msg = (Message *)msg_ptr_addr;
    auth_ = msg->auth_;         auth_created_=false;
    attr_ = msg->attr_;         attr_created_=false;
    ctx_ = msg->ctx_;           ctx_created_=false;
    auth_ctx_ = msg->auth_ctx_; auth_ctx_created_=false;
    payload_ = msg->payload_;
}
Arc::Message::~Message ( void  ) [inline]

Destructor does not affect refered objects except those created internally.

Definition at line 113 of file Message.h.

                 { 
    if(attr_created_) delete attr_;
    if(auth_created_) delete auth_;
    if(ctx_created_) delete ctx_;
    if(auth_ctx_created_) delete auth_ctx_;
  };

Member Function Documentation

Returns a pointer to the current attributes object or creates it if no attributes object has been assigned.

Definition at line 138 of file Message.h.

                                      {
    if(attr_ == NULL) {
      attr_created_=true; attr_=new MessageAttributes;
    };
    return attr_;
  };
void Arc::Message::Attributes ( MessageAttributes attr) [inline]

Definition at line 144 of file Message.h.

                                           {
    if(attr_created_) {
      attr_created_=false; delete attr_;
    };
    attr_=attr;
  };
MessageAuth* Arc::Message::Auth ( void  ) [inline]

Returns a pointer to the current authentication/authorization object or creates it if no object has been assigned.

Definition at line 152 of file Message.h.

                          {
    if(auth_ == NULL) {
      auth_created_=true; auth_=new MessageAuth;
    };
    return auth_;
  };

Here is the caller graph for this function:

void Arc::Message::Auth ( MessageAuth auth) [inline]

Definition at line 158 of file Message.h.

                               {
    if(auth_created_) {
      auth_created_=false; delete auth_;
    };
    auth_=auth;
  };

Returns a pointer to the current auth* context object or creates it if no object has been assigned.

Definition at line 175 of file Message.h.

                                        {
    if(auth_ctx_ == NULL) {
      auth_ctx_created_=true; auth_ctx_=new MessageAuthContext;
    };
    return auth_ctx_;
  };

Here is the caller graph for this function:

void Arc::Message::AuthContext ( MessageAuthContext auth_ctx) [inline]

Assigns auth* context object.

Definition at line 189 of file Message.h.

                                                 {
    if(auth_ctx_created_) {
      auth_ctx_created_=false; delete auth_ctx_;
    };
    auth_ctx_=auth_ctx;
  };
MessageContext* Arc::Message::Context ( void  ) [inline]

Returns a pointer to the current context object or creates it if no object has been assigned.

Last case should happen only if first MCC in a chain is connectionless like one implementing UDP protocol.

Definition at line 167 of file Message.h.

                                {
    if(ctx_ == NULL) {
      ctx_created_=true; ctx_=new MessageContext;
    };
    return ctx_;
  };

Here is the caller graph for this function:

void Arc::Message::Context ( MessageContext ctx) [inline]

Assigns message context object.

Definition at line 182 of file Message.h.

                                    {
    if(ctx_created_) {
      ctx_created_=false; delete ctx_;
    };
    ctx_=ctx;
  };
Message& Arc::Message::operator= ( Message msg) [inline]

Assignment.

Ensures shallow copy.

Definition at line 120 of file Message.h.

                                   {
    payload_=msg.payload_;
    if(msg.auth_) Auth(msg.auth_);
    if(msg.attr_) Attributes(msg.attr_);
    if(msg.ctx_) Context(msg.ctx_);
    if(msg.auth_ctx_) AuthContext(msg.auth_ctx_);
    return *this;
  };

Here is the call graph for this function:

MessagePayload* Arc::Message::Payload ( void  ) [inline]

Returns pointer to current payload or NULL if no payload assigned.

Definition at line 129 of file Message.h.

{ return payload_; };

Replaces payload with new one.

Returns the old one.

Definition at line 131 of file Message.h.

                                                   {
    MessagePayload* p = payload_;
    payload_=payload;
    return p;
  };

Member Data Documentation

true if auth_ was created internally

Definition at line 93 of file Message.h.

Various useful attributes.

Definition at line 94 of file Message.h.

Main content of message.

Definition at line 91 of file Message.h.

Authentication and authorization related information.

Definition at line 92 of file Message.h.

true if ctx_ was created internally

Definition at line 103 of file Message.h.

Definition at line 104 of file Message.h.

true if attr_ was created internally

This element is maintained by MCC/element which handles/knows persistency of connection/session. It must be created and destroyed by that element. This object must survive during whole connectivity session - whatever that means. This is a place for MCCs and services to store information related to connection. All the other objects are only guaranteed to stay during single request.

Definition at line 101 of file Message.h.

Definition at line 102 of file Message.h.

Definition at line 90 of file Message.h.


The documentation for this class was generated from the following files: