class %Archive.Session extends %Library.RegisteredObjectAPI for data archiving
Sample script that initiates a connection to an archive server
Once connected, here is a sample script that stores a content (cf. %Archive.Content):
Set SessionOref = ##class(%Archive.Session).%New() Set SessionOref.Host = 18.104.22.168 // IP address of the archive server Set SessionOref.AuthFile = AuthFilePath // path of the .pea file (for Centera) Set Status = SessionOref.Connect()
After Store() returns successfully, you need to save the ContentUID value somewhere (say, in a database) for future retrieval purpose.
// create a content object as source, whose handle is ContentOref (see %Archive.Content) Set Status = SessionOref.Store(ContentOref, .ContentUID)
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)
- 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.
Property Inventory (Including Private)
Method Inventory (Including Private)
parameter TYPE = Centera;
Type of the archive system (EMC Centera)
parameter VERSION = 0.1;
Version of the API
Properties (Including Private)
property ApplicationName as %String;
Name of the application, default to something like "Cache for Windows (x86-32)" (from $zv)
Property methods: ApplicationNameDisplayToLogical(), ApplicationNameGet(), ApplicationNameIsValid(), ApplicationNameLogicalToDisplay(), ApplicationNameLogicalToOdbc(), ApplicationNameNormalize(), ApplicationNameSet()
property ApplicationVersion as %String;
Version of the application, default to something like "2008.2 (Build 366U)" (from $zv)
Property methods: ApplicationVersionDisplayToLogical(), ApplicationVersionGet(), ApplicationVersionIsValid(), ApplicationVersionLogicalToDisplay(), ApplicationVersionLogicalToOdbc(), ApplicationVersionNormalize(), ApplicationVersionSet()
property AuthFile as %String;
The path of a Pool Entry Authorization file (*.pea)
Property methods: AuthFileDisplayToLogical(), AuthFileGet(), AuthFileIsValid(), AuthFileLogicalToDisplay(), AuthFileLogicalToOdbc(), AuthFileNormalize(), AuthFileSet()
property BufferSizeInKB as %Integer [ Private , InitialExpression = 64 ];
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.
Property methods: BufferSizeInKBDisplayToLogical(), BufferSizeInKBGet(), BufferSizeInKBIsValid(), BufferSizeInKBLogicalToDisplay(), BufferSizeInKBNormalize(), BufferSizeInKBSet()
property EmbeddedDataThreshold as %Integer (MAXVAL = 102400) [ Private , InitialExpression = 102400 ];
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.
Property methods: EmbeddedDataThresholdDisplayToLogical(), EmbeddedDataThresholdGet(), EmbeddedDataThresholdIsValid(), EmbeddedDataThresholdLogicalToDisplay(), EmbeddedDataThresholdNormalize(), EmbeddedDataThresholdSet()
property Host as %String;
Connection information, a comma-delimited list of IP addresses
For example, "10.2.3.4,10.6.7.8"
For example, "10.2.3.4,10.6.7.8"
Property methods: HostDisplayToLogical(), HostGet(), HostIsValid(), HostLogicalToDisplay(), HostLogicalToOdbc(), HostNormalize(), HostSet()
property Password as %String;
Property methods: PasswordDisplayToLogical(), PasswordGet(), PasswordIsValid(), PasswordLogicalToDisplay(), PasswordLogicalToOdbc(), PasswordNormalize(), PasswordSet()
property PrefetchSizeInKB as %Integer (MAXVAL = 1024) [ Private , InitialExpression = 1024 ];
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.
Property methods: PrefetchSizeInKBDisplayToLogical(), PrefetchSizeInKBGet(), PrefetchSizeInKBIsValid(), PrefetchSizeInKBLogicalToDisplay(), PrefetchSizeInKBNormalize(), PrefetchSizeInKBSet()
property UserName as %Library.Username;
An alternative to a PEA file is a pair of UserName and Password
Property methods: UserNameDisplayToLogical(), UserNameGet(), UserNameIsValid(), UserNameLogicalToDisplay(), UserNameLogicalToOdbc(), UserNameNormalize(), UserNameSet()
Methods (Including Private)
private method %OnClose() as %Status [ Language = objectscript ]
private method %OnNew() as %Status [ Language = objectscript ]
Test the existence of a content (C-Clip) by its UID (ContentAddress)
private method CheckVersion() as %Status [ Language = objectscript ]
private method Close() as %Status [ Language = objectscript ]
method Connect() as %Status [ Language = objectscript ]
Connect to the server
Delete a content (C-Clip) by its UID (ContentAddress)
method Disconnect() as %Status [ Language = objectscript ]
Disconnect from the server
private method GetAuthorization() as %String [ Language = objectscript ]
Create a string based on AuthFile or UserName and Password. The string will be part of the connection argument for opening the pool.
private method GetErrorDetail() as %Status [ Language = objectscript ]
private method LookUpDLLFunc(FuncName) as %Integer [ Language = objectscript ]
private method NewTag(Name) as %Status [ Language = objectscript ]
private method Open(ContentOref As %Archive.Content, ContentUID As %String) as %Status [ Language = objectscript ]
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
private method ReadStream(StreamOref As %Stream, TagName As %String) as %Status [ Language = objectscript ]
Similar to ReadFile, except that the data sink is a %Stream object. NOT IMPLEMENTED.
private method Register() as %Status [ Language = objectscript ]
method Retrieve(ContentOref As %Archive.Content, ContentUID As %String) as %Status [ Language = objectscript ]
Retrieve an entire content from server
private method SetAttribute(AttribName As %String, AttribValue As %String) as %Status [ Language = objectscript ]
private method SetBufferSize() as %Status [ Language = objectscript ]
private method SetEmbeddedDataThreshold() as %Status [ Language = objectscript ]
method Store(ContentOref As %Archive.Content, ByRef ContentUID As %String) as %Status [ Language = objectscript ]
Store an entire content to server, commit and return a UID by reference
private method Write(DataSource As %String, TagName As %String) as %Status [ Language = objectscript ]
A name for the data is required and cannot be NULL
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
private method WriteStream(StreamOref As %Stream, TagName As %String = "_") as %Status [ Language = objectscript ]
Similar to WriteFile, except that the data source is a %Stream object. NOT IMPLEMENTED.
Inherited Methods (Including Private)