Newer
Older
package IdPAccountManager::ServiceProvider;
use parent 'IdPAccountManager::Data::Serviceprovider';
use strict;
use IdPAccountManager::Data::Serviceprovider;
use IdPAccountManager::Data::Serviceprovider::Manager;
use IdPAccountManager::Tools;
use Conf;
require Exporter;
my @ISA = qw(Exporter);
my @EXPORT = qw();
use Carp;
## Set error mode to non fatal
IdPAccountManager::Data::Serviceprovider::Manager->error_mode('return');
}
## Print the content of a test account
sub print {
my $self = shift;
my $fd = shift || \*STDOUT;
printf $fd "ServiceProvider ID=%s; entityid=%s; displayname=%s; contacts=%s\n",
$self->get('id'), $self->get('entityid'), $self->get('displayname'), $self->get('contacts');
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
return 1.
}
## list all test accounts
## Class method
sub list_service_providers {
my %args = @_;
my $persistent_accounts= IdPAccountManager::Data::Serviceprovider::Manager->get_serviceproviders(%args);
my $service_providers;
foreach my $persistent_sp (@{$persistent_accounts}) {
my $service_provider = new IdPAccountManager::ServiceProvider($persistent_sp);
push @$service_providers, $service_provider;
}
return $service_providers;
}
1; # Magic true value required at end of module
__END__
=head1 NAME
IdPAccountManager::ServiceProvider - Manage Service Providers for which test accounts have been requested for the Test Identity Provider
=head1 SYNOPSIS
=head1 DESCRIPTION
=head1 SUBROUTINES/METHODS
=head1 AUTHOR
Olivier Salaün (olivier.salaun@renater.fr)