1
/****************************************************************************
3
| Copyright (c) 2007 Novell, Inc.
6
| This program is free software; you can redistribute it and/or
7
| modify it under the terms of version 2 of the GNU General Public License as
8
| published by the Free Software Foundation.
10
| This program is distributed in the hope that it will be useful,
11
| but WITHOUT ANY WARRANTY; without even the implied warranty of
12
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
| GNU General Public License for more details.
15
| You should have received a copy of the GNU General Public License
16
| along with this program; if not, contact Novell, Inc.
18
| To contact Novell about this file by physical or electronic mail,
19
| you may find current contact information at www.novell.com
21
| Author: Bruce Getter <bgetter@novell.com>
22
|***************************************************************************/
27
using Simias.IdentitySync;
29
namespace iFolder.WebService
32
/// Class that represents the current state and configuration
33
/// of the synchronization service.
36
public class SyncServiceInfo
39
/// Date and Time when the synchronization engine was
43
public string UpSince;
46
/// Number of cycles the engine performed
51
/// Name of the registered synchronization provider
53
public string Provider;
56
/// Configured time interval, represented in seconds,
57
/// between synchronization cycles.
59
public int SynchronizationInterval;
62
/// Configured grace period, represented in seconds,
63
/// the sync service will allow a member to remain
64
/// in the domain when the member no longer exists
65
/// in the external identity store.
67
/// Members become disabled in the Simias domain when
68
/// they are no longer exist in the external store.
70
public int DeleteMemberGracePeriod;
73
/// Current status of the synchronization engine
74
/// status will be one of the following:
85
public SyncServiceInfo()
90
/// Get Sync Service Info
92
/// <returns></returns>
93
public static SyncServiceInfo GetSyncServiceInfo()
95
SyncServiceInfo info = new SyncServiceInfo();
99
"{0}, {1} {2} {3} {4}:{5}:{6} GMT",
100
Service.UpSince.DayOfWeek.ToString(),
102
LastSyncInfo.MonthsOfYear[ Service.UpSince.Month - 1 ],
103
Service.UpSince.Year.ToString(),
104
Service.UpSince.Hour,
105
Service.UpSince.Minute,
106
Service.UpSince.Second );
108
info.Cycles = Service.Cycles;
110
// Get the first provider. At the moment, sync engine only supports
111
// one provider anyway.
112
foreach( IIdentitySyncProvider prov in Service.RegisteredProviders.Values )
114
info.Provider = prov.Name;
118
info.DeleteMemberGracePeriod = Service.DeleteGracePeriod;
119
info.SynchronizationInterval = Service.SyncInterval;
120
info.Status = Service.Status;