⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dslogadmin.idl

📁 UCS (Ultra Corba Simulator) is one more powerful corba client/servant simulator tool than other simi
💻 IDL
字号:
#ifndef _DSLOGADMIN_IDL
#define _DSLOGADMIN_IDL

#include <TimeBase.idl> // CORBA Time Service
#pragma prefix "omg.org"

module DsLogAdmin
{
	exception InvalidParam {string details;};
	exception InvalidThreshold {};
	exception InvalidTime {};
	exception InvalidTimeInterval {};
	exception InvalidMask {};
	exception LogIdAlreadyExists {};
	exception InvalidGrammar{};
	exception InvalidConstraint{};
	exception LogFull {short n_records_written;};
	exception LogOffDuty {};
	exception LogLocked {};
	exception LogDisabled {};
	exception InvalidRecordId {};
	exception InvalidAttribute {string attr_name; any value;};
	exception InvalidLogFullAction {};

	typedef unsigned long LogId;
	typedef unsigned long long RecordId;
	typedef sequence<RecordId> RecordIdList;

	const string default_grammar = "EXTENDED_TCL";
	typedef string Constraint;

	typedef TimeBase::TimeT TimeT;


	struct NVPair {
		string name;
		any    value;
	};
	typedef sequence<NVPair> NVList;

	struct TimeInterval {
		TimeT start;
		TimeT stop;
	};

	struct LogRecord {
		RecordId id;
		TimeT    time;
		NVList   attr_list; // attributes, optional
	  	any      info;
			};
		typedef sequence<LogRecord> RecordList;
		typedef sequence<any>        Anys;

		// Iterator with bulk operation support; returned as a
		// result of querying the Log

	interface Iterator {
	  	RecordList get(in unsigned long position,
	  			in unsigned long how_many) raises(InvalidParam);
	  	void destroy();
			};    

	struct AvailabilityStatus {
 				boolean off_duty;
				boolean log_full;
	}; 
  
	typedef unsigned short LogFullActionType;

	const LogFullActionType wrap = 0;
	const LogFullActionType halt = 1;

	struct Time24 {
		unsigned short hour;	// 0-23
		unsigned short minute;	// 0-59
	};

	struct Time24Interval {
		Time24 start;
		Time24 stop;
	};
	typedef sequence<Time24Interval> IntervalsOfDay;

	const unsigned short Sunday    =  1;
	const unsigned short Monday    =  2;
	const unsigned short Tuesday   =  4;
	const unsigned short Wednesday =  8;
	const unsigned short Thursday  = 16;
	const unsigned short Friday    = 32;
	const unsigned short Saturday  = 64;

	typedef unsigned short DaysOfWeek;	// Bit mask of week days

	struct WeekMaskItem {
		DaysOfWeek     days;
		IntervalsOfDay intervals;
	};
	typedef sequence<WeekMaskItem> WeekMask; 

	typedef unsigned short Threshold; // 0-100 %
	typedef sequence<Threshold> CapacityAlarmThresholdList;

	interface LogMgr;

	enum OperationalState    { disabled, enabled };
	enum AdministrativeState { locked, unlocked }; // logging on/off
	enum ForwardingState     { on, off };

	typedef unsigned short QoSType;
	typedef sequence<QoSType> QoSList;
	exception UnsupportedQoS { QoSList denied; };
  
	const QoSType QoSNone    = 0;
	const QoSType QoSFlush	 = 1;
	const QoSType QoSReliability = 2;
	
	interface Log
	{
		LogMgr my_factory();

		LogId id();

		QoSList get_log_qos();
		void set_log_qos(in QoSList qos) raises(UnsupportedQoS);

		// life in seconds (0 infinite)
		unsigned long get_max_record_life();
		void set_max_record_life(in unsigned long life);

		// size in octets
		unsigned long long get_max_size();
		void set_max_size(in unsigned long long size) raises (InvalidParam);

		unsigned long long get_current_size(); // size in octets
		unsigned long long get_n_records();    // number of records

		LogFullActionType get_log_full_action();
		void set_log_full_action(in LogFullActionType action)
			raises(InvalidLogFullAction);

		AdministrativeState get_administrative_state();
		void set_administrative_state(in AdministrativeState state);

		ForwardingState get_forwarding_state();
		void set_forwarding_state(in ForwardingState state);

		OperationalState get_operational_state();

		// log duration
		TimeInterval get_interval();
		void set_interval(in TimeInterval interval)
			raises (InvalidTime, InvalidTimeInterval);

		// availability status
		AvailabilityStatus get_availability_status();

 		// capacity alarm threshold
		CapacityAlarmThresholdList get_capacity_alarm_thresholds();
		void set_capacity_alarm_thresholds(
				in CapacityAlarmThresholdList threshs)
			raises (InvalidThreshold);

		// weekly scheduling
		WeekMask get_week_mask();
		void set_week_mask(in WeekMask masks)
			raises (InvalidTime, InvalidTimeInterval, InvalidMask);

		RecordList query(in  string grammar,
					in  Constraint c,
					out Iterator i)
			raises(InvalidGrammar, InvalidConstraint);

		// negative how_many indicates backwards retrieval
		RecordList retrieve(in TimeT from_time,
					in long how_many,
					out Iterator i);

		// returns number of records matching constraint
		unsigned long match(in  string grammar,
					in  Constraint c)
			raises(InvalidGrammar, InvalidConstraint);

		// returns number of records deleted
		unsigned long delete_records(in  string grammar,
							in  Constraint c)
			raises(InvalidGrammar, InvalidConstraint);

		unsigned long delete_records_by_id(in RecordIdList ids);

		void write_records(in Anys records) 
			raises(LogFull, LogOffDuty, LogLocked, LogDisabled);
//		void write_records(in Anys records) 
//			raises(LogFull, LogOffDuty, LogLocked, LogDisabled);

		// set single record attributes
		void set_record_attribute(in RecordId id,
			 			  in NVList      attr_list)
			raises(InvalidRecordId, InvalidAttribute);
   
		// set all records that matches the constraints with same attr_list
		// returns number of records whose attributes have been set
		unsigned long set_records_attribute(in string grammar, 
			 					in Constraint c,
			 					in NVList      attr_list)
			raises(InvalidGrammar, InvalidConstraint, InvalidAttribute); 

		// get record attributes
		NVList get_record_attribute(in RecordId id)
			raises(InvalidRecordId);

		Log copy(out LogId id);
		Log copy_with_id (in LogId id) raises (LogIdAlreadyExists);
   
		void flush() raises (UnsupportedQoS);
	};

	interface BasicLog : Log {
		void destroy();
	};

	typedef sequence<Log> LogList;	
	typedef sequence<LogId> LogIdList;

	interface LogMgr
	{
		LogList list_logs();
		Log find_log(in LogId id);
		LogIdList list_logs_by_id();
	};

	interface BasicLogFactory : LogMgr
	{
		BasicLog create (
			in LogFullActionType full_action,
			in unsigned long long max_size,
			out LogId id)
			raises (InvalidLogFullAction);


		BasicLog create_with_id 
		(
			in LogId id,
			in LogFullActionType full_action,
			in unsigned long long max_size
		)
			raises (LogIdAlreadyExists, InvalidLogFullAction);
	};

};
#endif // _DSLOGADMIN_IDL

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -