本文整理汇总了Java中com.digitalpetri.opcua.stack.core.StatusCodes.Bad_NotWritable方法的典型用法代码示例。如果您正苦于以下问题:Java StatusCodes.Bad_NotWritable方法的具体用法?Java StatusCodes.Bad_NotWritable怎么用?Java StatusCodes.Bad_NotWritable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.digitalpetri.opcua.stack.core.StatusCodes
的用法示例。
在下文中一共展示了StatusCodes.Bad_NotWritable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeDataTypeAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeDataTypeAttribute(NamespaceManager ns, DataTypeNode node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case IsAbstract:
if (writeMasks.contains(WriteMask.IsAbstract)) {
node.setIsAbstract(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}
示例2: writeMethodAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeMethodAttribute(NamespaceManager ns, MethodNode node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case Executable:
if (writeMasks.contains(WriteMask.Executable)) {
node.setExecutable(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case UserExecutable:
if (writeMasks.contains(WriteMask.UserExecutable)) {
node.setUserExecutable(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}
示例3: writeObjectAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeObjectAttribute(NamespaceManager ns, ObjectNode node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case EventNotifier:
if (writeMasks.contains(WriteMask.EventNotifier)) {
node.setWriteMask(Optional.ofNullable(extract(value)));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}
示例4: writeObjectTypeAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeObjectTypeAttribute(NamespaceManager ns, ObjectTypeNode node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case IsAbstract:
if (writeMasks.contains(WriteMask.IsAbstract)) {
node.setIsAbstract(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}
示例5: writeReferenceTypeAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeReferenceTypeAttribute(NamespaceManager ns, ReferenceTypeNode node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case IsAbstract:
if (writeMasks.contains(WriteMask.IsAbstract)) {
node.setIsAbstract(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case Symmetric:
if (writeMasks.contains(WriteMask.Symmetric)) {
node.setSymmetric(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case InverseName:
if (writeMasks.contains(WriteMask.InverseName)) {
node.setInverseName(Optional.ofNullable(extract(value)));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}
示例6: writeNodeAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeNodeAttribute(NamespaceManager ns, Node node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case NodeId:
if (writeMasks.contains(WriteMask.NodeId)) {
node.setNodeId(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case NodeClass:
if (writeMasks.contains(WriteMask.NodeClass)) {
node.setNodeClass(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case BrowseName:
if (writeMasks.contains(WriteMask.BrowseName)) {
node.setBrowseName(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case DisplayName:
if (writeMasks.contains(WriteMask.DisplayName)) {
node.setDisplayName(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case Description:
if (writeMasks.contains(WriteMask.Description)) {
node.setDescription(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case WriteMask:
if (writeMasks.contains(WriteMask.WriteMask)) {
node.setWriteMask(Optional.ofNullable(extract(value)));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case UserWriteMask:
if (writeMasks.contains(WriteMask.UserWriteMask)) {
node.setUserWriteMask(Optional.ofNullable(extract(value)));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
throw new UaException(StatusCodes.Bad_AttributeIdInvalid);
}
}
示例7: writeVariableAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeVariableAttribute(NamespaceManager ns, VariableNode node, AttributeId attributeId, DataValue value) throws UaException {
EnumSet<AccessLevel> accessLevels = AccessLevel.fromMask(node.getAccessLevel());
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case Value:
if (accessLevels.contains(AccessLevel.CurrentWrite)) {
value = validateDataType(ns, node.getDataType().expanded(), value);
validateArrayType(node.getValueRank(), node.getArrayDimensions(), value);
node.setValue(value);
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case DataType:
if (writeMasks.contains(WriteMask.DataType)) {
node.setDataType(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case ValueRank:
if (writeMasks.contains(WriteMask.ValueRank)) {
node.setValueRank(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case ArrayDimensions:
if (writeMasks.contains(WriteMask.ArrayDimensions)) {
node.setArrayDimensions(Optional.of(extract(value)));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case AccessLevel:
if (writeMasks.contains(WriteMask.AccessLevel)) {
node.setAccessLevel(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case UserAccessLevel:
if (writeMasks.contains(WriteMask.UserAccessLevel)) {
node.setUserAccessLevel(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case MinimumSamplingInterval:
if (writeMasks.contains(WriteMask.MinimumSamplingInterval)) {
node.setMinimumSamplingInterval(Optional.of(extract(value)));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case Historizing:
if (writeMasks.contains(WriteMask.Historizing)) {
node.setHistorizing(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}
示例8: writeVariableTypeAttribute
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static void writeVariableTypeAttribute(NamespaceManager ns, VariableTypeNode node, AttributeId attributeId, DataValue value) throws UaException {
UInteger writeMask = node.getWriteMask().orElse(uint(0));
EnumSet<WriteMask> writeMasks = WriteMask.fromMask(writeMask);
switch (attributeId) {
case Value:
if (writeMasks.contains(WriteMask.ValueForVariableType)) {
value = validateDataType(ns, node.getDataType().expanded(), value);
validateArrayType(node.getValueRank(), node.getArrayDimensions(), value);
node.setValue(Optional.ofNullable(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case DataType:
if (writeMasks.contains(WriteMask.DataType)) {
node.setDataType(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case ValueRank:
if (writeMasks.contains(WriteMask.ValueRank)) {
node.setValueRank(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
case IsAbstract:
if (writeMasks.contains(WriteMask.IsAbstract)) {
node.setIsAbstract(extract(value));
} else {
throw new UaException(StatusCodes.Bad_NotWritable);
}
break;
default:
writeNodeAttribute(ns, node, attributeId, value);
}
}