Class ActorDefault

java.lang.Object
org.linkedopenactors.rdfpub.domain.commonsrdf.ActorDefault
All Implemented Interfaces:
ActivityPubObject, Actor
Direct Known Subclasses:
InstanceDefault

public class ActorDefault extends Object implements Actor
  • Constructor Details

    • ActorDefault

      public ActorDefault(org.apache.commons.rdf.api.RDF rdf, org.apache.commons.rdf.api.IRI subject, org.apache.commons.rdf.api.Graph graph, GraphToStringConverter graphToStringConverter, SubjectProvider subjectProvider, Vocabularies vocabularies)
  • Method Details

    • extractIdentifier

      public String extractIdentifier()
      Specified by:
      extractIdentifier in interface Actor
    • getOutbox

      public org.apache.commons.rdf.api.IRI getOutbox()
      Description copied from interface: Actor
      Gives you the outbox of the actor
      Specified by:
      getOutbox in interface Actor
      Returns:
      The outbox of the actor
    • setOutbox

      public void setOutbox(org.apache.commons.rdf.api.IRI outboxIri)
      Specified by:
      setOutbox in interface Actor
    • getInbox

      public org.apache.commons.rdf.api.IRI getInbox()
      Description copied from interface: Actor
      Gives you the inbox of the actor
      Specified by:
      getInbox in interface Actor
      Returns:
      The inbox of the actor
    • setInbox

      public void setInbox(org.apache.commons.rdf.api.IRI inboxIri)
      Specified by:
      setInbox in interface Actor
    • getPendingFollowers

      public org.apache.commons.rdf.api.IRI getPendingFollowers()
      Specified by:
      getPendingFollowers in interface Actor
    • setPendingFollowers

      public void setPendingFollowers(org.apache.commons.rdf.api.IRI pendingFollowersIri)
      Specified by:
      setPendingFollowers in interface Actor
    • getPendingFollowing

      public org.apache.commons.rdf.api.IRI getPendingFollowing()
      Specified by:
      getPendingFollowing in interface Actor
    • setPendingFollowing

      public void setPendingFollowing(org.apache.commons.rdf.api.IRI pendingFollowingIri)
      Specified by:
      setPendingFollowing in interface Actor
    • getFollowing

      public org.apache.commons.rdf.api.IRI getFollowing()
      Specified by:
      getFollowing in interface Actor
    • getFollowers

      public org.apache.commons.rdf.api.IRI getFollowers()
      Specified by:
      getFollowers in interface Actor
    • getLiked

      public org.apache.commons.rdf.api.IRI getLiked()
      Specified by:
      getLiked in interface Actor
    • getOauth2IssuerUserId

      public Optional<String> getOauth2IssuerUserId()
      Specified by:
      getOauth2IssuerUserId in interface Actor
      Returns:
      The unique id of the user.
    • setOauth2IssuerUserId

      public void setOauth2IssuerUserId(String userId)
      Specified by:
      setOauth2IssuerUserId in interface Actor
    • getOauth2Issuer

      public Optional<String> getOauth2Issuer()
      Specified by:
      getOauth2Issuer in interface Actor
    • setOauth2Issuer

      public void setOauth2Issuer(String issuer)
      Specified by:
      setOauth2Issuer in interface Actor
    • setPreferredUsername

      public void setPreferredUsername(String preferredUsername)
      Specified by:
      setPreferredUsername in interface Actor
    • getPreferredUsername

      public Optional<String> getPreferredUsername()
      Specified by:
      getPreferredUsername in interface Actor
    • getEndpoints

      public Optional<org.apache.commons.rdf.api.IRI> getEndpoints()
      Specified by:
      getEndpoints in interface Actor
    • setEndpoints

      public void setEndpoints(Endpoints endpoints)
      Specified by:
      setEndpoints in interface Actor
    • getPublicKey

      public Optional<org.apache.commons.rdf.api.IRI> getPublicKey()
      Description copied from interface: Actor
      Gets the IRI of the publicKey.
      Specified by:
      getPublicKey in interface Actor
      Returns:
      The IRI of the publicKey.
    • getPublicKey

      public Optional<org.apache.commons.rdf.api.IRI> getPublicKey(boolean resolveIris)
      Description copied from interface: Actor
      Gets the IRI of the publicKey.
      Specified by:
      getPublicKey in interface Actor
      Parameters:
      resolveIris - True, if the internal iris should be replaced with external https:// urls.
      Returns:
      The IRI of the publicKey.
    • resolvePublicKey

      public Optional<PublicKey> resolvePublicKey()
      Specified by:
      resolvePublicKey in interface Actor
    • resolveEndpoints

      public Optional<Endpoints> resolveEndpoints()
      Specified by:
      resolveEndpoints in interface Actor
    • setPublicKey

      public void setPublicKey(PublicKey publicKey)
      Specified by:
      setPublicKey in interface Actor
    • getAttributedtTo

      public Set<org.apache.commons.rdf.api.IRI> getAttributedtTo()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getAttributedtTo in interface ActivityPubObject
      Returns:
      attributedtTo
    • setAttributedTo

      public void setAttributedTo(Set<org.apache.commons.rdf.api.IRI> attributedtTo)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setAttributedTo in interface ActivityPubObject
      Parameters:
      attributedtTo -
    • addAttributedTo

      public void addAttributedTo(org.apache.commons.rdf.api.IRI attributedtTo)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      addAttributedTo in interface ActivityPubObject
      Parameters:
      attributedtTo -
    • getAudience

      public Set<org.apache.commons.rdf.api.IRI> getAudience()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getAudience in interface ActivityPubObject
      Returns:
      audience
    • setAudience

      public void setAudience(Set<org.apache.commons.rdf.api.IRI> audience)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setAudience in interface ActivityPubObject
      Parameters:
      audience -
    • addAudience

      public void addAudience(org.apache.commons.rdf.api.IRI audience)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      addAudience in interface ActivityPubObject
      Parameters:
      audience -
    • getName

      public Optional<String> getName()
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.getName() but without or with default language.
      Specified by:
      getName in interface ActivityPubObject
      Returns:
      name
    • setName

      public void setName(com.neovisionaries.i18n.LanguageCode languageCode, String name)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setName in interface ActivityPubObject
      Parameters:
      languageCode -
      name -
    • getContent

      public Optional<String> getContent()
      Specified by:
      getContent in interface ActivityPubObject
    • getName

      public Optional<String> getName(com.neovisionaries.i18n.LanguageCode languageCode)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getName in interface ActivityPubObject
      Parameters:
      languageCode -
      Returns:
      The name
    • setName

      public void setName(String name)
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.setName(String) with default language.
      Specified by:
      setName in interface ActivityPubObject
      Parameters:
      name -
    • setContent

      public void setContent(String content)
      Specified by:
      setContent in interface ActivityPubObject
    • getPublished

      public Optional<Instant> getPublished()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getPublished in interface ActivityPubObject
      Returns:
      publishing date
    • setPublished

      public void setPublished(Instant instant)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setPublished in interface ActivityPubObject
      Parameters:
      instant -
    • setUpdated

      public void setUpdated(Instant instant)
      Specified by:
      setUpdated in interface ActivityPubObject
    • getSummary

      public Optional<String> getSummary()
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.getSubject() but without language or with default language.
      Specified by:
      getSummary in interface ActivityPubObject
      Returns:
      summary
    • getSummary

      public Optional<String> getSummary(com.neovisionaries.i18n.LanguageCode languageCode)
      Description copied from interface: ActivityPubObject
      A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.
      Specified by:
      getSummary in interface ActivityPubObject
      Parameters:
      languageCode -
      Returns:
      The summary
    • setSummary

      public void setSummary(com.neovisionaries.i18n.LanguageCode languageCode, String summary)
      Description copied from interface: ActivityPubObject
      A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.
      Specified by:
      setSummary in interface ActivityPubObject
      Parameters:
      languageCode -
      summary -
    • setSummary

      public void setSummary(String summary)
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.setSummary(String) but without language or with default language.
      Specified by:
      setSummary in interface ActivityPubObject
      Parameters:
      summary -
    • getTo

      public Set<org.apache.commons.rdf.api.IRI> getTo()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getTo in interface ActivityPubObject
      Returns:
      to
    • setTo

      public void setTo(Set<org.apache.commons.rdf.api.IRI> to)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setTo in interface ActivityPubObject
      Parameters:
      to -
    • addTo

      public void addTo(org.apache.commons.rdf.api.IRI to)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      addTo in interface ActivityPubObject
      Parameters:
      to -
    • getBto

      public Set<org.apache.commons.rdf.api.IRI> getBto()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getBto in interface ActivityPubObject
      Returns:
      bto
    • setBto

      public void setBto(Set<org.apache.commons.rdf.api.IRI> bto)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setBto in interface ActivityPubObject
      Parameters:
      bto -
    • addBto

      public void addBto(org.apache.commons.rdf.api.IRI bto)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      addBto in interface ActivityPubObject
      Parameters:
      bto -
    • getCc

      public Set<org.apache.commons.rdf.api.IRI> getCc()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getCc in interface ActivityPubObject
      Returns:
      cc
    • setCc

      public void setCc(Set<org.apache.commons.rdf.api.IRI> cc)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setCc in interface ActivityPubObject
      Parameters:
      cc -
    • addCc

      public void addCc(org.apache.commons.rdf.api.IRI cc)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      addCc in interface ActivityPubObject
      Parameters:
      cc -
    • getBcc

      public Set<org.apache.commons.rdf.api.IRI> getBcc()
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      getBcc in interface ActivityPubObject
      Returns:
      bcc
    • setBcc

      public void setBcc(Set<org.apache.commons.rdf.api.IRI> bcc)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      setBcc in interface ActivityPubObject
      Parameters:
      bcc -
    • addBcc

      public void addBcc(org.apache.commons.rdf.api.IRI bcc)
      Description copied from interface: ActivityPubObject
      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
      Specified by:
      addBcc in interface ActivityPubObject
      Parameters:
      bcc -
    • getReceivers

      public Set<org.apache.commons.rdf.api.IRI> getReceivers()
      Description copied from interface: ActivityPubObject
      Specified by:
      getReceivers in interface ActivityPubObject
      Returns:
      Set of all receivers.
    • getExternalReceivers

      public Set<org.apache.commons.rdf.api.IRI> getExternalReceivers()
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.getReceivers(), but only the external ones.
      Specified by:
      getExternalReceivers in interface ActivityPubObject
      Returns:
      Set of all external receivers.
    • getInternalReceivers

      public Set<org.apache.commons.rdf.api.IRI> getInternalReceivers()
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.getReceivers(), but only the internal ones.
      Specified by:
      getInternalReceivers in interface ActivityPubObject
      Returns:
      Set of all internal receivers.
    • hideBlindReceivers

      public void hideBlindReceivers()
      Description copied from interface: ActivityPubObject
      Removes AS.bcc() AND AS.bto()
      Specified by:
      hideBlindReceivers in interface ActivityPubObject
    • isAttributedTo

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

      public boolean isReceiver(org.apache.commons.rdf.api.IRI requestedActorId)
      Description copied from interface: ActivityPubObject
      Checks, if the passed ActorId is in ActivityPubObject.getReceivers()
      Specified by:
      isReceiver in interface ActivityPubObject
      Parameters:
      requestedActorId -
      Returns:
      True, if the passed ActorId is in ActivityPubObject.getReceivers()
    • getSubject

      public org.apache.commons.rdf.api.IRI getSubject()
      Specified by:
      getSubject in interface ActivityPubObject
    • getBaseSubject

      public org.apache.commons.rdf.api.IRI getBaseSubject()
      Description copied from interface: ActivityPubObject
      An ActivityPubObject has Versions, so the ActivityPubObject.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.
      Specified by:
      getBaseSubject in interface ActivityPubObject
      Returns:
      ActivityPubObjects base Subject
    • getExternalBaseSubject

      public org.apache.commons.rdf.api.IRI getExternalBaseSubject()
      Description copied from interface: ActivityPubObject
      Same as ActivityPubObject.getBaseSubject() but as external url.
      Specified by:
      getExternalBaseSubject in interface ActivityPubObject
      Returns:
      External url that points to the base of thet object. (TODO link to versioning docs!)
    • getObjectVersion

      public Optional<Long> getObjectVersion()
      Specified by:
      getObjectVersion in interface ActivityPubObject
    • setObjectVersion

      public void setObjectVersion(Long objectVersion)
      Specified by:
      setObjectVersion in interface ActivityPubObject
    • setType

      public void setType(Set<org.apache.commons.rdf.api.IRI> type)
      Description copied from interface: ActivityPubObject
      The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
      Specified by:
      setType in interface ActivityPubObject
      Parameters:
      type -
    • setWasAttributedTo

      public void setWasAttributedTo(org.apache.commons.rdf.api.IRI actor)
      Specified by:
      setWasAttributedTo in interface ActivityPubObject
    • getWasAttributedTo

      public Optional<org.apache.commons.rdf.api.IRI> getWasAttributedTo()
      Specified by:
      getWasAttributedTo in interface ActivityPubObject
    • setWasGeneratedBy

      public void setWasGeneratedBy(org.apache.commons.rdf.api.IRI subject)
      Specified by:
      setWasGeneratedBy in interface ActivityPubObject
    • getWasGeneratedBy

      public Optional<org.apache.commons.rdf.api.IRI> getWasGeneratedBy()
      Specified by:
      getWasGeneratedBy in interface ActivityPubObject
    • setWasRevisionOf

      public void setWasRevisionOf(org.apache.commons.rdf.api.IRI subject)
      Specified by:
      setWasRevisionOf in interface ActivityPubObject
    • getWasRevisionOf

      public Optional<org.apache.commons.rdf.api.IRI> getWasRevisionOf()
      Specified by:
      getWasRevisionOf in interface ActivityPubObject
    • getSameAs

      public Optional<org.apache.commons.rdf.api.IRI> getSameAs()
      Specified by:
      getSameAs in interface ActivityPubObject
    • setSameAs

      public void setSameAs(org.apache.commons.rdf.api.IRI subject)
      Specified by:
      setSameAs in interface ActivityPubObject
    • addType

      public void addType(org.apache.commons.rdf.api.IRI type)
      Description copied from interface: ActivityPubObject
      The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
      Specified by:
      addType in interface ActivityPubObject
      Parameters:
      type -
    • getTypes

      public Set<org.apache.commons.rdf.api.IRI> getTypes()
      Description copied from interface: ActivityPubObject
      The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_type
      Specified by:
      getTypes in interface ActivityPubObject
      Returns:
      The type(s)
    • asGraph

      public org.apache.commons.rdf.api.Graph asGraph()
      Specified by:
      asGraph in interface ActivityPubObject
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(RdfFormat format)
      Specified by:
      toString in interface ActivityPubObject
    • toString

      public String toString(RdfFormat format, boolean resolveIris)
      Description copied from interface: ActivityPubObject
      Converts the passed graph/model iinto a string.
      Specified by:
      toString in interface ActivityPubObject
      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.
    • asConvertable

      public ActivityPubObjectConvertable asConvertable()
      Specified by:
      asConvertable in interface ActivityPubObject
    • isActivity

      public boolean isActivity()
      Specified by:
      isActivity in interface ActivityPubObject
    • partialUpdate

      public void partialUpdate(ActivityPubObject newOne)
      Specified by:
      partialUpdate in interface ActivityPubObject