|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.nodes.AbstractUaNode
com.prosysopc.ua.server.nodes.ServerNode
com.prosysopc.ua.server.nodes.BaseNode
com.prosysopc.ua.server.nodes.UaInstanceNode
com.prosysopc.ua.server.nodes.UaObjectNode
com.prosysopc.ua.server.nodes.AbstractGeneratedObjectNode
com.prosysopc.ua.types.opcua.server.BaseObjectTypeNode
com.prosysopc.ua.types.opcua.server.FileTypeNodeBase
com.prosysopc.ua.types.opcua.server.FileTypeNode
public class FileTypeNode
Implementation of the OPC UA FileType object type.
Internally uses RandomAccessFile instances to manage the file streams required for reading and writing the files in the file system.
| Field Summary |
|---|
| Fields inherited from class com.prosysopc.ua.server.nodes.BaseNode |
|---|
NODE_VERSION_PROPERTY_NAME |
| Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode |
|---|
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap |
| Fields inherited from interface com.prosysopc.ua.types.opcua.FileType |
|---|
CLOSE, GET_POSITION, MIME_TYPE, OPEN, OPEN_COUNT, READ, SET_POSITION, SIZE, USER_WRITABLE, WRITABLE, WRITE |
| Constructor Summary | |
|---|---|
protected |
FileTypeNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
|
| Method Summary | |
|---|---|
void |
afterCreate()
This method is called after NodeBuilder has constructed the instance, it is called for every sub-node that also implement this interface |
protected void |
checkFileExists()
|
void |
close(Session session,
Long fileHandle)
Close the file handle |
int |
getCurrentOpenCount()
|
long |
getCurrentPosition(Session session,
Long fileHandle)
Get the current position of the fileHandle |
long |
getCurrentSize()
|
org.opcfoundation.ua.builtintypes.DateTime |
getCurrentTimestamp()
Get the file's modification time. |
File |
getFile()
|
protected RandomAccessFile |
getRandomAccessFile(Session session,
Long fileHandle)
|
org.opcfoundation.ua.builtintypes.DateTime |
getTimestamp()
Get the file's modification time. |
boolean |
isCurrentWritable()
Whether the file can be written to in general. |
boolean |
isWriting()
|
protected void |
onClose(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle)
|
protected org.opcfoundation.ua.builtintypes.UnsignedLong |
onGetPosition(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle)
|
protected org.opcfoundation.ua.builtintypes.UnsignedInteger |
onOpen(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedByte mode)
|
protected org.opcfoundation.ua.builtintypes.ByteString |
onRead(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle,
Integer length)
|
protected void |
onSetPosition(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle,
org.opcfoundation.ua.builtintypes.UnsignedLong position)
|
protected void |
onWrite(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle,
org.opcfoundation.ua.builtintypes.ByteString data)
|
Long |
open(Session session,
Set<FileTypeOpenMode> mode)
Opens the file for reading or writing. |
byte[] |
read(Session session,
Long fileHandle,
int length)
Read data from the physical file. |
void |
setCurrentPosition(Session session,
Long fileHandle,
long position)
Set the current position of the fileHandle. |
void |
setCurrentWritable(boolean writable)
Define whether the file can be written to in general. |
void |
setFile(File file)
|
void |
setSize(org.opcfoundation.ua.builtintypes.UnsignedLong size,
org.opcfoundation.ua.builtintypes.StatusCode status,
org.opcfoundation.ua.builtintypes.DateTime timestamp)
|
void |
updateFileSize()
|
protected void |
updateOpenCount()
|
void |
write(Session session,
Long fileHandle,
byte[] data)
|
| Methods inherited from class com.prosysopc.ua.types.opcua.server.BaseObjectTypeNode |
|---|
isCacheMethodIds, setCacheMethodIds |
| Methods inherited from class com.prosysopc.ua.server.nodes.AbstractGeneratedObjectNode |
|---|
afterCreateInitIfExists, afterCreateSetValueIfExists, callAfterCreateIfExists, getDefaultTypeDefinition, getQualifiedName, isComponentMatch |
| Methods inherited from class com.prosysopc.ua.server.nodes.UaObjectNode |
|---|
addCallListener, callMethod, deleteIfNodeExists, getAttributes, getAttributes, getEventNotifier, getIcon, getNodeClass, initSupportedAttributes, readAttributeValue, removeCallListener, setAttributes, setEventNotifier, setIcon, toString, writeAttributeValue |
| Methods inherited from class com.prosysopc.ua.server.nodes.UaInstanceNode |
|---|
addModellingRule, beforeAddReference, getTypeDefinition, getTypeDefinitionId, hasTypeDefinition, registerOverridePlainMethod, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId, supportsTypeDefinitionNode |
| Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode |
|---|
getForwardReferences, getInverseReferences, getReferences, getReferences, referenceTypeInherits |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.prosysopc.ua.types.opcua.BaseInstanceType |
|---|
getQualifiedName |
| Methods inherited from interface com.prosysopc.ua.nodes.UaObject |
|---|
callMethod, getEventNotifier, getIcon, setEventNotifier, setIcon |
| Methods inherited from interface com.prosysopc.ua.nodes.UaInstance |
|---|
getTypeDefinition, getTypeDefinitionId, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId |
| Constructor Detail |
|---|
protected FileTypeNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
| Method Detail |
|---|
public void afterCreate()
GeneratedNode
afterCreate in interface GeneratedNodeafterCreate in class FileTypeNodeBase
public void close(Session session,
Long fileHandle)
throws StatusException
StatusExceptionpublic int getCurrentOpenCount()
public long getCurrentPosition(Session session,
Long fileHandle)
throws StatusException
session - the client session that is making the readfileHandle - the handle to the file, received in open
StatusException - if the fileHandle is invalid
public long getCurrentSize()
throws StatusException
StatusException - with Bad_NotFound if the file is not defined or does not exist
public org.opcfoundation.ua.builtintypes.DateTime getCurrentTimestamp()
throws StatusException
StatusException - with Bad_NotFound if the file is not defined or does not existpublic File getFile()
public org.opcfoundation.ua.builtintypes.DateTime getTimestamp()
throws StatusException
StatusException - with Bad_NotFound if the file is not defined or does not existpublic boolean isCurrentWritable()
public boolean isWriting()
public Long open(Session session,
Set<FileTypeOpenMode> mode)
throws StatusException
session - the client session that is making the readmode - the opening mode (read/write, etc.)
StatusException - with StatusCodes.Bad_NotFound if the file does not exist
public byte[] read(Session session,
Long fileHandle,
int length)
throws StatusException
session - the client session that is making the readfileHandle - the handle to the file, received in openlength - the number of bytes to read
StatusException - with Bad_InvalidState if the file is not open for reading, i.e.
fileHandle is invalid, or with Bad_UnexpectedError if there is an IOException
public void setCurrentPosition(Session session,
Long fileHandle,
long position)
throws StatusException
session - the client session that is making the readfileHandle - the handle to the file, received in openposition - .longValue() the new position
StatusException - if the fileHandle is invalid
public void setCurrentWritable(boolean writable)
throws StatusException
writable - set to true if the file can be opened for writing by anyone.
StatusExceptionpublic void setFile(File file)
file -
public void setSize(org.opcfoundation.ua.builtintypes.UnsignedLong size,
org.opcfoundation.ua.builtintypes.StatusCode status,
org.opcfoundation.ua.builtintypes.DateTime timestamp)
size - status - timestamp - public void updateFileSize()
public void write(Session session,
Long fileHandle,
byte[] data)
throws StatusException
session - fileHandle - data -
StatusException
protected void checkFileExists()
throws StatusException
StatusException
protected RandomAccessFile getRandomAccessFile(Session session,
Long fileHandle)
throws StatusException
session - fileHandle -
StatusException
protected void onClose(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle)
throws StatusException
onClose in class FileTypeNodeBaseStatusException
protected org.opcfoundation.ua.builtintypes.UnsignedLong onGetPosition(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle)
throws StatusException
onGetPosition in class FileTypeNodeBaseStatusException
protected org.opcfoundation.ua.builtintypes.UnsignedInteger onOpen(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedByte mode)
throws StatusException
onOpen in class FileTypeNodeBaseStatusException
protected org.opcfoundation.ua.builtintypes.ByteString onRead(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle,
Integer length)
throws StatusException
onRead in class FileTypeNodeBaseStatusException
protected void onSetPosition(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle,
org.opcfoundation.ua.builtintypes.UnsignedLong position)
throws StatusException
onSetPosition in class FileTypeNodeBaseStatusException
protected void onWrite(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.UnsignedInteger fileHandle,
org.opcfoundation.ua.builtintypes.ByteString data)
throws StatusException
onWrite in class FileTypeNodeBaseStatusException
protected void updateOpenCount()
throws StatusException
StatusException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||