~ubuntu-branches/ubuntu/edgy/lasso/edgy

« back to all changes in this revision

Viewing changes to lasso/xml/samlp_status.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2004-09-13 09:26:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040913092634-01vdfl8j9cp94exa
Tags: upstream-0.4.1
ImportĀ upstreamĀ versionĀ 0.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: samlp_status.c,v 1.4 2004/08/13 15:16:13 fpeters Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Liberty Alliance specifications.
 
4
 *
 
5
 * Copyright (C) 2004 Entr'ouvert
 
6
 * http://lasso.entrouvert.org
 
7
 * 
 
8
 * Authors: Nicolas Clapies <nclapies@entrouvert.com>
 
9
 *          Valery Febvre <vfebvre@easter-eggs.com>
 
10
 *
 
11
 * This program is free software; you can redistribute it and/or modify
 
12
 * it under the terms of the GNU General Public License as published by
 
13
 * the Free Software Foundation; either version 2 of the License, or
 
14
 * (at your option) any later version.
 
15
 * 
 
16
 * This program is distributed in the hope that it will be useful,
 
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 * GNU General Public License for more details.
 
20
 * 
 
21
 * You should have received a copy of the GNU General Public License
 
22
 * along with this program; if not, write to the Free Software
 
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 */
 
25
 
 
26
#include <lasso/xml/samlp_status.h>
 
27
 
 
28
/*
 
29
Schema fragment (oasis-sstc-saml-schema-protocol-1.0.xsd):
 
30
 
 
31
<element name="Status" type="samlp:StatusType"/>
 
32
<complexType name="StatusType">
 
33
  <sequence>
 
34
    <element ref="samlp:StatusCode"/>
 
35
    <element ref="samlp:StatusMessage" minOccurs="0" maxOccurs="1"/>
 
36
    <element ref="samlp:StatusDetail" minOccurs="0"/>
 
37
  </sequence>
 
38
</complexType>
 
39
 
 
40
<element name="StatusMessage" type="string"/>
 
41
*/
 
42
 
 
43
/*****************************************************************************/
 
44
/* public methods                                                            */
 
45
/*****************************************************************************/
 
46
 
 
47
void
 
48
lasso_samlp_status_set_statusCode(LassoSamlpStatus *node,
 
49
                                  LassoSamlpStatusCode *statusCode)
 
50
{
 
51
  LassoNodeClass *class;
 
52
  g_assert(LASSO_IS_SAMLP_STATUS(node));
 
53
  g_assert(LASSO_IS_SAMLP_STATUS_CODE(statusCode));
 
54
 
 
55
  class = LASSO_NODE_GET_CLASS(node);
 
56
  class->add_child(LASSO_NODE (node), LASSO_NODE (statusCode), FALSE);
 
57
}
 
58
 
 
59
/* TODO
 
60
void
 
61
lasso_samlp_status_set_statusDetail(LassoSamlpStatus *node,
 
62
                              LassoSamlpStatusDetail *statusDetail)
 
63
{
 
64
}
 
65
*/
 
66
 
 
67
void
 
68
lasso_samlp_status_set_statusMessage(LassoSamlpStatus *node,
 
69
                                     const xmlChar *statusMessage)
 
70
{
 
71
  LassoNodeClass *class;
 
72
  g_assert(LASSO_IS_SAMLP_STATUS(node));
 
73
  g_assert(statusMessage != NULL);
 
74
  
 
75
  class = LASSO_NODE_GET_CLASS(node);
 
76
  class->new_child(LASSO_NODE (node), "StatusMessage", statusMessage, FALSE);
 
77
}
 
78
 
 
79
/*****************************************************************************/
 
80
/* instance and class init functions                                         */
 
81
/*****************************************************************************/
 
82
 
 
83
static void
 
84
lasso_samlp_status_instance_init(LassoSamlpStatus *node)
 
85
{
 
86
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
87
 
 
88
  class->set_ns(LASSO_NODE(node), lassoSamlProtocolHRef,
 
89
                lassoSamlProtocolPrefix);
 
90
  class->set_name(LASSO_NODE(node), "Status");
 
91
}
 
92
 
 
93
static void
 
94
lasso_samlp_status_class_init(LassoSamlpStatusClass *klass)
 
95
{
 
96
}
 
97
 
 
98
GType lasso_samlp_status_get_type() {
 
99
  static GType this_type = 0;
 
100
 
 
101
  if (!this_type) {
 
102
    static const GTypeInfo this_info = {
 
103
      sizeof (LassoSamlpStatusClass),
 
104
      NULL,
 
105
      NULL,
 
106
      (GClassInitFunc) lasso_samlp_status_class_init,
 
107
      NULL,
 
108
      NULL,
 
109
      sizeof(LassoSamlpStatus),
 
110
      0,
 
111
      (GInstanceInitFunc) lasso_samlp_status_instance_init,
 
112
    };
 
113
    
 
114
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
115
                                       "LassoSamlpStatus",
 
116
                                       &this_info, 0);
 
117
  }
 
118
  return this_type;
 
119
}
 
120
 
 
121
LassoNode* lasso_samlp_status_new() {
 
122
  return LASSO_NODE(g_object_new(LASSO_TYPE_SAMLP_STATUS,
 
123
                                 NULL));
 
124
}