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 TypeMethodDescriptionvoid
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-tovoid
addType
(org.apache.commons.rdf.api.IRI type) The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_typeorg.apache.commons.rdf.api.Graph
asGraph()
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 thegetSubject()
Method normally returns the subject of the current version.Set
<org.apache.commons.rdf.api.IRI> getBcc()
Identifies one or more Objects that are part of the private secondary audience of this Object.Set
<org.apache.commons.rdf.api.IRI> getBto()
Identifies an Object that is part of the private primary audience of this Object.Set
<org.apache.commons.rdf.api.IRI> getCc()
Identifies an Object that is part of the public secondary audience of this Object.org.apache.commons.rdf.api.IRI
Same asgetBaseSubject()
but as external url.Set
<org.apache.commons.rdf.api.IRI> Same asgetReceivers()
, but only the external ones.Set
<org.apache.commons.rdf.api.IRI> Same asgetReceivers()
, but only the internal ones.getName()
Same asgetName()
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 asgetSubject()
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> 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-toSet
<org.apache.commons.rdf.api.IRI> getTypes()
The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_typeOptional
<org.apache.commons.rdf.api.IRI> Optional
<org.apache.commons.rdf.api.IRI> Optional
<org.apache.commons.rdf.api.IRI> void
boolean
boolean
isAttributedTo
(org.apache.commons.rdf.api.IRI requestedActorId) Checks, if the passed ActorId is in theAS.attributedTo()
of theActivityPubObject
.boolean
isReceiver
(org.apache.commons.rdf.api.IRI requestedActorId) Checks, if the passed ActorId is ingetReceivers()
void
partialUpdate
(ActivityPubObject newOne) 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
Identifies one or more Objects that are part of the private secondary audience of this Object.void
Identifies an Object that is part of the private primary audience of this Object.void
Identifies an Object that is part of the public secondary audience of this Object.void
setContent
(String content) void
A simple, human-readable, plain-text name for the object.void
Same assetName(String)
with default language.void
setObjectVersion
(Long objectVersion) void
setPublished
(Instant instant) 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 assetSummary(String)
but without language or with default language.void
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-tovoid
The RDF Type See Also: https://www.w3.org/TR/rdf12-schema/#ch_typevoid
setUpdated
(Instant instant) 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) 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
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
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
-
setContent
-
setType
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
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
Same asgetName()
but without or with default language.- Returns:
- name
-
setName
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
Same assetName(String)
with default language.- Parameters:
name
-
-
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
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
A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.- Parameters:
languageCode
-- Returns:
- The summary
-
getSummary
Same asgetSubject()
but without language or with default language.- Returns:
- summary
-
setSummary
A natural language summarization of the object encoded as HTML. Multiple language tagged summaries MAY be provided.- Parameters:
languageCode
-summary
-
-
setSummary
Same assetSummary(String)
but without language or with default language.- Parameters:
summary
-
-
setUpdated
-
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
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
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
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
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 asgetReceivers()
, but only the internal ones.- Returns:
Set
of all internal receivers.
-
getExternalReceivers
Set<org.apache.commons.rdf.api.IRI> getExternalReceivers()Same asgetReceivers()
, but only the external ones.- Returns:
Set
of all external receivers.
-
hideBlindReceivers
void hideBlindReceivers() -
isAttributedTo
boolean isAttributedTo(org.apache.commons.rdf.api.IRI requestedActorId) Checks, if the passed ActorId is in theAS.attributedTo()
of theActivityPubObject
.- Parameters:
requestedActorId
-- Returns:
- True, if the passed ActorId is in the
AS.attributedTo()
of theActivityPubObject
.
-
isReceiver
boolean isReceiver(org.apache.commons.rdf.api.IRI requestedActorId) Checks, if the passed ActorId is ingetReceivers()
- 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 thegetSubject()
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 asgetBaseSubject()
but as external url.- Returns:
- External url that points to the base of thet object. (TODO link to versioning docs!)
-
getObjectVersion
-
setObjectVersion
-
toString
-
toString
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
ActivityPubObjectConvertable 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
-