Class EntityMetadata

java.lang.Object
oracle.iam.platform.entitymgr.vo.EntityMetadata
All Implemented Interfaces:
oracle.iam.platform.utils.XmlObject

public class EntityMetadata extends Object implements oracle.iam.platform.utils.XmlObject
  • Constructor Details

    • EntityMetadata

      public EntityMetadata()
      Constructor for Kernel use to generate the entity metadata from XML only! Use the other constructor EntityMetadata(String entityType, boolean childEntity) for any other purposes.
    • EntityMetadata

      public EntityMetadata(String entityType, boolean childEntity)
      Construct an empty entity metadata object.
      Parameters:
      entityType - the entity type
      childEntity - if the entity metadata object represents a child entity
  • Method Details

    • getEntityType

      public String getEntityType()
      Get the entity type
      Returns:
      the entity type
    • isChildEntity

      public boolean isChildEntity()
      Check if the entity metadata object represents a child entity.
      Returns:
      true if the entity metadata object represents a child entity
    • getRepositoryInstance

      public String getRepositoryInstance()
      Get the repository instance name.
      Returns:
      the repository instance name
    • setRepositoryInstance

      public void setRepositoryInstance(String reposInstance)
      Set the repository instance name.
      Parameters:
      reposInstance - the repository instance name
    • getProviderType

      public String getProviderType()
      Get the data provider type name.
      Returns:
      the data provider type name
    • setProviderType

      public void setProviderType(String providerType)
      Set the data provider type name.
      Parameters:
      providerType - the data provider type name
    • getProviderParameters

      public Map<String,List<String>> getProviderParameters()
      Get the data provider parameters.
      Returns:
      the data provider parameters
    • setProviderParameters

      public void setProviderParameters(Map<String,List<String>> providerParams)
      Set the data provider parameters.
      Parameters:
      providerParams - the data provider parameters
    • isContainer

      public boolean isContainer()
      Check if it is a container.
      Returns:
      true if it is a container
    • setContainer

      public void setContainer(boolean isContainer)
      Set if the entity can be a container
      Parameters:
      isContainer - if it is a container
    • getContainedEntities

      public Set<String> getContainedEntities() throws UnsupportedOperationException
      Get the set of entity types that can be contained in this container.
      Returns:
      the set of entity types that can be contained in this container
      Throws:
      UnsupportedOperationException - if the entity metadata object does not represents a container
    • addContainedEntity

      public void addContainedEntity(String entityType) throws UnsupportedOperationException
      Add an entity type to the set of entity types that can be contained in this container.
      Parameters:
      entityType - the entity type to be added
      Throws:
      UnsupportedOperationException - if the entity metadata object does not represents a container
    • removeContainedEntity

      public void removeContainedEntity(String entityType) throws UnsupportedOperationException
      Remove an entity type from the set of entity types that can be contained in this container.
      Parameters:
      entityType - the entity type to be removed
      Throws:
      UnsupportedOperationException - if the entity metadata object does not represents a container
    • getAttributes

      public Map<String,AttributeDefinition> getAttributes()
      Get all the attribute definitions
      Returns:
      all the attribute definitions
    • getAttribute

      public AttributeDefinition getAttribute(String attrName)
      Get a attribute definition
      Parameters:
      attrName - the attribute name
      Returns:
      the attribute definition
    • addAttribute

      public void addAttribute(AttributeDefinition attrDef)
      Add or modify an attribute. To modify an existing attribute, make sure the name of the attribute remains the same.
      Parameters:
      attrDef - the attribute definition to be added/modified
    • removeAttribute

      public void removeAttribute(String attrName)
      Remove an attribute. Note that removing an attribute will also remove its corresponding attribute mapping if one exist.
      Parameters:
      attrName - the attribute name to be removed
    • getFields

      public Map<String,FieldDefinition> getFields()
      Get all the target field definitions
      Returns:
      all the target field definitions
    • getField

      public FieldDefinition getField(String fieldName)
      Get a target field definition
      Parameters:
      fieldName - the target field name
      Returns:
      the target field definition
    • addField

      public void addField(FieldDefinition fieldDef)
      Add or modify an target field. To modify an existing target field, make sure the name of the target field remains the same.
      Parameters:
      fieldDef - the target field definition to be added/modified
    • removeField

      public void removeField(String fieldName)
      Remove an target field. Note that removing an target field will also remove its corresponding attribute mapping if one exist.
      Parameters:
      fieldName - the target field name to be removed
    • getAttributeMap

      public Map<String,String> getAttributeMap()
      Get the attribute map
      Returns:
      the attribute map
    • getFieldMap

      public Map<String,String> getFieldMap()
      Get the attribute map
      Returns:
      the attribute map
    • setAttributeMap

      public void setAttributeMap(Map<String,String> attrMap)
      Set the attribute map
      Parameters:
      attrMap - attribute map
    • addAttributeMapping

      public void addAttributeMapping(String attrName, String fieldName) throws oracle.iam.platform.entitymgr.UnknownAttributeException
      Add or modify an attribute mapping. To modify an existing attribute mapping, use the same attribute name of the existing attribute mapping with the new target field name.
      Parameters:
      attrName - the attribute name
      fieldName - the target field name
      Throws:
      oracle.iam.platform.entitymgr.UnknownAttributeException - if the attribute name and/or target field name is not defined
    • removeAttributeMapping

      public void removeAttributeMapping(String attrName)
      Remove an attribute mapping.
      Parameters:
      attrName - the attribute name
    • getChildEntityAttributes

      public Map<String,AttributeDefinition> getChildEntityAttributes()
      Get all the child entity attribute definitions
      Returns:
      all the child entity attribute definitions
    • getChildEntityAttribute

      public AttributeDefinition getChildEntityAttribute(String attrName)
      Get a child entity attribute definition
      Parameters:
      attrName - the child entity attribute name
      Returns:
      the child entity attribute definition
    • addChildEntityAttribute

      public void addChildEntityAttribute(AttributeDefinition attrDef)
      Add or modify a child entity attribute. To modify an existing child entity attribute, use the same attribute name. Note that the type of the attribute should be the entity type of the child entity and that it will not support default value.
      Parameters:
      attrDef - the attribute definition of the child entity attribute to be added/modified
    • removeChildEntityAttribute

      public void removeChildEntityAttribute(String attrName)
      Remove a child entity attribute.
      Parameters:
      attrName - the attribute name of the child entity attribute to be removed
    • getControlAttributes

      public Map<String,ControlAttributeDefinition> getControlAttributes()
      Get all the control attribute definitions
      Returns:
      all the control attribute definitions
    • getControlAttribute

      public ControlAttributeDefinition getControlAttribute(String attrName)
      Get a control attribute definition
      Parameters:
      attrName - the control attribute name
      Returns:
      the control attribute definition
    • addControlAttribute

      public void addControlAttribute(ControlAttributeDefinition attrDef)
      Add or modify a control attribute. To modify an existing control attribute, make sure the name of the control attribute remains the same.
      Parameters:
      attrDef - the control attribute definition to be added/modified
    • removeControlAttribute

      public void removeControlAttribute(String attrName)
      Remove a control attribute.
      Parameters:
      attrName - the control attribute name to be removed
    • getAttachedMetadata

      public Map<String,Map<String,String>> getAttachedMetadata()
      Get all attached metadata
      Returns:
      all attached metadata in a Map with category names as keys to the Map and the metadata name-value pairs as values
    • getAttachedMetadata

      public Map<String,String> getAttachedMetadata(String category)
      Get all attached metadata of a specific category
      Parameters:
      category - category name
      Returns:
      all attached metadata of the category
    • addMetadataAttachment

      public void addMetadataAttachment(String category, String name, String value)
      Add a metadata attachment.
      Parameters:
      category - category name
      name - name
      value - value
    • removeMetadataAttachment

      public void removeMetadataAttachment(String category, String name)
      Remove a metadata attachment.
      Parameters:
      category - category name
      name - name
    • toDocument

      public Document toDocument() throws ParserConfigurationException
      Convert the entity metadata object into a XML document
      Returns:
      the entity metadata object in XML
      Throws:
      ParserConfigurationException - if a DocumentBuilder cannot be created
    • generateXml

      public Document generateXml() throws Exception
      Specified by:
      generateXml in interface oracle.iam.platform.utils.XmlObject
      Throws:
      Exception
    • generateObject

      public void generateObject(Document doc)
      Specified by:
      generateObject in interface oracle.iam.platform.utils.XmlObject