コード例 #1
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 public AccessList(UsageManager manager) {
   myManager = manager;
   codePoint = Usage_Code_Point.ACCESS_LIST;
   length = 0;
   SetHashCode();
 }
コード例 #2
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// If the registration is of type "sip_registration_uri", then the
 /// contents are an opaque string containing the URI.
 /// </summary>
 /// <param name="sip_uri">The SIP URI to be stored</param>
 private SipRegistration(String sip_uri, UsageManager manager) {
   if (sip_uri == null || sip_uri.Length == 0)
     throw new ArgumentNullException("SIP URI can not be null or size = 0");
   codePoint = Usage_Code_Point.SIP_REGISTRATION;
   type = SipRegistrationType.sip_registration_uri;
   data = new SipRegistrationData(sip_uri);
   length = (UInt16)(sip_uri.Length + 2); // +2 for preceding length value (short)
   myManager = manager;
 }
コード例 #3
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// This constructor instanciates a DisCoRegistration containing the Destination List towards the focus and its coordinate value.
 /// </summary>
 /// <param name="coordinate">The focus' relative position in the network.</param>
 /// <param name="dest_list"></param>
 public DisCoRegistration(string resName, string coordinate,
     NodeId nodeId, UsageManager manager) {
   if (coordinate == null || nodeId == null)
     throw new ArgumentNullException("DisCoRegistration does not accept null parameters");
   myManager = manager;
   resourceName = resName;
   length = (UInt16)(resName.Length + 2);
   length += (UInt16)nodeId.Digits;
   length += (UInt16)(coordinate.Length + 2);
   length += 2; // length itself
   data = new DisCoRegistrationData(coordinate, nodeId);
 }
コード例 #4
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
    /// <summary>
    /// This contructor instanciates an Access List Kind.
    /// </summary>
    /// <param name="resource_name">The Name of the Resource to be shared.</param>
    /// <param name="kindId">The Kind Id of the Resource to be shared.</param>
    /// <param name="to_user"></param>
    /// <param name="to_user"></param>
    /// <param name="allow_delegation"></param>
    private AccessList(string resource_name, string to_user,
        UInt32 kindId, Boolean allow_delegation, UsageManager manager) {

      if (resource_name == null || kindId == 0 || to_user == null)
        throw new ArgumentNullException("An Access List does not allow null parameter.");
      codePoint = Usage_Code_Point.ACCESS_LIST;
      this.resource_name = resource_name;
      length = (UInt16)(resource_name.Length + 2);
      length += (UInt16)2; // KindId            
      length += (UInt16)(to_user.Length + 2);
      length += (UInt16)1; // Boolean allow_delegation
      length += 2; // the length itself

      data = new AccessListData(kindId, to_user, allow_delegation);

      myManager = manager;
      SetHashCode();
    }
コード例 #5
0
ファイル: DataTypes.cs プロジェクト: RELOAD-NET/RELOAD.NET
        /// <summary>
        /// Use this contructor to create a StoreDataSpecifier that requests a dictionary.
        /// </summary>
        /// <param name="keys">The value keys to be fetched. Set this parameter null to create a wildcard fetch.</param>
        /// <param name="kindId">The Kind ID of the requsted Kind</param>
        /// <param name="model">The Data Model this Kind uses</param>
        /// <param name="generation">The generation_counter of this value</param>
        public StoredDataSpecifier(List<string> keys, UInt32 kindId, UInt64 generation, UsageManager manager) {
            if (kindId == 0)
                throw new ArgumentNullException("StoredDataSpecifier does not support null or 0 values");
            if (manager.GetDataModelfromKindId(kindId) != ReloadGlobals.DataModel.DICTIONARY)
                throw new ArgumentException("Use this contructor only for dictionary data Fetch requests");

            this.kindId = kindId;
            this.generation = generation;
            this.keys = keys;
            myManager = manager;

            // wildcast
            if (keys != null || keys.Count == 0) {
                length += 0;
            }
            else {
                foreach (string key in keys) {
                    length += (UInt16)key.Length;
                }
            }
        }
