All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.alogic.ac.loader.acm.xscript.ACMAddAci Maven / Gradle / Ivy
package com.alogic.ac.loader.acm.xscript;
import com.alogic.ac.AccessControlModel;
import com.alogic.xscript.AbstractLogiclet;
import com.alogic.xscript.ExecuteWatcher;
import com.alogic.xscript.Logiclet;
import com.alogic.xscript.LogicletContext;
import com.alogic.xscript.doc.XsObject;
import com.anysoft.util.Properties;
import com.anysoft.util.PropertiesConstants;
/**
* 增加ACL
*
* @since 1.6.12.54 [20191219]
*/
public class ACMAddAci extends AbstractLogiclet {
protected String pid = "$acm-object";
protected String $ip = "*";
protected String $service = "*";
protected String $maxThread = "10";
protected String $timesPerMin = "100000";
protected String $priority = "0";
public ACMAddAci(String tag, Logiclet p) {
super(tag, p);
}
public void configure(Properties p){
super.configure(p);
pid = PropertiesConstants.getString(p,"pid", pid,true);
$maxThread = PropertiesConstants.getRaw(p, "maxThread", $maxThread);
$timesPerMin = PropertiesConstants.getRaw(p, "timesPerMin", $timesPerMin);
$priority = PropertiesConstants.getRaw(p, "priority", $priority);
$ip = PropertiesConstants.getRaw(p, "ip", $ip);
$service = PropertiesConstants.getRaw(p, "service", $service);
}
@Override
protected void onExecute(XsObject root, XsObject current, LogicletContext ctx,
ExecuteWatcher watcher) {
AccessControlModel acm = ctx.getObject(pid);
if (acm == null){
log("the acm object is null:" + pid,LOG_WARNING,ctx);
return ;
}
acm.addACI(
PropertiesConstants.transform(ctx,$ip,"*"),
PropertiesConstants.transform(ctx,$service,"*"),
PropertiesConstants.transform(ctx,$maxThread,10),
PropertiesConstants.transform(ctx,$timesPerMin,100000),
PropertiesConstants.transform(ctx,$priority,0)
);
}
}