Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-02


oracle.irm.engine.rights.context
Class ContextTemplateOperationsInstance

java.lang.Object
  extended by oracle.irm.engine.rights.context.ContextTemplateOperationsInstance


public final class ContextTemplateOperationsInstance
extends Object

Context template operations. Template operations include template management methods, such as listing or creating templates. Also included are the operations that allow new Context classifications to be created from those templates.

This class provides static methods for a set of procedural style methods. The methods can be made to appear as global methods by using import static. e.g.

import static oracle.irm.engine.rights.context.ContextTemplateOperationsInstance.*;

Method Summary
static boolean contextTemplateExists(UUID uuid, Domain domain)
          Check for a template's existence.
static ContextTemplate copyContextTemplate(Domain domain, ContextTemplate template)
          Copy a context template.
static void deleteContextTemplate(ContextTemplate template)
          Delete a context template.
static void deleteContextTemplates(Collection<ContextTemplate> templates)
          Delete a set of context template.
static Collection<Label> getContextTemplateLabels(ContextInstance context)
          Get the context template labels for a context.
static Collection<ContextTemplate> listActiveTemplates(Domain domain)
          List active templates.
static Collection<ContextTemplate> listTemplates(Domain domain)
          List templates.
static Collection<ContextTemplate> listTemplatesByStatus(Domain domain, ContextTemplate.Status status)
          List templates by status.
static ContextTemplate refreshContextTemplate(ContextTemplate template)
          Refresh a template's properties.
static ContextTemplate saveChangesToContextTemplate(ContextTemplate template, ContextTemplate delta)
          Save changes to a context template.
static ContextTemplate saveNewContextTemplate(Domain domain, ContextTemplate template)
          Save a new context template.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

listTemplates

public static Collection<ContextTemplate> listTemplates(Domain domain)
                                                 throws UnknownDomainException,
                                                        AuthorizationDeniedException
List templates. List the template owned by the specified standard rights domain.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method. This method can be invoked by users that have the Domain Manager role in the related domain. This role can be assigned using the addDomainManagers method.
Parameters:
domain - the domain.
Returns:
the list of templates. If no templates are available an empty collection is returned. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownDomainException - the domain does not exist.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

listTemplatesByStatus

public static Collection<ContextTemplate> listTemplatesByStatus(Domain domain,
                                                                ContextTemplate.Status status)
                                                         throws UnknownDomainException
List templates by status. List the template owned by the specified standard rights domain and with the provided status.
Parameters:
domain - the domain.
status - the requested status.
Returns:
the list of templates. If there are no templates that match the specified status an empty collection is returned. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownDomainException - the domain does not exist.

listActiveTemplates

public static Collection<ContextTemplate> listActiveTemplates(Domain domain)
                                                       throws UnknownDomainException,
                                                              AuthorizationDeniedException
List active templates. List the active templates owned by the specified standard rights domain. This method is useful when presenting a list of templates that can be used to create contexts. Inactive context templates cannot be used to create contexts.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method. This method can be invoked by users that have the Domain Manager role in the related domain. This role can be assigned using the addDomainManagers method.
Parameters:
domain - the domain.
Returns:
the list of templates. If there are no active templates an empty collection is returned. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownDomainException - the domain does not exist.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

saveNewContextTemplate

public static ContextTemplate saveNewContextTemplate(Domain domain,
                                                     ContextTemplate template)
                                              throws ContextTemplateAlreadyExistsException,
                                                     InvalidDocumentRoleException,
                                                     UnknownDocumentRoleException,
                                                     UnknownDomainException,
                                                     IllegalArgumentException,
                                                     AuthorizationDeniedException
Save a new context template. The context template will be owned by the specified Domain.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
domain - the domain.
template - the template.
Returns:
the created context template. This method will never return null.
Throws:
ContextTemplateAlreadyExistsException - a context template already exists with the same Id within the specified domain.
InvalidDocumentRoleException - invalid role. One of the roles added to this template does not exist.
UnknownDocumentRoleException - unknown role. One of the roles associated with this template belongs to a different domain.
UnknownDomainException - the domain does not exist.
IllegalArgumentException - illegal argument. The template provided must NOT have it's Domain property specified. This is to protect against passing in a template that has already been saved.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

saveChangesToContextTemplate

public static ContextTemplate saveChangesToContextTemplate(ContextTemplate template,
                                                           ContextTemplate delta)
                                                    throws CannotRemoveDocumentRoleException,
                                                           InvalidDocumentRoleException,
                                                           UnknownDocumentRoleException,
                                                           UnknownContextTemplateException,
                                                           IllegalArgumentException,
                                                           AuthorizationDeniedException
