IRISLIB database
Session Class Reference

API for data archiving. More...

Inheritance diagram for Session:
Collaboration diagram for Session:

Public Member Functions

_.Library.Status OnClose ()
 Unload DLL.
 
_.Library.Status OnNew ()
 Load DLL.
 
_.Library.Status AccessContent (_.Library.String ContentUID)
 Test the existence of a content (C-Clip) by its UID (ContentAddress)
 
_.Library.Status Connect ()
 Connect to the server.
 
_.Library.Status DeleteContent (_.Library.String ContentUID)
 Delete a content (C-Clip) by its UID (ContentAddress)
 
_.Library.Status Disconnect ()
 Disconnect from the server.
 
_.Library.Status Retrieve (_.Archive.Content ContentOref, _.Library.String ContentUID)
 Retrieve an entire content from server.
 
_.Library.Status Store (_.Archive.Content ContentOref, _.Library.String ContentUID)
 Store an entire content to server, commit and return a UID by reference.
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Public Attributes

 ApplicationName
 Name of the application, default to something like "Cache for Windows (x86-32)" (from $zv) More...
 
 ApplicationVersion
 Version of the application, default to something like "2008.2 (Build 366U)" (from $zv) More...
 
 AuthFile
 The path of a Pool Entry Authorization file (*.pea) More...
 
 Host
 Connection information, a comma-delimited list of IP addresses
More...
 
 Password
   More...
 
 UserName
 An alternative to a PEA file is a pair of UserName and Password. More...
 

Static Public Attributes

 TYPE = None
 Type of the archive system (EMC Centera)
 
 VERSION = None
 Version of the API.
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Private Member Functions

_.Library.String __GetAuthorization ()
 Create a string based on AuthFile or UserName and Password. More...
 
_.Library.Status __ReadFile (_.Library.String Path)
 Read the blob associated with the tag by the name 'TagName' to the file given by 'Path'. More...
 
_.Library.Status __ReadStream (_.Library.Stream StreamOref, _.Library.String TagName)
 Similar to ReadFile, except that the data sink is a Stream object. More...
 
_.Library.Status __Write (_.Library.String DataSource, _.Library.String TagName)
 A name for the data is required and cannot be NULL.
 
_.Library.Status __WriteFile (_.Library.String Path)
 Create a tag with a 'TagName' and stream the given file to the blob associated with the tag. More...
 
_.Library.Status __WriteStream (_.Library.Stream StreamOref, _.Library.String TagName)
 Similar to WriteFile, except that the data source is a Stream object. More...
 

Private Attributes

 __BufferSizeInKB
 The size of an internal C-Clip buffer in bytes. More...
 
 __EmbeddedDataThreshold
 The maximum data size, in bytes, for data to be embedded in the CDF instead of being stored as separate blobs. More...
 
 __PrefetchSizeInKB
 The size of the prefetch buffer. More...
 

Detailed Description

API for data archiving.

Sample script that initiates a connection to an archive server

Set SessionOref = ##class(Archive.Session).New() Set SessionOref.Host = 123.45.6.78 // IP address of the archive server Set SessionOref.AuthFile = AuthFilePath // path of the .pea file (for Centera) Set Status = SessionOref.Connect()

Once connected, here is a sample script that stores a content (cf. <class>Archive.Content</class>):

// create a content object as source, whose handle is ContentOref (see Archive.Content) Set Status = SessionOref.Store(ContentOref, .ContentUID)

After Store() returns successfully, you need to save the ContentUID value somewhere (say, in a database) for future retrieval purpose.
Here is a sample script to retrieve the file from the archive server, using the ContentUID and open connection above:

// create a content object as target, whose handle is ContentOref (see Archive.Content) Set Status = SessionOref.Retrieve(ContentOref, ContentUID)

Limitations:

  • Only EMC Centera server is supported as an archive server
  • The source of storing and the target of retrieval must be files
  • Only one open connection per process. Attempt to open additional connections (whether to the same server as the existing connection or not) would get an error.
  • Retrieving selected files from a content containing multiple files ("blobs") is not supported.

Member Function Documentation

◆ __GetAuthorization()

_.Library.String __GetAuthorization ( )
private

Create a string based on AuthFile or UserName and Password.

The string will be part of the connection argument for opening the pool.

◆ __ReadFile()

_.Library.Status __ReadFile ( _.Library.String  Path)
private

Read the blob associated with the tag by the name 'TagName' to the file given by 'Path'.

If TagName is not specified, use the current tag (either the first tag or the tag pointed to by GetNextTag()) If TagName is not unique in the content, use the first matching tag. May generate <READ> error

◆ __ReadStream()

_.Library.Status __ReadStream ( _.Library.Stream  StreamOref,
_.Library.String  TagName 
)
private

Similar to ReadFile, except that the data sink is a Stream object.

NOT IMPLEMENTED.

◆ __WriteFile()

_.Library.Status __WriteFile ( _.Library.String  Path)
private

Create a tag with a 'TagName' and stream the given file to the blob associated with the tag.

Acceptable characters for a TagName are ASCII characters in the Set [a-zA-Z0-9_-.]. [No restriction in Unicode version] The first character must be a letter or an underscore "_". The name must be XML compliant and cannot start with the prefix "xml" or "eclip". May generate <WRITE> error

◆ __WriteStream()

_.Library.Status __WriteStream ( _.Library.Stream  StreamOref,
_.Library.String  TagName 
)
private

Similar to WriteFile, except that the data source is a Stream object.

NOT IMPLEMENTED.

Member Data Documentation

◆ ApplicationName

ApplicationName

Name of the application, default to something like "Cache for Windows (x86-32)" (from $zv)

 

◆ ApplicationVersion

ApplicationVersion

Version of the application, default to something like "2008.2 (Build 366U)" (from $zv)

 

◆ AuthFile

AuthFile

The path of a Pool Entry Authorization file (*.pea)

 

◆ __BufferSizeInKB

__BufferSizeInKB
private

The size of an internal C-Clip buffer in bytes.

This value must be greater than 0.

The SDK default value is 16KB. The default value we use here is 64KB.  

◆ __EmbeddedDataThreshold

__EmbeddedDataThreshold
private

The maximum data size, in bytes, for data to be embedded in the CDF instead of being stored as separate blobs.

The SDK default value is 0 bytes, meaning data is never embedded in the CDF. The maximum value is 102400 bytes (100 KB), which is the default value we use here. The value for the embedded data threshold can be set to less than or equal to 102400 bytes.  

◆ Host

Host

Connection information, a comma-delimited list of IP addresses

For example, "10.2.3.4,10.6.7.8"  

◆ Password

Password

 

 

◆ __PrefetchSizeInKB

__PrefetchSizeInKB
private

The size of the prefetch buffer.

This buffer is used to assist in determining the size of the blob.

The SDK default size is 32 KB. The maximum size is 1 MB, which is the default value we use here.  

◆ UserName

UserName

An alternative to a PEA file is a pair of UserName and Password.