.NET Based OPC UA Client/Server SDK  3.0.10.493
UnifiedAutomation.UaServer.FileDirectoryModel Class Reference

An object that represents a directory that can be accessed via the server. More...

Inherits UnifiedAutomation.UaServer.FolderModel, UnifiedAutomation.UaServer.IMethodDispatcher, UnifiedAutomation.UaServer.IFileDirectoryMethods, and IDisposable.

Public Member Functions

void Dispose ()
 Frees any unmanaged resources. More...
 
StatusCode CreateDirectory (RequestContext context, FileDirectoryModel model, string directoryName, out NodeId directoryNodeId)
 Creates a new FileDirectoryType object organized by this object. More...
 
StatusCode CreateFile (RequestContext context, FileDirectoryModel model, string fileName, bool requestFileOpen, out NodeId fileNodeId, out uint fileHandle)
 Creates a new UnifiedAutomation.UaServer.FileModel object organized by this object. More...
 
StatusCode Delete (RequestContext context, FileDirectoryModel model, NodeId objectToDelete)
 Deletes a file or directory organized by this object. More...
 
StatusCode DeleteFileSystemObject (RequestContext context, FileDirectoryModel model, NodeId objectToDelete)
 Deletes a file or directory organized by this object. More...
 
StatusCode MoveOrCopy (RequestContext context, FileDirectoryModel model, NodeId objectToMoveOrCopy, NodeId targetDirectory, bool createCopy, string newName, out NodeId newNodeId)
 Moves or copies a file or directory organized by this object to another directory or renames a file or directory. More...
 
 FileDirectoryModel ()
 Initializes a new instance of the FileDirectoryModel class. More...
 
 FileDirectoryModel (FileDirectoryModel template)
 Initializes a new instance of the FileDirectoryModel class. More...
 
virtual CallMethodEventHandler GetMethodDispatcher (RequestContext context, NodeId objectId, NodeId methodId)
 Gets the method dispatcher. More...
 
virtual StatusCode DispatchMethod (RequestContext context, MethodHandle methodHandle, IList< Variant > inputArguments, List< StatusCode > inputArgumentResults, List< Variant > outputArguments)
 Dispatches the method. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.FolderModel
 FolderModel ()
 Initializes a new instance of the FolderModel class. More...
 
 FolderModel (FolderModel template)
 Initializes a new instance of the FolderModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.BaseObjectModel
 BaseObjectModel ()
 Initializes a new instance of the BaseObjectModel class. More...
 
 BaseObjectModel (BaseObjectModel template)
 Initializes a new instance of the BaseObjectModel class. More...
 
- Public Member Functions inherited from UnifiedAutomation.UaServer.ModelControllerBase
virtual ModelHandle GetModelHandle (StringTable namespaceUris, object instance)
 Gets the metadata handle. More...
 
virtual DataValue GetValue (IMapperContext context, ModelMapping mapping)
 Gets the value associated with the mapping. More...
 
virtual bool SetValue (IMapperContext context, ModelMapping mapping, DataValue value)
 Sets the value associated with the mapping. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 An overrideable version of the Dispose. More...
 

Protected Attributes

object Lock = new object()
 An object used to synchronize access to the file object. More...
 

Properties

NodeId NodeId [get, set]
 Gets or sets the node identifier. More...
 
DirectoryInfo DirectoryOnDisk [get, set]
 Gets or sets the directory on disk that is managed by the object. More...
 
IFileDirectoryMethods FileDirectoryMethods [get, set]
 Gets or sets the FileDirectory methods. More...
 
- Properties inherited from UnifiedAutomation.UaServer.ModelControllerBase
ModelHandle ModelHandle [get, set]
 Gets or sets the metadata handle. More...
 
object UserData [get, set]
 Gets or sets the user data. More...
 

Events

EventHandler
< CreateDirectoryRequestEventArgs
CreateDirectoryRequest
 Occurs when a request to create a new directory is received. More...
 
EventHandler
< CreateFileRequestEventArgs
CreateFileRequest
 Occurs when a request to create a new file is received. More...
 
EventHandler
< DeleteFileRequestEventArgs
DeleteFileRequest
 Occurs when a request to delete a file is received. More...
 
EventHandler
< MoveFileRequestEventArgs
MoveFileRequest
 Occurs when a request to move a file is received. More...
 

Detailed Description

An object that represents a directory that can be accessed via the server.

Defines a type for the representation of file directories.

This class implements support for the FileDirectoryType object on the server side.

It is expected that OPC UA Servers will create vendor specific subtypes of the UnifiedAutomation.UaServer.FileDirectoryModel with additional functionalities like methods for creating symbolic links or setting access permissions. OPC UA Clients providing specialized file transfer user interfaces should be prepared to expose such additional methods to the user.

