org.modeshape.jcr.federation

## Class FederatedDocumentReader

- java.lang.Object
- - org.modeshape.jcr.federation.FederatedDocumentReader

- All Implemented Interfaces:
    DocumentReader

      public class FederatedDocumentReader
      extends Object
      implements DocumentReader

  Implementation of a `DocumentReader` that be used to obtain "semantic" information from a federated document

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FederatedDocumentReader(DocumentTranslator translator, Document federatedDocument)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Document` | `document()` Returns the underlying document instance.
    `Integer` | `getCacheTtlSeconds()` Returns the number of seconds that the underlying document should be cached by the repository, if any.
    `List<Document>` | `getChildren()` Returns the list of children the underlying document has.
    `LinkedHashMap<String,Name>` | `getChildrenMap()` Returns an ordered map of (childId, childName) the underlying document has.
    `String` | `getDocumentId()` Returns the id of the underlying document.
    `Set<String>` | `getMixinTypeNames()` Returns a set with the names of the primary types of the underlying document.
    `Set<Name>` | `getMixinTypes()` Returns a set with the names of the primary types of the underlying document.
    `List<String>` | `getParentIds()` Returns the list of identifiers of the parents of the underlying document.
    `Name` | `getPrimaryType()` Returns name of the primary type of the underlying document.
    `String` | `getPrimaryTypeName()` Returns the name of primary type of the underlying document.
    `Map<Name,Property>` | `getProperties()` Returns all the properties of the underlying document.
    `Property` | `getProperty(Name name)` Returns the property which has the given name, or null if there is no such property.
    `Property` | `getProperty(String name)` Returns the property which has the given name, or null if there is no such property.
    `boolean` | `isQueryable()` Determine whether the document is considered queryable.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FederatedDocumentReader

          public FederatedDocumentReader(DocumentTranslator translator,
                                 Document federatedDocument)

  - ### Method Detail

    - #### getDocumentId

          public String getDocumentId()

      Description copied from interface: `DocumentReader`
      Returns the id of the underlying document.
      Specified by:
        `getDocumentId` in interface `DocumentReader`
      Returns:
        a `non-null` `String`

    - #### getParentIds

          public List<String> getParentIds()

      Description copied from interface: `DocumentReader`
      Returns the list of identifiers of the parents of the underlying document.
      Specified by:
        `getParentIds` in interface `DocumentReader`
      Returns:
        a `non-null` `List`

    - #### getChildren

          public List<Document> getChildren()

      Description copied from interface: `DocumentReader`
      Returns the list of children the underlying document has.
      Specified by:
        `getChildren` in interface `DocumentReader`
      Returns:
        a `non-null` `List`

    - #### getChildrenMap

          public LinkedHashMap<String,Name> getChildrenMap()

      Description copied from interface: `DocumentReader`
      Returns an ordered map of (childId, childName) the underlying document has. This preserves the order of the children as defined on the document.

      The returned map does not contain any explicit same name sibling information, so a connector interested in that would have to do its own, custom processing.

      Specified by:
        `getChildrenMap` in interface `DocumentReader`
      Returns:
        a `non-null` `LinkedHashMap`

    - #### getPrimaryType

          public Name getPrimaryType()

      Description copied from interface: `DocumentReader`
      Returns name of the primary type of the underlying document.
      Specified by:
        `getPrimaryType` in interface `DocumentReader`
      Returns:
        a `non-null` `Name`

    - #### getMixinTypes

          public Set<Name> getMixinTypes()

      Description copied from interface: `DocumentReader`
      Returns a set with the names of the primary types of the underlying document.
      Specified by:
        `getMixinTypes` in interface `DocumentReader`
      Returns:
        a `non-null` `Set`

    - #### getPrimaryTypeName

          public String getPrimaryTypeName()

      Description copied from interface: `DocumentReader`
      Returns the name of primary type of the underlying document.
      Specified by:
        `getPrimaryTypeName` in interface `DocumentReader`
      Returns:
        a `non-null` `String`

    - #### getMixinTypeNames

          public Set<String> getMixinTypeNames()

      Description copied from interface: `DocumentReader`
      Returns a set with the names of the primary types of the underlying document.
      Specified by:
        `getMixinTypeNames` in interface `DocumentReader`
      Returns:
        a `non-null` `Set`

    - #### getProperties

          public Map<Name,Property> getProperties()

      Description copied from interface: `DocumentReader`
      Returns all the properties of the underlying document.
      Specified by:
        `getProperties` in interface `DocumentReader`
      Returns:
        a `non-null` `Map` of (property name, property value) pairs.

    - #### getProperty

          public Property getProperty(Name name)

      Description copied from interface: `DocumentReader`
      Returns the property which has the given name, or null if there is no such property.
      Specified by:
        `getProperty` in interface `DocumentReader`
      Parameters:
        `name` - a `non-null` `Name`
      Returns:
        either a `Property` instance or `null`

    - #### getProperty

          public Property getProperty(String name)

      Description copied from interface: `DocumentReader`
      Returns the property which has the given name, or null if there is no such property.
      Specified by:
        `getProperty` in interface `DocumentReader`
      Parameters:
        `name` - a `non-null` `Name`
      Returns:
        either a `Property` instance or `null`

    - #### document

          public Document document()

      Description copied from interface: `DocumentReader`
      Returns the underlying document instance.
      Specified by:
        `document` in interface `DocumentReader`
      Returns:
        a `non-null` `Document` instance.

    - #### getCacheTtlSeconds

          public Integer getCacheTtlSeconds()

      Description copied from interface: `DocumentReader`
      Returns the number of seconds that the underlying document should be cached by the repository, if any.
      Specified by:
        `getCacheTtlSeconds` in interface `DocumentReader`
      Returns:
        either an optional `Integer`. If `null`, it means that there isn't a special requirement for the underlying document.

    - #### isQueryable

          public boolean isQueryable()

      Description copied from interface: `DocumentReader`
      Determine whether the document is considered queryable.
      Specified by:
        `isQueryable` in interface `DocumentReader`
      Returns:
        true if the document is queryable, or false if it is not

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.