Class ExpImpForSecurityLabelsAttr

java.lang.Object
wt.ixb.publicforhandlers.AttributeExporterImporterTemplate
wt.access.ixb.handlers.forattributes._ExpImpForSecurityLabelsAttr
wt.access.ixb.handlers.forattributes.ExpImpForSecurityLabelsAttr
All Implemented Interfaces:
AttributeExporterImporter, wt.ixb.publicforhandlers.CommonAttributeConflictChecker

public class ExpImpForSecurityLabelsAttr extends wt.access.ixb.handlers.forattributes._ExpImpForSecurityLabelsAttr implements wt.ixb.publicforhandlers.CommonAttributeConflictChecker
This class performs import/export of the <SecurityLabels> attribute for SecurityLabeled objects. IX handlers for SecurityLabeled objects should call wt.ixb.publicforhandlers. IxbHndHelper.exportAttribute(), IxbHndHelper.checkConflictForAttribute(), and IxbHndHelper.importAttribute() from their exportAttributes(), checkConflicts() , and importAttributes() methods respectively, with this class ( wt.access.ixb.handlers.forattributes.ExpImpForSecurityLabelsAttr) as the first parameter. <BR/P> The system will export and import security labels regardless of whether the Security Labels feature is enabled. If no security labels are defined in the source system, an empty SecurityLabels element will be exported. When importing, the security labels and security label values must all be defined in the importing system's security labels configuration. If an imported security label or security label value does not match the security label configuration, a non-overridable conflict will be generated, and the import will fail. (There is one exception: if the import contains a security label not matching the configuration whose value is SecurityLabelsConfiguration.NULL, no conflict will result, because the null value would not restrict access to the object). If the target system has an existing object with different values for security labels, an overrideable conflict will be generated (This allows the user to consider which of the conflicting labels should in fact be applied to the object).

Supported API: true

