00001 #ifndef DSLOGADMIN_IDL
00002 #define DSLOGADMIN_IDL
00003
00004 #include <TimeBase.idl>
00005
00016 #pragma prefix "omg.org"
00017
00018 module DsLogAdmin
00019 {
00027 exception InvalidParam
00028 {
00029 string details;
00030 };
00031
00037 exception InvalidThreshold {};
00038
00045 exception InvalidTime {};
00046
00052 exception InvalidTimeInterval {};
00053
00058 exception InvalidMask {};
00059
00064 exception LogIdAlreadyExists {};
00065
00070 exception InvalidGrammar {};
00071
00076 exception InvalidConstraint {};
00077
00083 exception LogFull
00084 {
00085 short n_records_written;
00086 };
00087
00094 exception LogOffDuty {};
00095
00102 exception LogLocked {};
00103
00109 exception LogDisabled {};
00110
00116 exception InvalidRecordId {};
00117
00123 exception InvalidAttribute
00124 {
00125 string attr_name;
00126 any value;
00127 };
00128
00133 exception InvalidLogFullAction {};
00134
00135 typedef unsigned long LogId;
00136
00137 typedef unsigned long long RecordId;
00138
00139 typedef sequence<RecordId> RecordIdList;
00140
00141 const string default_grammar = "EXTENDED_TCL";
00142
00143 typedef string Constraint;
00144
00145 typedef TimeBase::TimeT TimeT;
00146
00150 struct NVPair
00151 {
00152 string name;
00153 any value;
00154 };
00155
00156 typedef sequence<NVPair> NVList;
00157
00163 struct TimeInterval
00164 {
00165 TimeT start;
00166 TimeT stop;
00167 };
00168
00174 struct LogRecord
00175 {
00176 RecordId id;
00177 TimeT time;
00178 NVList attr_list;
00179 any info;
00180 };
00181
00182 typedef sequence<LogRecord> RecordList;
00183
00184 typedef sequence<any> Anys;
00185
00186
00187
00192 interface Iterator
00193 {
00205 RecordList get(in unsigned long position,
00206 in unsigned long how_many)
00207 raises (InvalidParam);
00208
00212 void destroy();
00213 };
00214
00226 struct AvailabilityStatus
00227 {
00228 boolean off_duty;
00229 boolean log_full;
00230 };
00231
00232 typedef unsigned short LogFullActionType;
00233
00238 const LogFullActionType wrap = 0;
00239
00244 const LogFullActionType halt = 1;
00245
00250 struct Time24
00251 {
00252 unsigned short hour;
00253 unsigned short minute;
00254 };
00255
00260 struct Time24Interval
00261 {
00262 Time24 start;
00263 Time24 stop;
00264 };
00265
00266 typedef sequence<Time24Interval> IntervalsOfDay;
00267
00268 const unsigned short Sunday = 1;
00269
00270 const unsigned short Monday = 2;
00271
00272 const unsigned short Tuesday = 4;
00273
00274 const unsigned short Wednesday = 8;
00275
00276 const unsigned short Thursday = 16;
00277
00278 const unsigned short Friday = 32;
00279
00280 const unsigned short Saturday = 64;
00281
00282 typedef unsigned short DaysOfWeek;
00283
00288 struct WeekMaskItem
00289 {
00290 DaysOfWeek days;
00291 IntervalsOfDay intervals;
00292 };
00293
00294 typedef sequence<WeekMaskItem> WeekMask;
00295
00296 typedef unsigned short Threshold;
00297
00298 typedef sequence<Threshold> CapacityAlarmThresholdList;
00299
00300 interface LogMgr;
00301
00307 enum OperationalState
00308 {
00309 disabled,
00310 enabled
00311 };
00312
00318 enum AdministrativeState
00319 {
00320 locked,
00321 unlocked
00322 };
00323
00329 enum ForwardingState
00330 {
00331 on,
00332 off
00333 };
00334
00335 typedef unsigned short QoSType;
00336
00337 typedef sequence<QoSType> QoSList;
00338
00344 exception UnsupportedQoS
00345 {
00346 QoSList denied;
00347 };
00348
00349 const QoSType QoSNone = 0;
00350
00351 const QoSType QoSFlush = 1;
00352
00353 const QoSType QoSReliability = 2;
00354
00358 interface Log
00359 {
00365 LogMgr my_factory();
00366
00371 LogId id();
00372
00377 QoSList get_log_qos();
00378
00386 void set_log_qos(in QoSList qos)
00387 raises(UnsupportedQoS);
00388
00389
00396 unsigned long get_max_record_life();
00397
00404 void set_max_record_life(in unsigned long life);
00405
00406
00412 unsigned long long get_max_size();
00413
00422 void set_max_size(in unsigned long long size)
00423 raises (InvalidParam);
00424
00429 unsigned long long get_current_size();
00430
00435 unsigned long long get_n_records();
00436
00450 LogFullActionType get_log_full_action();
00451
00459 void set_log_full_action(in LogFullActionType action)
00460 raises(InvalidLogFullAction);
00461
00469 AdministrativeState get_administrative_state();
00470
00475 void set_administrative_state(in AdministrativeState state);
00476
00481 ForwardingState get_forwarding_state();
00482
00489 void set_forwarding_state(in ForwardingState state);
00490
00497 OperationalState get_operational_state();
00498
00499
00504 TimeInterval get_interval();
00505
00522 void set_interval(in TimeInterval interval)
00523 raises (InvalidTime, InvalidTimeInterval);
00524
00525
00541 AvailabilityStatus get_availability_status();
00542
00543
00549 CapacityAlarmThresholdList get_capacity_alarm_thresholds();
00550
00561 void set_capacity_alarm_thresholds(in CapacityAlarmThresholdList threshs)
00562 raises (InvalidThreshold);
00563
00564
00569 WeekMask get_week_mask();
00570
00589 void set_week_mask(in WeekMask masks)
00590 raises (InvalidTime, InvalidTimeInterval, InvalidMask);
00591
00604 RecordList query(in string grammar,
00605 in Constraint c,
00606 out Iterator i)
00607 raises(InvalidGrammar, InvalidConstraint);
00608
00609
00621 RecordList retrieve(in TimeT from_time,
00622 in long how_many,
00623 out Iterator i);
00624
00625
00637 unsigned long match(in string grammar, in Constraint c)
00638 raises(InvalidGrammar, InvalidConstraint);
00639
00640
00651 unsigned long delete_records(in string grammar, in Constraint c)
00652 raises(InvalidGrammar, InvalidConstraint);
00653
00659 unsigned long delete_records_by_id(in RecordIdList ids);
00660
00671 void write_records(in Anys records)
00672 raises(LogFull, LogOffDuty, LogLocked, LogDisabled);
00673
00684 void write_recordlist(in RecordList list)
00685 raises(LogFull, LogOffDuty, LogLocked, LogDisabled);
00686
00687
00700 void set_record_attribute(in RecordId id, in NVList attr_list)
00701 raises(InvalidRecordId, InvalidAttribute);
00702
00703
00704
00721 unsigned long set_records_attribute(in string grammar,
00722 in Constraint c,
00723 in NVList attr_list)
00724 raises(InvalidGrammar, InvalidConstraint, InvalidAttribute);
00725
00726
00734 NVList get_record_attribute(in RecordId id)
00735 raises(InvalidRecordId);
00736
00743 Log copy(out LogId id);
00744
00753 Log copy_with_id (in LogId id) raises (LogIdAlreadyExists);
00754
00761 void flush()
00762 raises (UnsupportedQoS);
00763 };
00764
00768 interface BasicLog : Log
00769 {
00773 void destroy();
00774 };
00775
00776 typedef sequence<Log> LogList;
00777
00778 typedef sequence<LogId> LogIdList;
00779
00783 interface LogMgr
00784 {
00789 LogList list_logs();
00790
00796 Log find_log(in LogId id);
00797
00802 LogIdList list_logs_by_id();
00803 };
00804
00808 interface BasicLogFactory : LogMgr
00809 {
00820 BasicLog create
00821 (
00822 in LogFullActionType full_action,
00823 in unsigned long long max_size,
00824 out LogId id
00825 )
00826 raises (InvalidLogFullAction);
00827
00839 BasicLog create_with_id
00840 (
00841 in LogId id,
00842 in LogFullActionType full_action,
00843 in unsigned long long max_size
00844 )
00845 raises (LogIdAlreadyExists, InvalidLogFullAction);
00846 };
00847 };
00848
00849 #endif