Save changes to a context template. Save changes to a ContextTemplate by providing two copies. Changes are made by comparing the two copies of the template. If there are no differences in a property then no changes are made to persistent storage for that property. Changes in collection based properties cause additions or removals to occur in persistent storage. For example, if the delta contains a new DocumentRole as compared to the template then a new role will be associated with the template.

Changes to the Roles will be immediately visible in any ContextInstance linked to this template. If a role is removed from a template, any accounts assigned to the role will be automatically un-assigned (for contexts linked to this template).

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
template - the context template to compare to the delta.
delta - the changes. The Domain and Uuid properties must match with the template parameter.
Returns:
the context template with the updated changes. This method will never return null.
Throws:
CannotRemoveDocumentRoleException - the role cannot be removed from the template as it is in use. A document role cannot be remove if there are any contexts assignments using the role. The document role can only be removed from the template after the associated rights have been unassigned from all contexts based on the template.
InvalidDocumentRoleException - invalid role. One of the roles added to this template does not exist.
UnknownDocumentRoleException - unknown role. One of the roles associated with this template belongs to a different domain.
UnknownContextTemplateException - the context template does not exist.
IllegalArgumentException - illegal argument. If the Template and Uuid properties of the delta parameter do not match the template parameter. Also thrown if the the template provided does not have a Domain property specified.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

deleteContextTemplate

public static void deleteContextTemplate(ContextTemplate template)
                                  throws CannotRemoveContextTemplateException
Delete a context template. A context template can only be deleted if there are no contexts linked to the template.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
template - the template.
Throws:
CannotRemoveContextTemplateException - the template cannot be removed as it is in use. A context template cannot be deleted if there are any contexts linked to the template. The context template can only be deleted after the contexts are deleted.

deleteContextTemplates

public static void deleteContextTemplates(Collection<ContextTemplate> templates)
                                   throws CannotRemoveContextTemplateException,
                                          AuthorizationDeniedException
Delete a set of context template. A context template can only be deleted if there are no contexts linked to the template.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
templates - the set of template. This parameter is optional, it is valid to pass null or an empty collection.
Throws:
CannotRemoveContextTemplateException - the template cannot be removed as it is in use. A context template cannot be deleted if there are any contexts linked to the template. The context template can only be deleted after the contexts are deleted.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

refreshContextTemplate

public static ContextTemplate refreshContextTemplate(ContextTemplate template)
                                              throws UnknownContextTemplateException,
                                                     AuthorizationDeniedException
Refresh a template's properties.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method. This method can be invoked by users that have the Domain Manager role in the related domain. This role can be assigned using the addDomainManagers method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
template - the template.
Returns:
the refreshed template. This method will never return null.
Throws:
UnknownContextTemplateException - the context template does not exist.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

getContextTemplateLabels

public static Collection<Label> getContextTemplateLabels(ContextInstance context)
                                                  throws UnknownContextException,
                                                         AuthorizationDeniedException
Get the context template labels for a context. When a context is created, it is created from a context template. This method allows a context manager or inspector to obtain the name of the context template (for display purposes).

Authorization

This method can be invoked by users that have the Context Manager role in the related context. This role can be assigned using the addContextManagers method. This method can be invoked by users that have the Inspector role in the related context. This role can be assigned using the addInspectors method.
Parameters:
context - the context.
Returns:
the context template labels. If applicable, this method will return an empty collection rather than null to indicate no results.
Throws:
UnknownContextException - the context does not exist.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

contextTemplateExists

public static boolean contextTemplateExists(UUID uuid,
                                            Domain domain)
Check for a template's existence.
Parameters:
uuid - the template UUID.
domain - the owning domain.
Returns:
true if the template exists, otherwise false.

copyContextTemplate

public static ContextTemplate copyContextTemplate(Domain domain,
                                                  ContextTemplate template)
                                           throws UnknownDomainException,
                                                  UnknownContextTemplateException,
                                                  IllegalArgumentException,
                                                  AuthorizationDeniedException
Copy a context template. Copy a context template to the same or different Domain. Copied templates are set with an inactive status. The template Labels are also copied and altered to reflect that the result is a copy of the template. For example, in English, the template Standard would turn into Copy Of Standard.

Authorization

This method can be invoked by users that have the Domain Administrator role in the related domain. This role can be assigned using the addDomainAdministrators method.

Impact

Invoking this method may cause the state of the system to change.
Parameters:
domain - the domain.
template - the template.
Returns:
the copied template. This method will never return null.
Throws:
UnknownDomainException - the domain does not exist.
UnknownContextTemplateException - the context template does not exist.
IllegalArgumentException - illegal argument. If the the template provided does not have it's Domain property specified.
AuthorizationDeniedException - authorization denied. The authenticated user is not authorized to call this operation.

Skip navigation links

Oracle® Information Rights Management Server Java API Reference
11g Release 1 (11.1.1)

E12907-02


Copyright © 2010, Oracle. All rights reserved.