Instances of the ObjectType contain a list of UnifiedAutomation.UaServer.FileDirectoryModel objects representing the subdirectories of the file directory represented by the instance of this ObjectType.

Instances of the ObjectType contain a list of UnifiedAutomation.UaServer.FileModel objects representing the files in the file directory represented by the instance of this ObjectType.

Constructor & Destructor Documentation

UnifiedAutomation.UaServer.FileDirectoryModel.FileDirectoryModel ( )
inline

Initializes a new instance of the FileDirectoryModel class.

UnifiedAutomation.UaServer.FileDirectoryModel.FileDirectoryModel ( FileDirectoryModel  template)
inline

Initializes a new instance of the FileDirectoryModel class.

Parameters
templateThe template.

Member Function Documentation

StatusCode UnifiedAutomation.UaServer.FileDirectoryModel.CreateDirectory ( RequestContext  context,
FileDirectoryModel  model,
string  directoryName,
out NodeId  directoryNodeId 
)
inline

Creates a new FileDirectoryType object organized by this object.

Method Result Codes

Result Code Description
Bad_BrowseNameDuplicated A directory with the name already exists.
Bad_UserAccessDenied The user does not have permission to perform the requested operation.
Parameters
contextThe request context.
modelThe parent directory.
directoryNameThe name of the directory to create. The name is used for the BrowseName and DisplayName of the directory object and also for the directory in the file system. For the BrowseName, the directoryName is used for the name part of the QualifiedName. The namespace index is Server specific. For the DisplayName, the directoryName is used for the text part of the LocalizedText. The locale part is Server specific.
directoryNodeIdThe NodeId of the created directory object.
Returns
Good if the operation succeeds; an error code otherwise.

Implements UnifiedAutomation.UaServer.IFileDirectoryMethods.

StatusCode UnifiedAutomation.UaServer.FileDirectoryModel.CreateFile ( RequestContext  context,
FileDirectoryModel  model,
string  fileName,
bool  requestFileOpen,
out NodeId  fileNodeId,
out uint  fileHandle 
)
inline

Creates a new UnifiedAutomation.UaServer.FileModel object organized by this object.

The created file can be written using the UnifiedAutomation.UaServer.IFileMethods.Write method of the UnifiedAutomation.UaServer.FileModel.

Method Result Codes

Result Code Description
Bad_BrowseNameDuplicated A file with the name already exists.
Bad_UserAccessDenied The user does not have permission to perform the requested operation.
Parameters
contextThe request context.
modelThe file directory model.
fileNameThe name of the file to create. The name is used for the BrowseName and DisplayName of the file object and also for the file in the file system. For the BrowseName, the FileName is used for the name part of the QualifiedName. The namespace index is Server specific. For the DisplayName, the FileName is used for the text part of the LocalizedText. The locale part is Server specific.
requestFileOpenFlag indicating whether the new file should be opened with the Write and Read bits set in the open mode after the creation of the file. If the flag is set to True, the file is created and opened for writing. If the flag is set to False, the file is just created.
fileNodeIdThe NodeId of the created file object.
fileHandleThe FileHandle is returned if RequestFileOpen is set to True. The FileNodeId and the FileHandle can be used to access the new file through the UnifiedAutomation.UaServer.FileModel object representing the new file. If RequestFileOpen is set to False, the returned value shall be 0 and shall be ignored by the caller.
Returns
Good if the operation succeeds; an error code otherwise.

Implements UnifiedAutomation.UaServer.IFileDirectoryMethods.

StatusCode UnifiedAutomation.UaServer.FileDirectoryModel.Delete ( RequestContext  context,
FileDirectoryModel  model,
NodeId  objectToDelete 
)
inline

Deletes a file or directory organized by this object.

Method Result Codes

Result Code Description
Bad_NotFound A file or directory with the provided NodeId is not organized by this object.
Bad_InvalidState The file or directory is locked and thus cannot be deleted.
Bad_UserAccessDenied The user does not have permission to perform the requested operation.
Parameters
contextThe request context.
modelThe file directory model.
objectToDeleteThe NodeId of the file or directory to delete. In the case of a directory, all file and directory objects below the directory to delete are deleted recursively.
Returns
Good if the operation succeeds; an error code otherwise.
StatusCode UnifiedAutomation.UaServer.FileDirectoryModel.DeleteFileSystemObject ( RequestContext  context,
FileDirectoryModel  model,
NodeId  objectToDelete 
)
inline

Deletes a file or directory organized by this object.