コード例 #6
0
ファイル: Messages.cs プロジェクト: RELOAD-NET/RELOAD.NET
        public StoreReq(ResourceId resId, List<StoreKindData> store_kind_data,
          UsageManager manager, bool replica)
        {
            resourceId = resId;
            this.RELOAD_MsgCode = RELOAD_MessageCode.Store_Request;
            if (store_kind_data != null && store_kind_data.Count != 0)
            {
                this.store_kind_data = store_kind_data;
            }
            myManager = manager;

            if (replica)
                setReplicaNumber();

        }
コード例 #7
0
	/// <summary>
	/// See also the usage registration procedure at <seealso cref="Machine.InitUsageManager"/>.
	/// </summary>
	public ImageStoreUsage(UsageManager UsageManager)
	{
		this.UsageManager = UsageManager;
	}
コード例 #8
0
ファイル: DataTypes.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// Use this contructor to create a StoreDataSpecifier that requests a singale value.
 /// </summary>
 /// <param name="kindId">The Kind ID of the requsted Kind</param>
 /// <param name="model">The Data Model this Kind uses</param>
 /// <param name="generation">The generation_counter of this value</param>
 public StoredDataSpecifier(UInt32 kindId, UInt64 generation, UsageManager manager) {
     if (kindId == 0)
         throw new ArgumentNullException("StoredDataSpecifier does not support null or 0 values");
     if (manager.GetDataModelfromKindId(kindId) != ReloadGlobals.DataModel.SINGLE_VALUE)
         throw new ArgumentException("Use this contructor only for single value Fetch requests");
     this.kindId = kindId;
     this.generation = generation;
     length = 0;
     myManager = manager;
 }
コード例 #9
0
ファイル: Messages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 public FetchAns(List<FetchKindResponse> kind_responses, UsageManager manager)
 {
     this.RELOAD_MsgCode = RELOAD_MessageCode.Fetch_Answer;
     this.kind_responses = kind_responses;
     myManager = manager;
 }
コード例 #10
0
ファイル: Messages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 public FetchAns(UsageManager manager)
 {
     this.RELOAD_MsgCode = RELOAD_MessageCode.Fetch_Answer;
     kind_responses = new List<FetchKindResponse>();
     myManager = manager;
 }
コード例 #11
0
ファイル: Messages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 public FetchReq(UsageManager manager)
 {
     specifiers = new List<StoredDataSpecifier>();
     myManager = manager;
 }
コード例 #12
0
ファイル: Messages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 public FetchReq(ResourceId resourceId, List<StoredDataSpecifier> specifiers,
   UsageManager manager)
 {
     this.RELOAD_MsgCode = RELOAD_MessageCode.Fetch_Request;
     this.resource = resourceId;
     this.specifiers = new List<StoredDataSpecifier>();
     this.specifiers.AddRange(specifiers);
     myManager = manager;
 }
コード例 #13
0
ファイル: Messages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 public StoreReq(UsageManager manager)
 {
     store_kind_data = new List<StoreKindData>();
     myManager = manager;
 }
コード例 #14
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 private SipRegistration(String contact_prefs, List<Destination> destination_list, UsageManager manager) {
   if (contact_prefs == null || destination_list == null || destination_list.Count == 0)
     throw new ArgumentException("SipRegistration does not allow null parameter or destination list < 1");
   type = SipRegistrationType.sip_registration_route;
   codePoint = Usage_Code_Point.SIP_REGISTRATION;
   length = (UInt16)(contact_prefs.Length + 2);
   length += (UInt16)(ReloadMessage.GetDestListNetLength(destination_list) + 2); // + 2 destList preceeding "length" value
   data = new SipRegistrationData(contact_prefs, destination_list);
   myManager = manager;
 }
コード例 #15
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// This contructor should be taken if you want to create a RedirServiceProvider from wire.
 /// </summary>        
 public RedirServiceProvider(UsageManager manager) {
   myManager = manager;
   codePoint = Usage_Code_Point.REDIR_SERVICE_PROVIDER;
 }
