예제 #1
0
 /// <summary>
 /// LoadModel reloads the model from the model CONF file. Because the policy is
 /// attached to a model, so the policy is invalidated and needs to be reloaded by
 /// calling LoadPolicy().
 /// calling LoadPolicy().
 /// </summary>
 public void LoadModel()
 {
     model = NewModel();
     model.LoadModel(this.modelPath);
     fm = FunctionMap.LoadFunctionMap();
     InitializeInterpreter();
 }
예제 #2
0
        public static FunctionMap LoadFunctionMap()
        {
            FunctionMap fm = new FunctionMap();

            fm._fm = new Dictionary <string, AbstractFunction>();
            fm.AddFunction("keyMatch", new KeyMatchFunc());
            fm.AddFunction("keyMatch2", new KeyMatch2Func());
            fm.AddFunction("regexMatch", new RegexMatchFunc());
            fm.AddFunction("ipMatch", new IPMatchFunc());
            return(fm);
        }
예제 #3
0
        public Enforcer(Model.Model model, IAdapter adapter)
        {
            this.adapter = adapter;
            watcher      = null;

            this.model  = model;
            functionMap = FunctionMap.LoadFunctionMap();

            Initialize();
            LoadPolicy();
        }
예제 #4
0
        public Enforcer(Model.Model m, IAdapter adapter)
        {
            this.adapter = adapter;
            this.watcher = null;

            model = m;
            fm    = FunctionMap.LoadFunctionMap();

            Initialize();

            if (this.adapter != null)
            {
                LoadPolicy();
            }
        }
예제 #5
0
 /// <summary>
 /// LoadModel reloads the model from the model CONF file. Because the policy is
 /// attached to a model, so the policy is invalidated and needs to be reloaded by
 /// calling LoadPolicy().
 /// calling LoadPolicy().
 /// </summary>
 public void LoadModel()
 {
     model = NewModel();
     model.LoadModel(this.modelPath);
     fm = FunctionMap.LoadFunctionMap();
 }
예제 #6
0
 /// <summary>
 /// sets the current model.
 /// </summary>
 /// <param name="model"> the model.</param>
 public void SetModel(Model model)
 {
     this.model = model;
     fm         = FunctionMap.LoadFunctionMap();
 }
예제 #7
0
 /// <summary>
 /// sets the current model.
 /// </summary>
 /// <param name="model"> the model.</param>
 public void SetModel(Model.Model model)
 {
     this.model = model;
     fm         = FunctionMap.LoadFunctionMap();
     InitializeInterpreter();
 }
예제 #8
0
 /// <summary>
 /// LoadModel reloads the model from the model CONF file. Because the policy is
 /// Attached to a model, so the policy is invalidated and needs to be reloaded by
 /// calling LoadPolicy().
 /// </summary>
 public void LoadModel()
 {
     model = NewModel();
     model.LoadModel(modelPath);
     functionMap = FunctionMap.LoadFunctionMap();
 }