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

« back to all changes in this revision

Viewing changes to lasso/xml/lib_federation_termination_notification.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_federation_termination_notification.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: Valery Febvre   <vfebvre@easter-eggs.com>
 
9
 *          Nicolas Clapies <nclapies@entrouvert.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_federation_termination_notification.h>
 
27
 
 
28
/*
 
29
Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
 
30
 
 
31
<xs:element name="FederationTerminationNotification" type="FederationTerminationNotificationType"/>
 
32
  <xs:complexType name="FederationTerminationNotificationType">
 
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="saml:NameIdentifier"/>
 
39
        </xs:sequence>
 
40
      <xs:attribute ref="consent" use="optional"/>
 
41
    </xs:extension>
 
42
  </xs:complexContent>
 
43
</xs:complexType>
 
44
 
 
45
<xs:element name="ProviderID" type="md:entityIDType"/>
 
46
 
 
47
From liberty-metadata-v1.0.xsd:
 
48
<xs:simpleType name="entityIDType">
 
49
  <xs:restriction base="xs:anyURI">
 
50
    <xs:maxLength value="1024" id="maxlengthid"/>
 
51
  </xs:restriction>
 
52
</xs:simpleType>
 
53
 
 
54
*/
 
55
 
 
56
/*****************************************************************************/
 
57
/* public methods                                                            */
 
58
/*****************************************************************************/
 
59
 
 
60
void
 
61
lasso_lib_federation_termination_notification_set_consent(LassoLibFederationTerminationNotification *node,
 
62
                                                          const xmlChar *consent)
 
63
{
 
64
  LassoNodeClass *class;
 
65
  g_assert(LASSO_IS_LIB_FEDERATION_TERMINATION_NOTIFICATION(node));
 
66
  g_assert(consent != NULL);
 
67
 
 
68
  class = LASSO_NODE_GET_CLASS(node);
 
69
  class->set_prop(LASSO_NODE (node), "consent", consent);
 
70
}
 
71
 
 
72
void
 
73
lasso_lib_federation_termination_notification_set_providerID(LassoLibFederationTerminationNotification *node,
 
74
                                                             const xmlChar *providerID)
 
75
{
 
76
  LassoNodeClass *class;
 
77
  g_assert(LASSO_IS_LIB_FEDERATION_TERMINATION_NOTIFICATION(node));
 
78
  g_assert(providerID != NULL);
 
79
  /* FIXME : providerId length SHOULD be <= 1024 */
 
80
 
 
81
  class = LASSO_NODE_GET_CLASS(node);
 
82
  class->new_child(LASSO_NODE (node), "ProviderID", providerID, FALSE);
 
83
}
 
84
 
 
85
void
 
86
lasso_lib_federation_termination_notification_set_nameIdentifier(LassoLibFederationTerminationNotification *node,
 
87
                                                                 LassoSamlNameIdentifier *nameIdentifier)
 
88
{
 
89
  LassoNodeClass *class;
 
90
  g_assert(LASSO_IS_LIB_FEDERATION_TERMINATION_NOTIFICATION(node));
 
91
  g_assert(LASSO_IS_SAML_NAME_IDENTIFIER(nameIdentifier));
 
92
 
 
93
  class = LASSO_NODE_GET_CLASS(node);
 
94
  class->add_child(LASSO_NODE (node), LASSO_NODE (nameIdentifier), FALSE);
 
95
}
 
96
 
 
97
/*****************************************************************************/
 
98
/* instance and class init functions                                         */
 
99
/*****************************************************************************/
 
100
 
 
101
static void
 
102
lasso_lib_federation_termination_notification_instance_init(LassoLibFederationTerminationNotification *node)
 
103
{
 
104
  LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
 
105
 
 
106
  class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
 
107
  class->set_name(LASSO_NODE(node), "FederationTerminationNotification");
 
108
}
 
109
 
 
110
static void
 
111
lasso_lib_federation_termination_notification_class_init(LassoLibFederationTerminationNotificationClass *klass)
 
112
{
 
113
}
 
114
 
 
115
GType lasso_lib_federation_termination_notification_get_type() {
 
116
  static GType this_type = 0;
 
117
 
 
118
  if (!this_type) {
 
119
    static const GTypeInfo this_info = {
 
120
      sizeof (LassoLibFederationTerminationNotificationClass),
 
121
      NULL,
 
122
      NULL,
 
123
      (GClassInitFunc) lasso_lib_federation_termination_notification_class_init,
 
124
      NULL,
 
125
      NULL,
 
126
      sizeof(LassoLibFederationTerminationNotification),
 
127
      0,
 
128
      (GInstanceInitFunc) lasso_lib_federation_termination_notification_instance_init,
 
129
    };
 
130
    
 
131
    this_type = g_type_register_static(LASSO_TYPE_SAMLP_REQUEST_ABSTRACT,
 
132
                                       "LassoLibFederationTerminationNotification",
 
133
                                       &this_info, 0);
 
134
  }
 
135
  return this_type;
 
136
}
 
137
 
 
138
LassoNode* lasso_lib_federation_termination_notification_new() {
 
139
  return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_FEDERATION_TERMINATION_NOTIFICATION,
 
140
                                 NULL));
 
141
}