Page 1 of 1

Meaning of Properties on VaultDeletedObject

Posted: Wed Nov 02, 2022 7:54 am
by TeamWiSE
Am I correct in assuming that the Properties Member of the VaultDeletedObject class has the following meaning:
  • 1 = folder
  • 2 = file
  • 5 = branch
  • 6 = share
Is this the complete list? Or are other values possible/known?

To put this question in context: I am building a small utility that is going to obliterate deleted branches overnight. Such an operation takes too long to execute during work-hours (the DB is fully locked during the obliterate transaction) and the admin console needs an interactive confirm after a long waiting period (but requires the OK to obliterate within a short time after listing the items to obliterate), making this way to obliterate not a viable option either. So my utility would collect all deleted items and issue a VaultRequestObliterate for all VaultDeletedObject-instances that have a Properties Member with the value 5.

Re: Meaning of Properties on VaultDeletedObject

Posted: Thu Nov 03, 2022 8:11 am
by jclausius
No. The properties are a bitmap of various properties, but the main 2 properties are for file or folder. So, determine this, you can do a bitwise AND using VaultLib.VaultFSObjectDefine entries :

VaultDeletedObject delObject = ...;

if ( (((ushort)delObject.Properties) & VaultLib.VaultFSObjectDefine.TypeFolder) == VaultLib.VaultFSObjectDefine.TypeFolder)
{
// this is a folder
}

if ( (((ushort)delObject.Properties) & VaultLib.VaultFSObjectDefine.TypeFile) == VaultLib.VaultFSObjectDefine.TypeFile)
{
// this is a file
}
----
Since VaultDeletedObject's properties is from the database, there are other bitmap masks (branch [4], snapshot [8], and virtual [16]), but I don't believe those would be of any value.

Re: Meaning of Properties on VaultDeletedObject

Posted: Thu Nov 03, 2022 8:56 am
by TeamWiSE
The branch bit (0x04) is exactly the one, that is of importance to me, since we want to automate the obliteration of old branches. Are these bitmasks (branch [4], snapshot [8], and virtual [16]) symbolically defined in VaultLib, e.g. like VaultLib.VaultFSObjectDefine.TypeFolder? Or should I just use the corresponding values?

Re: Meaning of Properties on VaultDeletedObject

Posted: Fri Nov 04, 2022 12:42 pm
by jclausius
They are defined in server code (as the server works directly with the database), but not in the ClientAPI.

Normally one would look at the properties of a file/folder (VaultClientFolder f = ...; if (f.Branched) { ... };) or go through ClientInstance.TreeCache to check on Share information. However, your situation is unique in that the item is already deleted and represented by the VaultDeletedObject class, and the API doesn't expose any literals / enums for those properties since they're not used in any of the clients.

You can create your own int constants for that value if you would like. Since this is stored as a database property it will never change.

Re: Meaning of Properties on VaultDeletedObject

Posted: Sat Nov 05, 2022 7:16 am
by TeamWiSE
Thanks for the support, I will do just that.