~ubuntu-branches/ubuntu/utopic/lasso/utopic-proposed

« back to all changes in this revision

Viewing changes to lasso/xml/saml_authority_binding.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: saml_authority_binding.c,v 1.4 2004/08/13 15:16:13 fpeters Exp $
 
2
 *
 
3
 * Lasso - A free implementation of the Samlerty 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/saml_authority_binding.h>
 
27
 
 
28
/*
 
29
The schema fragment (oasis-sstc-saml-schema-assertion-1.0.xsd):
 
30
 
 
31
<element name="AuthorityBinding" type="saml:AuthorityBindingType"/>
 
32
<complexType name="AuthorityBindingType">
 
33
  <attribute name="AuthorityKind" type="QName" use="required"/>
 
34
  <attribute name="Location" type="anyURI" use="required"/>
 
35
  <attribute name="Binding" type="anyURI" use="required"/>
 
36
</complexType>
 
37
 
 
38
*/
 
39
 
 
40
/*****************************************************************************/
 
41
/* public methods                                                            */
 
42
/*****************************************************************************/
 
43
 
 
44
void
 
45
lasso_saml_authority_binding_set_authorityKind(LassoSamlAuthorityBinding *node,
 
46
                                               const xmlChar *authorityKind)
 
47
{
 
48
  LassoNodeClass *class;
 
49
  g_assert(LASSO_IS_SAML_AUTHORITY_BINDING(node));
 
50
  g_assert(authorityKind != NULL);
 
51
 
 
52
  class = LASSO_NODE_GET_CLASS(node);
 
53
  class->set_prop(LASSO_NODE (node), "AuthorityKind", authorityKind);
 
54
}
 
55
 
 
56
void
 
57
lasso_saml_authority_binding_set_binding(LassoSamlAuthorityBinding *node,
 
58
                                         const xmlChar *binding)
 
59
{
 
60
  LassoNodeClass *class;
 
61
  g_assert(LASSO_IS_SAML_AUTHORITY_BINDING(node));
 
62
  g_assert(binding != NULL);
 
63
 
 
64
  class = LASSO_NODE_GET_CLASS(node);
 
65
  class->set_prop(LASSO_NODE (node), "Binding", binding);
 
66
}
 
67
 
 
68
void
 
69
lasso_saml_authority_binding_set_location(LassoSamlAuthorityBinding *node,
 
70
                                          const xmlChar *location)
 
71
{
 
72
  LassoNodeClass *class;
 
73
  g_assert(LASSO_IS_SAML_AUTHORITY_BINDING(node));
 
74
  g_assert(location != NULL);
 
75
 
 
76
  class = LASSO_NODE_GET_CLASS(node);
 
77
  class->set_prop(LASSO_NODE (node), "Location", location);
 
78
}
 
79
 
 
80
/*****************************************************************************/
 
81
/* instance and class init functions                                         */
 
82
/*****************************************************************************/
 
83
 
 
84
static void
 
85
lasso_saml_authority_binding_instance_init(LassoSamlAuthorityBinding *node)
 
86
{
 
87
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
88
 
 
89
  class->set_ns(LASSO_NODE(node), lassoSamlAssertionHRef,
 
90
                lassoSamlAssertionPrefix);
 
91
  class->set_name(LASSO_NODE(node), "AuthorityBinding");
 
92
}
 
93
 
 
94
static void
 
95
lasso_saml_authority_binding_class_init(LassoSamlAuthorityBindingClass *klass)
 
96
{
 
97
}
 
98
 
 
99
GType lasso_saml_authority_binding_get_type() {
 
100
  static GType this_type = 0;
 
101
 
 
102
  if (!this_type) {
 
103
    static const GTypeInfo this_info = {
 
104
      sizeof (LassoSamlAuthorityBindingClass),
 
105
      NULL,
 
106
      NULL,
 
107
      (GClassInitFunc) lasso_saml_authority_binding_class_init,
 
108
      NULL,
 
109
      NULL,
 
110
      sizeof(LassoSamlAuthorityBinding),
 
111
      0,
 
112
      (GInstanceInitFunc) lasso_saml_authority_binding_instance_init,
 
113
    };
 
114
    
 
115
    this_type = g_type_register_static(LASSO_TYPE_NODE,
 
116
                                       "LassoSamlAuthorityBinding",
 
117
                                       &this_info, 0);
 
118
  }
 
119
  return this_type;
 
120
}
 
121
 
 
122
/**
 
123
 * lasso_saml_authority_binding_new:
 
124
 * 
 
125
 * Creates a new <saml:AuthorityBinding> node object.
 
126
 * 
 
127
 * Return value: the new @LassoSamlAuthorityBinding
 
128
 **/
 
129
LassoNode* lasso_saml_authority_binding_new()
 
130
{
 
131
  return LASSO_NODE(g_object_new(LASSO_TYPE_SAML_AUTHORITY_BINDING, NULL));
 
132
}