コード例 #16
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// Use this constructor just to have a SipRegistration object.
 /// </summary>
 public SipRegistration(UsageManager manager) {
   myManager = manager;
   codePoint = Usage_Code_Point.SIP_REGISTRATION;
   //length = 0;
 }
コード例 #17
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
    /// <summary>
    /// This constructor instantiates a RedirServiceProvider
    /// </summary>
    /// <param name="serviceProvider">The NodeId of the ServiceProvider.</param>
    /// <param name="resourceName">resourceName is "nameSpace,level,node"</param>
    /// <param name="level">level in Redir Tree</param>
    /// <param name="node">node in Redir Tree</param>
    public RedirServiceProvider(NodeId serviceProvider, string resourceName, string nameSpace, UInt16 level, UInt16 node, UsageManager manager) {
      if (serviceProvider == null || nameSpace == null)
        throw new ArgumentNullException("RedirServiceProvider does not accept null parameters");

      codePoint = Usage_Code_Point.REDIR_SERVICE_PROVIDER;
      data = new RedirServiceProviderData(serviceProvider, nameSpace, level, node);

      myManager = manager;
      this.resourceName = resourceName;
    }
コード例 #18
0
ファイル: DataTypes.cs プロジェクト: RELOAD-NET/RELOAD.NET
        /// <summary>
        /// Use this contructor to create a StoreDataSpecifier that requests an
        /// array Range.
        /// </summary>
        /// <param name="indices">The array ranges you want to fetch</param>
        /// <param name="kindId">The Kind ID of the requsted Kind</param>
        /// <param name="model">The Data Model this Kind uses</param>
        /// <param name="generation">The generation_counter of this value</param>
        public StoredDataSpecifier(List<ArrayRange> indices, UInt32 kindId,
          UInt64 generation, UsageManager manager) {
            if (kindId == 0)
                throw new ArgumentNullException(
                  "StoredDataSpecifier does not support null or 0 values");
            if (manager.GetDataModelfromKindId(kindId) != ReloadGlobals.DataModel.ARRAY)
                throw new ArgumentException(
                  "Use this contructor only for array data Fetch requests");
            if (indices == null)
                throw new ArgumentNullException(
                  "StoredDataSpecifier for array needs at least one ArrayRange!");

            //While multiple ranges MAY be specified, they MUST NOT overlap.
            indices.Sort();
            myManager = manager;
            this.kindId = kindId;
            this.generation = generation;
            this.indices = new List<ArrayRange>();
            this.indices.AddRange(indices);
            foreach (ArrayRange arrayRange in indices) {
                length += (UInt16)8; // 2 times an UInt32        
            }
        }
コード例 #19
0
ファイル: Usages.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// This contructor should be taken if you want to create a DisCoRegistration from wire.
 /// </summary>        
 public DisCoRegistration(UsageManager manager) {
   myManager = manager;
   codePoint = Usage_Code_Point.DISCO;
   length = 0;
 }
コード例 #20
0
ファイル: DataTypes.cs プロジェクト: RELOAD-NET/RELOAD.NET
 /// <summary>
 /// Just an initializer! Use only while reading a message from wire.
 /// </summary>
 public StoredDataSpecifier(UsageManager manager) { myManager = manager; }
コード例 #21
0
ファイル: Machine.cs プロジェクト: RELOAD-NET/RELOAD.NET
    public Machine() {
      m_ReloadConfig = new ReloadConfig(this);

      m_UsageManager = new UsageManager();

      gatheredSpecifiers = new List<StoredDataSpecifier>();

      gatheredStoreDatas = new List<StoreKindData>();
	  
	  gatheredSpecifiersQueue = new Port<List<StoredDataSpecifier>>();

    gatheredStoreDatasQueue = new Port<List<StoreKindData>>();

	  storeViaGateway = new Dictionary<List<StoreKindData>, NodeId>();

	  fetchViaGateway = new Dictionary<List<StoredDataSpecifier>, NodeId>();

    }