Extendable: false
  • Method Details

    • exportAttribute

      public void exportAttribute(Object obj, IxbElement fileXML, Exporter exporter) throws WTException
      Exports the <SecurityLabels> attribute of a SecurityLabeled object.

      Supported API: true
      Specified by:
      exportAttribute in interface AttributeExporterImporter
      Overrides:
      exportAttribute in class AttributeExporterImporterTemplate
      Parameters:
      obj - The SecurityLabeled object whose security labels attribute is being exported
      fileXML - The IxbElement representing the SecurityLabeled object whose security labels attribute is being exported. An element representing the security labels attribute will be added to this element.
      exporter - The Exporter which is processing the security labels.
      Throws:
      WTException
    • importAttribute

      public Object importAttribute(Object obj, IxbElement fileXML, Importer importer) throws WTException
      Imports the security labels attribute on the object. On return, the imported security labels have been set on the specified Security Labeled objects, but have not been persisted. If the SecurityLabels IxbElement is missing or empty, the object's security labels will not be set.

      Supported API: true
      Specified by:
      importAttribute in interface AttributeExporterImporter
      Overrides:
      importAttribute in class AttributeExporterImporterTemplate
      Parameters:
      obj - The SecurityLabeled object which the security labels are being set on
      fileXML - IxbElement for the object from import file
      importer - The Importer which is processing the import.
      Returns:
      Object The object with security labels attribute set.
      Throws:
      WTException
    • importAttributeBatch

      public void importAttributeBatch(List<IxbHndHelper.ElementObjectPair> list, Importer importer) throws WTException
      Imports the security labels attributes. On return, the imported security labels have been set on the specified Security Labeled objects, but have not been persisted. If the SecurityLabels IxbElement is missing or empty, the object's security labels will not be set.

      Supported API: true
      Specified by:
      importAttributeBatch in interface AttributeExporterImporter
      Overrides:
      importAttributeBatch in class AttributeExporterImporterTemplate
      Parameters:
      list - The list of objects to be imported, along with their respective IxbElement
      importer - The Importer which is processing the import.
      Throws:
      WTException
    • checkConflictForAttribute

      public void checkConflictForAttribute(Object existObj, IxbElement fileXML, Importer importer) throws WTException
      Checks for conflicts when importing SecurityLabels elements.
      • If SecurityLabel name is not valid (not found in security labels configuration):
        • If value=SecurityLabelsConfiguration.NULL, no conflict is reported. Otherwise, generate a non-overridable IXBConflictType.DEFAULT_IXB_TYPE conflict.
      • If the value for the security label is not valid (not found in security labels configuration for this label):
        • Generate a non-overridable IXBConflictType.DEFAULT_IXB_TYPE conflict
      • If imported security label values don't match those on already-persisted object:
        • Generate an overrideable IXBConflictType.EXISTING_OBJECT_ATTRIBUTE_CONFLICT
      • If the importing user doesn't have authorization to modify the security labels of an existing object:
        • Generate an non-overrideable IXBConflictType.NOT_AUTHORIZED conflict.


      Supported API: true
      Specified by:
      checkConflictForAttribute in interface AttributeExporterImporter
      Overrides:
      checkConflictForAttribute in class AttributeExporterImporterTemplate
      Parameters:
      existObj - existing (persisted) object for conflict check
      fileXML - IxbElement for the object from import file
      importer - The Importer which is processing the import
      Throws:
      WTException - if an unexpected error occurs
      See Also:
      • wt.ixb.publicforhandlers.imp.IXBImpConflictRB
    • checkConflictForAttributeBatch

      public void checkConflictForAttributeBatch(List<IxbHndHelper.ElementObjectPair> list, Importer importer, ElementImporter handler) throws WTException
      Checks for conflicts when importing SecurityLabels elements.
      • If SecurityLabel name is not valid (not found in security labels configuration):
        • If value=SecurityLabelsConfiguration.NULL, no conflict is reported. Otherwise, generate a non-overridable IXBConflictType.DEFAULT_IXB_TYPE conflict.
      • If the value for the security label is not valid (not found in security labels configuration for this label):
        • Generate a non-overridable IXBConflictType.DEFAULT_IXB_TYPE conflict.
      • If imported security label values don't match those on already-persisted object:
        • Generate an overrideable IXBConflictType.EXISTING_OBJECT_ATTRIBUTE_CONFLICT conflict.
      • If the importing user doesn't have authorization to modify the security labels of an existing object:
        • Generate an non-overrideable IXBConflictType.NOT_AUTHORIZED conflict.


      Supported API: true
      Specified by:
      checkConflictForAttributeBatch in interface AttributeExporterImporter
      Overrides:
      checkConflictForAttributeBatch in class AttributeExporterImporterTemplate
      Parameters:
      list - The list of objects to be imported, along with their respective IxbElement
      importer - The Importer which is processing the import.
      handler - The ElementImporter instance that represents the object handler.
      Throws:
      WTException - if an unexpected error occurs
    • checkConflictForAttribute

      public void checkConflictForAttribute(IxbElement fileXML, Importer importer) throws WTException
      Checks for conflicts when importing SecurityLabels elements for the preview case. When this API is called, the object is not passed in so only a limited set of conflict checks are done (no conflicts associated with an existing object are checked).
      • If SecurityLabel name is not valid (not found in security labels configuration):
        • If value=SecurityLabelsConfiguration.NULL, no conflict is reported. Otherwise, generate a non-overridable IXBConflictType.DEFAULT_IXB_TYPE conflict.
      • If the value for the security label is not valid (not found in security labels configuration for this label):
        • Generate a non-overridable IXBConflictType.DEFAULT_IXB_TYPE conflict.
      • If imported security label values don't match those on already-persisted object:
        • Generate an overrideable IXBConflictType.EXISTING_OBJECT_ATTRIBUTE_CONFLICT conflict>.


    Supported API: true