Method Result Codes

Result Code Description
Bad_NotFound A file or directory with the provided NodeId is not organized by this object.
Bad_InvalidState The file or directory is locked and thus cannot be deleted.
Bad_UserAccessDenied The user does not have permission to perform the requested operation.
Parameters
contextThe request context.
modelThe file directory model.
objectToDeleteThe NodeId of the file or directory to delete. In the case of a directory, all file and directory objects below the directory to delete are deleted recursively.
Returns
Good if the operation succeeds; an error code otherwise.

Implements UnifiedAutomation.UaServer.IFileDirectoryMethods.

virtual StatusCode UnifiedAutomation.UaServer.FileDirectoryModel.DispatchMethod ( RequestContext  context,
MethodHandle  methodHandle,
IList< Variant inputArguments,
List< StatusCode inputArgumentResults,
List< Variant outputArguments 
)
inlinevirtual

Dispatches the method.

Parameters
contextThe context.
methodHandleThe method handle.
inputArgumentsThe input arguments.
inputArgumentResultsThe input argument results.
outputArgumentsThe output arguments.
Returns
void UnifiedAutomation.UaServer.FileDirectoryModel.Dispose ( )
inline

Frees any unmanaged resources.

virtual void UnifiedAutomation.UaServer.FileDirectoryModel.Dispose ( bool  disposing)
inlineprotectedvirtual

An overrideable version of the Dispose.

virtual CallMethodEventHandler UnifiedAutomation.UaServer.FileDirectoryModel.GetMethodDispatcher ( RequestContext  context,
NodeId  objectId,
NodeId  methodId 
)
inlinevirtual

Gets the method dispatcher.

Parameters
contextThe context.
objectIdThe object id.
methodIdThe method id.
Returns

Implements UnifiedAutomation.UaServer.IMethodDispatcher.

StatusCode UnifiedAutomation.UaServer.FileDirectoryModel.MoveOrCopy ( RequestContext  context,
FileDirectoryModel  model,
NodeId  objectToMoveOrCopy,
NodeId  targetDirectory,
bool  createCopy,
string  newName,
out NodeId  newNodeId 
)
inline

Moves or copies a file or directory organized by this object to another directory or renames a file or directory.

Method Result Codes

Result Code Description
Bad_BrowseNameDuplicated A file or directory with the name already exists.
Bad_NotFound A file or directory with the provided NodeId is not organized by this object.
Bad_InvalidState The file or directory is locked and thus cannot be moved or copied.
Bad_UserAccessDenied The user does not have permission to perform the requested operation.
Parameters
contextThe request context.
modelThe file directory model.
objectToMoveOrCopyThe NodeId of the file or directory to move or copy.
targetDirectoryThe NodeId of the target directory of the move or copy command. If the file or directory is just renamed, the targetDirectory matches the ObjectId passed to the method call.
createCopyA flag indicating whether a copy of the file or directory should be created at the target directory.
newNameThe new name of the file or directory in the new location. If the string is empty, the name is unchanged.
newNodeIdThe NodeId of the moved or copied object. Even if the object is moved, the Server may return a new NodeId.
Returns

Implements UnifiedAutomation.UaServer.IFileDirectoryMethods.

Member Data Documentation

object UnifiedAutomation.UaServer.FileDirectoryModel.Lock = new object()
protected

An object used to synchronize access to the file object.

Property Documentation

DirectoryInfo UnifiedAutomation.UaServer.FileDirectoryModel.DirectoryOnDisk
getset

Gets or sets the directory on disk that is managed by the object.

IFileDirectoryMethods UnifiedAutomation.UaServer.FileDirectoryModel.FileDirectoryMethods
getset

Gets or sets the FileDirectory methods.

The FileDirectory methods.

NodeId UnifiedAutomation.UaServer.FileDirectoryModel.NodeId
getset

Gets or sets the node identifier.

Event Documentation

EventHandler<CreateDirectoryRequestEventArgs> UnifiedAutomation.UaServer.FileDirectoryModel.CreateDirectoryRequest

Occurs when a request to create a new directory is received.

EventHandler<CreateFileRequestEventArgs> UnifiedAutomation.UaServer.FileDirectoryModel.CreateFileRequest

Occurs when a request to create a new file is received.

EventHandler<DeleteFileRequestEventArgs> UnifiedAutomation.UaServer.FileDirectoryModel.DeleteFileRequest

Occurs when a request to delete a file is received.

EventHandler<MoveFileRequestEventArgs> UnifiedAutomation.UaServer.FileDirectoryModel.MoveFileRequest

Occurs when a request to move a file is received.


The documentation for this class was generated from the following files: