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

« back to all changes in this revision

Viewing changes to lasso/xml/lib_register_name_identifier_request.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: lib_register_name_identifier_request.c,v 1.8 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/lib_register_name_identifier_request.h>
 
27
 
 
28
/*
 
29
The Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
 
30
 
 
31
<xs:element name="RegisterNameIdentifierRequest" type="RegisterNameIdentifierRequestType"/>
 
32
<xs:complexType name="RegisterNameIdentifierRequestType">
 
33
  <xs:complexContent>
 
34
    <xs:extension base="samlp:RequestAbstractType">
 
35
      <xs:sequence>
 
36
        <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/>
 
37
        <xs:element ref="ProviderID"/>
 
38
        <xs:element ref="IDPProvidedNameIdentifier"/>
 
39
        <xs:element ref="SPProvidedNameIdentifier"/>
 
40
        <xs:element ref="OldProvidedNameIdentifier"/>
 
41
        <xs:element ref="RelayState" minOccurs="0"/>
 
42
      </xs:sequence>
 
43
    </xs:extension>
 
44
  </xs:complexContent>
 
45
</xs:complexType>
 
46
<xs:element name="IDPProvidedNameIdentifier" type="saml:NameIdentifierType"/>
 
47
<xs:element name="SPProvidedNameIdentifier" type="saml:NameIdentifierType"/>
 
48
<xs:element name="OldProvidedNameIdentifier" type="saml:NameIdentifierType"/>
 
49
 
 
50
<xs:element name="ProviderID" type="md:entityIDType"/>
 
51
<xs:element name="RelayState" type="xs:string"/>
 
52
 
 
53
From liberty-metadata-v1.0.xsd:
 
54
<xs:simpleType name="entityIDType">
 
55
  <xs:restriction base="xs:anyURI">
 
56
    <xs:maxLength value="1024" id="maxlengthid"/>
 
57
  </xs:restriction>
 
58
</xs:simpleType>
 
59
 
 
60
*/
 
61
 
 
62
/*****************************************************************************/
 
63
/* public methods                                                            */
 
64
/*****************************************************************************/
 
65
 
 
66
void
 
67
lasso_lib_register_name_identifier_request_set_idpProvidedNameIdentifier(LassoLibRegisterNameIdentifierRequest *node,
 
68
                                                                         LassoLibIDPProvidedNameIdentifier *idpProvidedNameIdentifier)
 
69
{
 
70
  LassoNodeClass *class;
 
71
  g_assert(LASSO_IS_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(node));
 
72
  g_assert(LASSO_IS_LIB_IDP_PROVIDED_NAME_IDENTIFIER(idpProvidedNameIdentifier));
 
73
 
 
74
  class = LASSO_NODE_GET_CLASS(node);
 
75
  class->add_child(LASSO_NODE (node),
 
76
                   LASSO_NODE (idpProvidedNameIdentifier),
 
77
                   FALSE);
 
78
}
 
79
 
 
80
void
 
81
lasso_lib_register_name_identifier_request_set_oldProvidedNameIdentifier(LassoLibRegisterNameIdentifierRequest *node,
 
82
                                                                         LassoLibOLDProvidedNameIdentifier *oldProvidedNameIdentifier)
 
83
{
 
84
  LassoNodeClass *class;
 
85
  g_assert(LASSO_IS_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(node));
 
86
  g_assert(LASSO_IS_LIB_OLD_PROVIDED_NAME_IDENTIFIER(oldProvidedNameIdentifier));
 
87
 
 
88
  class = LASSO_NODE_GET_CLASS(node);
 
89
  class->add_child(LASSO_NODE (node),
 
90
                   LASSO_NODE (oldProvidedNameIdentifier),
 
91
                   FALSE);
 
92
}
 
93
 
 
94
void
 
95
lasso_lib_register_name_identifier_request_set_providerID(LassoLibRegisterNameIdentifierRequest *node,
 
96
                                                          const xmlChar *providerID)
 
97
{
 
98
  LassoNodeClass *class;
 
99
  g_assert(LASSO_IS_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(node));
 
100
  g_assert(providerID != NULL);
 
101
  /* FIXME : providerID length SHOULD be <= 1024 */
 
102
 
 
103
  class = LASSO_NODE_GET_CLASS(node);
 
104
  class->new_child(LASSO_NODE (node), "ProviderID", providerID, FALSE);
 
105
}
 
106
 
 
107
void
 
108
lasso_lib_register_name_identifier_request_set_relayState(LassoLibRegisterNameIdentifierRequest *node,
 
109
                                                          const xmlChar *relayState)
 
110
{
 
111
  LassoNodeClass *class;
 
112
  g_assert(LASSO_IS_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(node));
 
113
  g_assert(relayState != NULL);
 
114
 
 
115
  class = LASSO_NODE_GET_CLASS(node);
 
116
  class->new_child(LASSO_NODE (node), "RelayState", relayState, FALSE);
 
117
}
 
118
 
 
119
void
 
120
lasso_lib_register_name_identifier_request_set_spProvidedNameIdentifier(LassoLibRegisterNameIdentifierRequest *node,
 
121
                                                                        LassoLibSPProvidedNameIdentifier *spProvidedNameIdentifier)
 
122
{
 
123
  LassoNodeClass *class;
 
124
  g_assert(LASSO_IS_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(node));
 
125
  g_assert(LASSO_IS_LIB_SP_PROVIDED_NAME_IDENTIFIER(spProvidedNameIdentifier));
 
126
 
 
127
  class = LASSO_NODE_GET_CLASS(node);
 
128
  class->add_child(LASSO_NODE (node),
 
129
                   LASSO_NODE (spProvidedNameIdentifier),
 
130
                   FALSE);
 
131
}
 
132
 
 
133
/*****************************************************************************/
 
134
/* instance and class init functions                                         */
 
135
/*****************************************************************************/
 
136
 
 
137
static void
 
138
lasso_lib_register_name_identifier_request_instance_init(LassoLibRegisterNameIdentifierRequest *node)
 
139
{
 
140
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
141
 
 
142
  class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
 
143
  class->set_name(LASSO_NODE(node), "RegisterNameIdentifierRequest");
 
144
}
 
145
 
 
146
static void
 
147
lasso_lib_register_name_identifier_request_class_init(LassoLibRegisterNameIdentifierRequestClass *klass)
 
148
{
 
149
}
 
150
 
 
151
GType lasso_lib_register_name_identifier_request_get_type() {
 
152
  static GType this_type = 0;
 
153
 
 
154
  if (!this_type) {
 
155
    static const GTypeInfo this_info = {
 
156
      sizeof (LassoLibRegisterNameIdentifierRequestClass),
 
157
      NULL,
 
158
      NULL,
 
159
      (GClassInitFunc) lasso_lib_register_name_identifier_request_class_init,
 
160
      NULL,
 
161
      NULL,
 
162
      sizeof(LassoLibRegisterNameIdentifierRequest),
 
163
      0,
 
164
      (GInstanceInitFunc) lasso_lib_register_name_identifier_request_instance_init,
 
165
    };
 
166
    
 
167
    this_type = g_type_register_static(LASSO_TYPE_SAMLP_REQUEST_ABSTRACT,
 
168
                                       "LassoLibRegisterNameIdentifierRequest",
 
169
                                       &this_info, 0);
 
170
  }
 
171
  return this_type;
 
172
}
 
173
 
 
174
LassoNode* lasso_lib_register_name_identifier_request_new() {
 
175
  return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_REGISTER_NAME_IDENTIFIER_REQUEST,
 
176
                                 NULL));
 
177
}