Interface ActivityPubObject

All Known Subinterfaces:
Activity, Actor, Endpoints, Instance, OrderedCollectionPage, PublicKey, Tombstone
All Known Implementing Classes:
ActivityDefault, ActorDefault, EndpointsDefault, InstanceDefault, OrderedCollectionPageDefault, PublicKeyDefault, TombstoneDefault

public interface ActivityPubObject
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAttributedTo(org.apache.commons.rdf.api.IRI attributedtTo)
    Identifies one or more entities to which this object is attributed.
    void
    addAudience(org.apache.commons.rdf.api.IRI audience)
    Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant.
    void
    addBcc(org.apache.commons.rdf.api.IRI bcc)
    Identifies one or more Objects that are part of the private secondary audience of this Object.
    void
    addBto(org.apache.commons.rdf.api.IRI bto)
    Identifies an Object that is part of the private primary audience of this Object.
    void
    addCc(org.apache.commons.rdf.api.IRI cc)
    Identifies an Object that is part of the public secondary audience of this Object.
    void
    addTo(org.apache.commons.rdf.api.IRI to)
    Identifies an entity considered to be part of the public primary audience of an Object See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to
    void
    addType(org.apache.commons.rdf.api.IRI type)
    The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
     
    org.apache.commons.rdf.api.Graph
     
    Set<org.apache.commons.rdf.api.IRI>
    Identifies one or more entities to which this object is attributed.
    Set<org.apache.commons.rdf.api.IRI>
    Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant.
    org.apache.commons.rdf.api.IRI
    An ActivityPubObject has Versions, so the getSubject() Method normally returns the subject of the current version.
    Set<org.apache.commons.rdf.api.IRI>
    Identifies one or more Objects that are part of the private secondary audience of this Object.
    Set<org.apache.commons.rdf.api.IRI>
    Identifies an Object that is part of the private primary audience of this Object.
    Set<org.apache.commons.rdf.api.IRI>
    Identifies an Object that is part of the public secondary audience of this Object.
     
    org.apache.commons.rdf.api.IRI
    Same as getBaseSubject() but as external url.
    Set<org.apache.commons.rdf.api.IRI>
    Same as getReceivers(), but only the external ones.
    Set<org.apache.commons.rdf.api.IRI>
    Same as getReceivers(), but only the internal ones.
    Same as getName() but without or with default language.
    getName(com.neovisionaries.i18n.LanguageCode languageCode)
    A simple, human-readable, plain-text name for the object.
    The date and time describing the actual or expected starting time of the object.
    Set<org.apache.commons.rdf.api.IRI>
    Optional<org.apache.commons.rdf.api.IRI>
     
    org.apache.commons.rdf.api.IRI
     
    Same as getSubject() but without language or with default language.
    getSummary(com.neovisionaries.i18n.LanguageCode languageCode)
    A natural language summarization of the object encoded as HTML.
    Set<org.apache.commons.rdf.api.IRI>
    Identifies an entity considered to be part of the public primary audience of an Object See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to
    Set<org.apache.commons.rdf.api.IRI>
    The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
    Optional<org.apache.commons.rdf.api.IRI>
     
    Optional<org.apache.commons.rdf.api.IRI>
     
    Optional<org.apache.commons.rdf.api.IRI>
     
    void
    Removes AS.bcc() AND AS.bto()
    boolean
     
    boolean
    isAttributedTo(org.apache.commons.rdf.api.IRI requestedActorId)
    Checks, if the passed ActorId is in the AS.attributedTo() of the ActivityPubObject.
    boolean
    isReceiver(org.apache.commons.rdf.api.IRI requestedActorId)
    Checks, if the passed ActorId is in getReceivers()
    void
     
    void
    setAttributedTo(Set<org.apache.commons.rdf.api.IRI> attributedtTo)
    Identifies one or more entities to which this object is attributed.
    void
    setAudience(Set<org.apache.commons.rdf.api.IRI> audience)
    Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant.
    void
    setBcc(Set<org.apache.commons.rdf.api.IRI> bcc)
    Identifies one or more Objects that are part of the private secondary audience of this Object.
    void
    setBto(Set<org.apache.commons.rdf.api.IRI> bto)
    Identifies an Object that is part of the private primary audience of this Object.
    void
    setCc(Set<org.apache.commons.rdf.api.IRI> cc)
    Identifies an Object that is part of the public secondary audience of this Object.
    void
    setContent(String content)
     
    void
    setName(com.neovisionaries.i18n.LanguageCode languageCode, String name)
    A simple, human-readable, plain-text name for the object.
    void
    Same as setName(String) with default language.
    void
    The date and time describing the actual or expected starting time of the object.
    void
    setSameAs(org.apache.commons.rdf.api.IRI subject)
     
    void
    setSummary(com.neovisionaries.i18n.LanguageCode languageCode, String summary)
    A natural language summarization of the object encoded as HTML.
    void
    setSummary(String summary)
    Same as setSummary(String) but without language or with default language.
    void
    setTo(Set<org.apache.commons.rdf.api.IRI> to)
    Identifies an entity considered to be part of the public primary audience of an Object See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to
    void
    setType(Set<org.apache.commons.rdf.api.IRI> type)
    The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
    void
     
    void
    setWasAttributedTo(org.apache.commons.rdf.api.IRI subject)
     
    void
    setWasGeneratedBy(org.apache.commons.rdf.api.IRI subject)
     
    void
    setWasRevisionOf(org.apache.commons.rdf.api.IRI subject)
     
     
    toString(RdfFormat format, boolean resolveIris)
    Converts the passed graph/model iinto a string.
  • Method Details

    • getAttributedtTo

      Set<org.apache.commons.rdf.api.IRI> getAttributedtTo()
      Identifies one or more entities to which this object is attributed. The attributed entities might not be Actors. For instance, an object might be attributed to the completion of another activity. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedto
      Returns:
      attributedtTo
    • setAttributedTo

      void setAttributedTo(Set<org.apache.commons.rdf.api.IRI> attributedtTo)
      Identifies one or more entities to which this object is attributed. The attributed entities might not be Actors. For instance, an object might be attributed to the completion of another activity. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedto
      Parameters:
      attributedtTo -
    • addAttributedTo

      void addAttributedTo(org.apache.commons.rdf.api.IRI attributedtTo)
      Identifies one or more entities to which this object is attributed. The attributed entities might not be Actors. For instance, an object might be attributed to the completion of another activity. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedto
      Parameters:
      attributedtTo -
    • getAudience

      Set<org.apache.commons.rdf.api.IRI> getAudience()
      Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audience
      Returns:
      audience
    • addAudience

      void addAudience(org.apache.commons.rdf.api.IRI audience)
      Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audience
      Parameters:
      audience -
    • setAudience

      void setAudience(Set<org.apache.commons.rdf.api.IRI> audience)
      Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-audience
      Parameters:
      audience -
    • getContent

      Optional<String> getContent()
    • setContent

      void setContent(String content)
    • setType

      void setType(Set<org.apache.commons.rdf.api.IRI> type)
      The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
      Parameters:
      type -
    • addType

      void addType(org.apache.commons.rdf.api.IRI type)
      The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
      Parameters:
      type -
    • getTypes

      Set<org.apache.commons.rdf.api.IRI> getTypes()
      The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
      Returns:
      The type(s)
    • getName

      Optional<String> getName(com.neovisionaries.i18n.LanguageCode languageCode)
      A simple, human-readable, plain-text name for the object. HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name
      Parameters:
      languageCode -
      Returns:
      The name
    • getName

      Optional<String> getName()
      Same as getName() but without or with default language.
      Returns:
      name
    • setName

      void setName(com.neovisionaries.i18n.LanguageCode languageCode, String name)
      A simple, human-readable, plain-text name for the object. HTML markup MUST NOT be included. The name MAY be expressed using multiple language-tagged values. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name
      Parameters:
      languageCode -
      name -
    • setName

      void setName(String name)
      Same as setName(String) with default language.
      Parameters:
      name -
    • getPublished

      Optional<Instant> getPublished()
      The date and time describing the actual or expected starting time of the object. When used with an Activity object, for instance, the startTime property specifies the moment the activity began or is scheduled to begin. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-published
      Returns:
      publishing date
    • setPublished

      void setPublished(Instant instant)
      The date and time describing the actual or expected starting time of the object. When used with an Activity object, for instance, the startTime property specifies the moment the activity began or is scheduled to begin. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-published
      Parameters:
      instant -
    • getSummary

      Optional<String> getSummary(com.neovisionaries.i18n.LanguageCode languageCode)
      A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.
      Parameters:
      languageCode -
      Returns:
      The summary
    • getSummary

      Optional<String> getSummary()
      Same as getSubject() but without language or with default language.
      Returns:
      summary
    • setSummary

      void setSummary(com.neovisionaries.i18n.LanguageCode languageCode, String summary)
      A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.
      Parameters:
      languageCode -
      summary -
    • setSummary

      void setSummary(String summary)
      Same as setSummary(String) but without language or with default language.
      Parameters:
      summary -
    • setUpdated

      void setUpdated(Instant instant)
    • getTo

      Set<org.apache.commons.rdf.api.IRI> getTo()
      Identifies an entity considered to be part of the public primary audience of an Object See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to
      Returns:
      to
    • addTo

      void addTo(org.apache.commons.rdf.api.IRI to)
      Identifies an entity considered to be part of the public primary audience of an Object See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to
      Parameters:
      to -
    • setTo

      void setTo(Set<org.apache.commons.rdf.api.IRI> to)
      Identifies an entity considered to be part of the public primary audience of an Object See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to
      Parameters:
      to -
    • getBto

      Set<org.apache.commons.rdf.api.IRI> getBto()
      Identifies an Object that is part of the private primary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bto
      Returns:
      bto
    • addBto

      void addBto(org.apache.commons.rdf.api.IRI bto)
      Identifies an Object that is part of the private primary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bto
      Parameters:
      bto -
    • setBto

      void setBto(Set<org.apache.commons.rdf.api.IRI> bto)
      Identifies an Object that is part of the private primary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bto
      Parameters:
      bto -
    • getCc

      Set<org.apache.commons.rdf.api.IRI> getCc()
      Identifies an Object that is part of the public secondary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-cc
      Returns:
      cc
    • addCc

      void addCc(org.apache.commons.rdf.api.IRI cc)
      Identifies an Object that is part of the public secondary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-cc
      Parameters:
      cc -
    • setCc

      void setCc(Set<org.apache.commons.rdf.api.IRI> cc)
      Identifies an Object that is part of the public secondary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-cc
      Parameters:
      cc -
    • getBcc

      Set<org.apache.commons.rdf.api.IRI> getBcc()
      Identifies one or more Objects that are part of the private secondary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bcc
      Returns:
      bcc
    • addBcc

      void addBcc(org.apache.commons.rdf.api.IRI bcc)
      Identifies one or more Objects that are part of the private secondary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bcc
      Parameters:
      bcc -
    • setBcc

      void setBcc(Set<org.apache.commons.rdf.api.IRI> bcc)
      Identifies one or more Objects that are part of the private secondary audience of this Object. See Also: https://www.w3.org/TR/activitystreams-vocabulary/#dfn-bcc
      Parameters:
      bcc -
    • getReceivers

      Set<org.apache.commons.rdf.api.IRI> getReceivers()
      Returns:
      Set of all receivers.
    • getInternalReceivers

      Set<org.apache.commons.rdf.api.IRI> getInternalReceivers()
      Same as getReceivers(), but only the internal ones.
      Returns:
      Set of all internal receivers.
    • getExternalReceivers

      Set<org.apache.commons.rdf.api.IRI> getExternalReceivers()
      Same as getReceivers(), but only the external ones.
      Returns:
      Set of all external receivers.
    • hideBlindReceivers

      void hideBlindReceivers()
      Removes AS.bcc() AND AS.bto()
    • isAttributedTo

      boolean isAttributedTo(org.apache.commons.rdf.api.IRI requestedActorId)
      Checks, if the passed ActorId is in the AS.attributedTo() of the ActivityPubObject.
      Parameters:
      requestedActorId -
      Returns:
      True, if the passed ActorId is in the AS.attributedTo() of the ActivityPubObject.
    • isReceiver

      boolean isReceiver(org.apache.commons.rdf.api.IRI requestedActorId)
      Checks, if the passed ActorId is in getReceivers()
      Parameters:
      requestedActorId -
      Returns:
      True, if the passed ActorId is in getReceivers()
    • getSubject

      org.apache.commons.rdf.api.IRI getSubject()
    • getBaseSubject

      org.apache.commons.rdf.api.IRI getBaseSubject()
      An ActivityPubObject has Versions, so the getSubject() Method normally returns the subject of the current version. But sometimes you want the base url without the version 'extension'. Then you can use this method.
      Returns:
      ActivityPubObjects base Subject
    • getExternalBaseSubject

      org.apache.commons.rdf.api.IRI getExternalBaseSubject()
      Same as getBaseSubject() but as external url.
      Returns:
      External url that points to the base of thet object. (TODO link to versioning docs!)
    • toString

      String toString(RdfFormat format)
    • toString

      String toString(RdfFormat format, boolean resolveIris)
      Converts the passed graph/model iinto a string.
      Parameters:
      format - The format that the string should have, Turtle, Json-LD, ...
      resolveIris - True, if the internal iris should be replaced with external https:// urls.
      Returns:
      The graph/model as string in the passed format.
    • asGraph

      org.apache.commons.rdf.api.Graph asGraph()
    • asConvertable

    • isActivity

      boolean isActivity()
    • setWasAttributedTo

      void setWasAttributedTo(org.apache.commons.rdf.api.IRI subject)
    • getWasAttributedTo

      Optional<org.apache.commons.rdf.api.IRI> getWasAttributedTo()
    • setWasGeneratedBy

      void setWasGeneratedBy(org.apache.commons.rdf.api.IRI subject)
    • getWasGeneratedBy

      Optional<org.apache.commons.rdf.api.IRI> getWasGeneratedBy()
    • setWasRevisionOf

      void setWasRevisionOf(org.apache.commons.rdf.api.IRI subject)
    • getWasRevisionOf

      Optional<org.apache.commons.rdf.api.IRI> getWasRevisionOf()
    • setSameAs

      void setSameAs(org.apache.commons.rdf.api.IRI subject)
    • getSameAs

      Optional<org.apache.commons.rdf.api.IRI> getSameAs()
    • partialUpdate

      void partialUpdate(ActivityPubObject newOne)