Start a Conversation

Unsolved

This post is more than 5 years old

3422

June 15th, 2010 01:00

detect default retention (using XAM)

Hi all,

In order to find out which documents are past their retention period, I'm duplicating the chosen retention policy into my application (note: I only use 'base' retentions for the moment, not 'event' retentions).

However, it's also possible for users to do a checkin without choosing a specific "base retention duration" (i.e. a time in milliseconds) or a specific "base retention policy" (e.g. "1day", "1hr", "CBR_EMail", ...). In that case, Centera will apply the default retention to the checked in content.

As such, I need to detect what Centera considers to be the default retention, so that I can associate, within my application, that default retention to the checked in content.

From reading the documentation, it seems like the default retention is "the first entry in XAM_RETENTION_DURATION_POLICY_LIST". So the way I'm detecting the default retention is this:

XIterator xIterator = xSystem.openFieldIterator(XSystem.XAM_RETENTION_DURATION_POLICY_LIST);

String defaultRetentionName = (String) xIterator.next();

xIterator.close();

String defaultRetentionJavaName = xSystem.getString(defaultRetentionName);

However, I'm a bit uncertain about that code, since I don't know for certain what the default retention policy is for the US2 machine. According to that code, it's "0seconds", but I don't know if it's correct.

There are also some things which are unclear to me:

1) All of this implies that there will always be a default retention, is this correct? I was under the impression that this wasn't the case.

2) This also implies that the default retention will always be a base policy (e.g. "1day", "1hr", "CBR_EMail", ...) and never a base duration (i.e. a time in milliseconds), is this true?

3) Does "XAM_RETENTION_DURATION_POLICY_LIST" only contain "base" retentions, or does it also contain "event" retentions?

4) Can XSystem.XAM_MANAGEMENT_POLICY_DEFAULT (which contains the value ".xsystem.management.policy.default") be used in some way to detect the default policy in a better way?

Many thanks for your help,

Ludovic

417 Posts

June 15th, 2010 06:00

An XSystem, by design, always adds default retention to an XSet if the application does not do so.

This will be added as the base retention scheme - the value can be obtained from such an XSet via the .xset.retention.base.duration field. It can also be found as the value of the com.emc.centera.capabilities.retention.default field on the XSystem.

This value equates to the default retention period that has been configured on the cluster for the home pool of the XSystem (determined by the credentials used to authenticate, either via a PEA file or username / secret pair).

June 16th, 2010 00:00

Thank you Graham.

I take it, then, that the solution I posted was incorrect?

I did think about just creating a new xset and extracting the duration out of that, but the problem I see with .xset.retention.base.duration is that it returns a time in milliseconds. However, the default policy will be a policy name, not a duration, right?

Suppose I checkin new content, and the default retention policy is "email_retention". At the time I store my content, the policy "email_retention" equates to 2 months, so I store the milliseconds for 2 months in my application. However, if the policy "email_retention" is then modified to equate 3 months, my application will still think it needs to be stored for 2 months, which is incorrect.

As far as I can see, there's no way to extract the policy name out of an xset. I will look into "com.emc.centera.capabilities.retention.default", but that's a Centera-specific field, and I'd like to keep my application as XAM-compatible as possible :-)

Is there no other way to solve this correctly with XAM?

Thanks,

Ludovic

June 17th, 2010 02:00

I tried to extract the value of "com.emc.centera.capabilities.retention.default" like this:

   XIterator xIterator = xSystem.openFieldIterator("com.emc.centera.capabilities.retention.default");

  while (xIterator.hasNext())

  {
     String defaultRetentionName = (String) xIterator.next();

     System.out.println("Default Centera retention policy's name found: " + defaultRetentionName);
  }

But unfortunately, the openFieldIterator line throws this exception: org.snia.xam.FieldDoesNotExistException: xam/field not found

Am I doing something wrong?

Also, any pointer to a more XAM-compliant way of solving this would be very much appreciated (if that exists).

I'm also still not sure whether my initial solution is incorrect: according to the manual, I think it should work to use the first policy returned by this FieldIterator:

xSystem.openFieldIterator(XSystem.XAM_RETENTION_DURATION_POLICY_LIST);

Thanks in advance for any help,

Ludovic

No Events found!

Top