當前位置: 首頁>>代碼示例>>Java>>正文


Java Permission類代碼示例

本文整理匯總了Java中org.dsa.iot.dslink.node.Permission的典型用法代碼示例。如果您正苦於以下問題:Java Permission類的具體用法?Java Permission怎麽用?Java Permission使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Permission類屬於org.dsa.iot.dslink.node包,在下文中一共展示了Permission類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeDiscoverAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makeDiscoverAction() {
		Action act = new Action(Permission.READ, new Handler<ActionResult>() {
			public void handle(ActionResult event) {
				discover();
			}
		});
		Node anode = node.getChild("discover");
		if (anode == null) node.createChild("discover").setAction(act).build().setSerializable(false);
		else anode.setAction(act);
		
//		act = new Action(Permission.READ, new Handler<ActionResult>() {
//			public void handle(ActionResult event) {
//				update();
//			}
//		});
//		anode = node.getChild("update");
//		if (anode == null) node.createChild("update").setAction(act).build().setSerializable(false);
//		else anode.setAction(act);
	}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-dnp3,代碼行數:20,代碼來源:DnpOutstation.java

示例2: getEditAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
@Override
Action getEditAction() {
	Action act = new Action(Permission.READ, new EditHandler());
	act.addParameter(new Parameter(ATTR_NAME, ValueType.STRING, new Value(node.getName())));
	act.addParameter(new Parameter(ATTR_TRANSPORT_TYPE, ValueType.makeEnum(Util.enumNames(IpTransportType.class))));
	act.addParameter(new Parameter(ATTR_HOST, ValueType.STRING, node.getAttribute(ATTR_HOST)));
	act.addParameter(new Parameter(ATTR_PORT, ValueType.NUMBER, node.getAttribute(ATTR_PORT)));

	act.addParameter(new Parameter(ATTR_TIMEOUT, ValueType.NUMBER, node.getAttribute(ATTR_TIMEOUT)));
	act.addParameter(new Parameter(ATTR_RETRIES, ValueType.NUMBER, node.getAttribute(ATTR_RETRIES)));
	act.addParameter(
			new Parameter(ATTR_MAX_READ_BIT_COUNT, ValueType.NUMBER, node.getAttribute(ATTR_MAX_READ_BIT_COUNT)));
	act.addParameter(new Parameter(ATTR_MAX_READ_REGISTER_COUNT, ValueType.NUMBER,
			node.getAttribute(ATTR_MAX_READ_REGISTER_COUNT)));
	act.addParameter(new Parameter(ATTR_MAX_WRITE_REGISTER_COUNT, ValueType.NUMBER,
			node.getAttribute(ATTR_MAX_WRITE_REGISTER_COUNT)));
	act.addParameter(
			new Parameter(ATTR_DISCARD_DATA_DELAY, ValueType.NUMBER, node.getAttribute(ATTR_DISCARD_DATA_DELAY)));
	act.addParameter(new Parameter(ATTR_USE_MULTIPLE_WRITE_COMMAND, ValueType.makeEnum(MULTIPLE_WRITE_COMMAND_OPTIONS),
			node.getAttribute(ATTR_USE_MULTIPLE_WRITE_COMMAND)));

	return act;
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:24,代碼來源:IpConnection.java

示例3: makeImportAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makeImportAction(final Node fnode) {
    Action act = new Action(Permission.READ, new Handler<ActionResult>(){
        @Override
        public void handle(ActionResult event) {
            handleImport(fnode, event);
        }
    });
    act.addParameter(new Parameter("Name", ValueType.STRING));
    act.addParameter(new Parameter("JSON", ValueType.STRING).setEditorType(EditorType.TEXT_AREA));
    Node anode = fnode.getChild(ACTION_IMPORT, true);
    if (anode == null) {
        fnode.createChild(ACTION_IMPORT, true).setAction(act).build().setSerializable(false);
    } else {
        anode.setAction(act);
    }
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:17,代碼來源:SlaveFolder.java

示例4: setEditAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
public void setEditAction() {
	Action act = new Action(Permission.READ, new EditHandler());

	act.addParameter(new Parameter(ATTRIBUTE_NAME, ValueType.STRING, new Value(node.getName())));

	act.addParameter(
			new Parameter(ATTRIBUTE_TRANSPORT_TYPE, ValueType.makeEnum(Util.enumNames(IpTransportType.class)),
					node.getAttribute(ATTRIBUTE_TRANSPORT_TYPE)));
	act.addParameter(new Parameter(ATTRIBUTE_PORT, ValueType.NUMBER, node.getAttribute(ATTRIBUTE_PORT)));
	act.addParameter(new Parameter(ATTRIBUTE_SLAVE_ID, ValueType.NUMBER, node.getAttribute(ATTRIBUTE_SLAVE_ID)));

	Node editNode = node.getChild(ACTION_EDIT, true);
	if (editNode == null)
		node.createChild(ACTION_EDIT, true).setAction(act).build().setSerializable(false);
	else
		editNode.setAction(act);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:18,代碼來源:LocalSlaveNode.java

示例5: makeStopAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makeStopAction() {
	Action act = new Action(Permission.READ, new Handler<ActionResult>() {
		public void handle(ActionResult event) {
			if (reconnectFuture != null) {
				reconnectFuture.cancel(false);
			}
			stop();
		}
	});

	Node anode = node.getChild("stop", true);
	if (anode == null)
		node.createChild("stop", true).setAction(act).build().setSerializable(false);
	else
		anode.setAction(act);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:17,代碼來源:ModbusConnection.java

示例6: makeImportAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makeImportAction() {
    Action act = new Action(Permission.READ, new Handler<ActionResult>(){
        @Override
        public void handle(ActionResult event) {
            handleImport(event);
        }
    });
    act.addParameter(new Parameter("Name", ValueType.STRING));
    act.addParameter(new Parameter("JSON", ValueType.STRING).setEditorType(EditorType.TEXT_AREA));
    Node anode = node.getChild(ACTION_IMPORT, true);
    if (anode == null) {
        node.createChild(ACTION_IMPORT, true).setAction(act).build().setSerializable(false);
    } else {
        anode.setAction(act);
    }
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:17,代碼來源:ModbusConnection.java

示例7: getAddIpConnectionAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private Action getAddIpConnectionAction() {
	Action act = new Action(Permission.READ, new AddIpConnectionHandler());
	act.addParameter(new Parameter(ModbusConnection.ATTR_CONNECTION_NAME, ValueType.STRING));
	act.addParameter(new Parameter(ModbusConnection.ATTR_TRANSPORT_TYPE, ValueType.makeEnum("TCP", "UDP")));
	act.addParameter(new Parameter(IpConnection.ATTR_HOST, ValueType.STRING, new Value("")));
	act.addParameter(new Parameter(IpConnection.ATTR_PORT, ValueType.NUMBER, new Value(502)));

	act.addParameter(new Parameter(ModbusConnection.ATTR_TIMEOUT, ValueType.NUMBER, new Value(500)));
	act.addParameter(new Parameter(ModbusConnection.ATTR_RETRIES, ValueType.NUMBER, new Value(2)));
	act.addParameter(new Parameter(ModbusConnection.ATTR_MAX_READ_BIT_COUNT, ValueType.NUMBER, new Value(2000)));
	act.addParameter(
			new Parameter(ModbusConnection.ATTR_MAX_READ_REGISTER_COUNT, ValueType.NUMBER, new Value(125)));
	act.addParameter(
			new Parameter(ModbusConnection.ATTR_MAX_WRITE_REGISTER_COUNT, ValueType.NUMBER, new Value(120)));
	act.addParameter(new Parameter(ModbusConnection.ATTR_DISCARD_DATA_DELAY, ValueType.NUMBER, new Value(0)));
	act.addParameter(
			new Parameter(ModbusConnection.ATTR_USE_MULTIPLE_WRITE_COMMAND, ValueType.makeEnum(ModbusConnection.MULTIPLE_WRITE_COMMAND_OPTIONS), new Value(ModbusConnection.MULTIPLE_WRITE_COMMAND_DEFAULT)));

	return act;
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:21,代碼來源:ModbusLink.java

示例8: makeEditAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
void makeEditAction() {
	Action act = new Action(Permission.READ, new EditHandler());
	act.addParameter(new Parameter(ModbusConnection.ATTR_SLAVE_NAME, ValueType.STRING, new Value(node.getName())));
	act.addParameter(new Parameter(ModbusConnection.ATTR_SLAVE_ID, ValueType.NUMBER,
			node.getAttribute(ModbusConnection.ATTR_SLAVE_ID)));
	double defint = node.getAttribute(ModbusConnection.ATTR_POLLING_INTERVAL).getNumber().doubleValue() / 1000;
	act.addParameter(new Parameter(ModbusConnection.ATTR_POLLING_INTERVAL, ValueType.NUMBER, new Value(defint)));
	act.addParameter(new Parameter(ModbusConnection.ATTR_ZERO_ON_FAILED_POLL, ValueType.BOOL,
			node.getAttribute(ModbusConnection.ATTR_ZERO_ON_FAILED_POLL)));
	act.addParameter(new Parameter(ModbusConnection.ATTR_USE_BATCH_POLLING, ValueType.BOOL,
			node.getAttribute(ModbusConnection.ATTR_USE_BATCH_POLLING)));
	act.addParameter(new Parameter(ModbusConnection.ATTR_CONTIGUOUS_BATCH_REQUEST_ONLY, ValueType.BOOL,
			node.getAttribute(ModbusConnection.ATTR_CONTIGUOUS_BATCH_REQUEST_ONLY)));

	Node anode = node.getChild(ACTION_EDIT, true);
	if (anode == null)
		node.createChild(ACTION_EDIT, true).setAction(act).build().setSerializable(false);
	else
		anode.setAction(act);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:21,代碼來源:SlaveNode.java

示例9: makeRemoveAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makeRemoveAction() {
	Action act = new Action(Permission.READ, new Handler<ActionResult>() { 
		public void handle(ActionResult event) {
			remove();
		}
	});
	Node anode = node.getChild("remove");
	if (anode == null) node.createChild("remove").setAction(act).build().setSerializable(false);
	else anode.setAction(act);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-dnp3,代碼行數:11,代碼來源:DnpOutstation.java

示例10: makeEditAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
void makeEditAction() {
	Action act = new Action(Permission.READ, new Handler<ActionResult>() {
		public void handle(ActionResult event) {
			edit(event);
		}
	});

	act.addParameter(new Parameter("Name", ValueType.STRING, new Value(node.getName())));
	if (isSerial) {
		Set<String> portids = link.getCOMPorts();
		if (portids.size() > 0) {
			if (portids.contains(node.getAttribute("COM Port").getString())) {
				act.addParameter(new Parameter("COM Port", ValueType.makeEnum(portids), node.getAttribute("COM Port")));
				act.addParameter(new Parameter("COM Port (manual entry)", ValueType.STRING));
			} else {
				act.addParameter(new Parameter("COM Port", ValueType.makeEnum(portids)));
				act.addParameter(new Parameter("COM Port (manual entry)", ValueType.STRING, node.getAttribute("COM Port")));
			}
		} else {
			act.addParameter(new Parameter("COM Port", ValueType.STRING, node.getAttribute("COM Port")));
		}
		act.addParameter(new Parameter("Baud Rate", ValueType.NUMBER, node.getAttribute("Baud Rate")));
		act.addParameter(new Parameter("Data Bits", ValueType.NUMBER, node.getAttribute("Data Bits")));
		act.addParameter(new Parameter("Stop Bits", ValueType.NUMBER, node.getAttribute("Stop Bits")));
		act.addParameter(new Parameter("Parity", ValueType.NUMBER, node.getAttribute("Parity")));
	} else {
		act.addParameter(new Parameter("Host", ValueType.STRING, node.getAttribute("Host")));
		act.addParameter(new Parameter("Port", ValueType.NUMBER, node.getAttribute("Port")));
	}
	act.addParameter(new Parameter("Master Address", ValueType.NUMBER, node.getAttribute("Master Address")));
	act.addParameter(new Parameter("Outstation Address", ValueType.NUMBER, node.getAttribute("Outstation Address")));
	double defint = node.getAttribute("Event Polling Interval").getNumber().doubleValue() / 1000;
	act.addParameter(new Parameter("Event Polling Interval", ValueType.NUMBER, new Value(defint)));
	double defsint = node.getAttribute("Static Polling Interval").getNumber().doubleValue() / 1000;
	act.addParameter(new Parameter("Static Polling Interval", ValueType.NUMBER, new Value(defsint)));
	Node anode = node.getChild("edit");
	if (anode == null) node.createChild("edit").setAction(act).build().setSerializable(false);
	else anode.setAction(act);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-dnp3,代碼行數:40,代碼來源:DnpOutstation.java

示例11: makePortScanAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makePortScanAction() {
	Action act = new Action(Permission.READ, new Handler<ActionResult>() {
		public void handle(ActionResult event) {
			doPortScan();
		}
	});
	node.createChild("scan for serial ports").setAction(act).build().setSerializable(false);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-dnp3,代碼行數:9,代碼來源:DnpLink.java

示例12: setAddPointAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
@Override
public void setAddPointAction() {

	Action act = new Action(Permission.READ, new AddPointHandler());
	act.addParameter(new Parameter(ATTRIBUTE_NAME, ValueType.STRING));
	act.addParameter(new Parameter(ATTRIBUTE_POINT_TYPE, ValueType.makeEnum(Util.enumNames(PointType.class))));

	act.addParameter(new Parameter(ATTRIBUTE_OFFSET, ValueType.NUMBER));
	act.addParameter(new Parameter(ATTRIBUTE_DATA_TYPE, ValueType.makeEnum(Util.enumNames(DataType.class))));
	act.addParameter(new Parameter(ATTRIBUTE_REGISTER_COUNT, ValueType.NUMBER));

	node.createChild(ACTION_ADD_POINT, true).setAction(act).build().setSerializable(false);

}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:15,代碼來源:LocalSlaveFolder.java

示例13: setEditAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
public void setEditAction() {
	Action act = new Action(Permission.READ, new EditHandler());

	act.addParameter(new Parameter(ATTRIBUTE_NAME, ValueType.STRING, new Value(node.getName())));

	Node editNode = node.getChild(ACTION_EDIT, true);
	if (editNode == null)
		node.createChild(ACTION_EDIT, true).setAction(act).build().setSerializable(false);
	else
		editNode.setAction(act);
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:12,代碼來源:LocalSlaveFolder.java

示例14: getAddPointAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
Action getAddPointAction() {
	Action act = new Action(Permission.READ, new AddPointHandler());

	act.addParameter(new Parameter(ATTR_NAME, ValueType.STRING));
	act.addParameter(new Parameter(ATTR_POINT_TYPE, ValueType.makeEnum(Util.enumNames(PointType.class))));
	act.addParameter(new Parameter(ATTR_OFFSET, ValueType.NUMBER));
	act.addParameter(new Parameter(ATTR_NUMBER_OF_REGISTERS, ValueType.NUMBER, new Value(1)));
	act.addParameter(new Parameter(ATTR_DATA_TYPE, ValueType.makeEnum(Util.enumNames(DataType.class))));
	act.addParameter(new Parameter(ATTR_BIT, ValueType.NUMBER));
	act.addParameter(new Parameter(ATTR_SCALING, ValueType.NUMBER, new Value(1)));
	act.addParameter(new Parameter(ATTR_SCALING_OFFSET, ValueType.NUMBER, new Value(0)));
	act.addParameter(new Parameter(ATTR_WRITBLE, ValueType.BOOL, new Value(false)));

	return act;
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:16,代碼來源:SlaveFolder.java

示例15: makeExportAction

import org.dsa.iot.dslink.node.Permission; //導入依賴的package包/類
private void makeExportAction(final Node fnode) {
    Action act = new Action(Permission.READ, new Handler<ActionResult>(){
        @Override
        public void handle(ActionResult event) {
            handleExport(fnode, event);
        }
    });
    act.addResult(new Parameter("JSON", ValueType.STRING).setEditorType(EditorType.TEXT_AREA));
    Node anode = fnode.getChild(ACTION_EXPORT, true);
    if (anode == null) {
        fnode.createChild(ACTION_EXPORT, true).setAction(act).build().setSerializable(false);
    } else {
        anode.setAction(act);
    }
}
 
開發者ID:IOT-DSA,項目名稱:dslink-java-modbus,代碼行數:16,代碼來源:SlaveFolder.java


注:本文中的org.dsa.iot.dslink.node.Permission類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。