Class InstanceDefault

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

public class InstanceDefault extends ActorDefault implements Instance
  • Constructor Details

    • InstanceDefault

      public InstanceDefault(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

    • getDomain

      public URL getDomain()
      Description copied from interface: Instance
      Gives you the Domain behind the rdf-pub server is running. That is also the base namespace of all rdf objets.
      Specified by:
      getDomain in interface Instance
      Returns:
      The Domain.
    • getCollectionInbox

      public org.apache.commons.rdf.api.IRI getCollectionInbox()
      Specified by:
      getCollectionInbox in interface Instance
      Returns:
      The IRI of the instance's inbox collection.
    • getCollectionOutbox

      public org.apache.commons.rdf.api.IRI getCollectionOutbox()
      Specified by:
      getCollectionOutbox in interface Instance
      Returns:
      The IRI of the instance's outbox collection.
    • getCollectionPublic

      public org.apache.commons.rdf.api.IRI getCollectionPublic()
      Specified by:
      getCollectionPublic in interface Instance
      Returns:
      The IRI of the instance's public collection.
    • getAppVersion

      public String getAppVersion()
      Specified by:
      getAppVersion in interface Instance
      Returns:
      The application Version a.k.a Release Version. It's the maven version of the rdf-pub project.
    • getProfileVersion

      public Long getProfileVersion()
      Specified by:
      getProfileVersion in interface Instance
      Returns:
      The Version of the profile. e.g. 1, but it's possible, that the profile changes in newer rdf-pub versions.
    • getIdentifier

      public String getIdentifier()
      Specified by:
      getIdentifier in interface Instance
      Returns:
      Unique identifier of this rdf-pub instance.
    • getPublicSparqlEndpoint

      public org.apache.commons.rdf.api.IRI getPublicSparqlEndpoint()
      Specified by:
      getPublicSparqlEndpoint in interface Instance
      Returns:
      SPARQL Endpoint to query the public collection.
    • setType

      public void setType(org.apache.commons.rdf.api.IRI id)
      Specified by:
      setType in interface Instance
    • setInboxCollection

      public void setInboxCollection(org.apache.commons.rdf.api.IRI inboxCollection)
      Specified by:
      setInboxCollection in interface Instance
    • setOutboxCollection

      public void setOutboxCollection(org.apache.commons.rdf.api.IRI outboxCollection)
      Specified by:
      setOutboxCollection in interface Instance
    • setPublicCollection

      public void setPublicCollection(org.apache.commons.rdf.api.IRI publicCollection)
      Specified by:
      setPublicCollection in interface Instance
    • setInstanceVersion

      public void setInstanceVersion(String mavenVersion)
      Specified by:
      setInstanceVersion in interface Instance
    • setCommitId

      public void setCommitId(String commitId)
      Specified by:
      setCommitId in interface Instance
    • setPublicSparqlEndpoint

      public void setPublicSparqlEndpoint(org.apache.commons.rdf.api.IRI sparqlPublic)
      Specified by:
      setPublicSparqlEndpoint in interface Instance
    • 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