public class MediaObject extends java.lang.Object implements VisualShape.VisualShapeSolrCapable
A class that defines a single media object. All media objects are by default of type MediaUrlValidator.MediaType.UNKNOWN
}.
Note: when using this class, never pass partial objects to database methods, missing information (e.g. value == null) may be assumed to be marked as "deleted", and will be removed from the database.
Media objects are objects which were identified from the content given for analysis (e.g. from photos).
Back-ends may only edit objects which have been created by them (checked by objectId, getObjectId()
and backendId, getBackendId()
). Back-ends may not edit objects which have been confirmed by the user.
If a back-end wants to modify an object created by another back-end, it must generate and submit a new (MediaObject.ConfirmationStatus.CANDIDATE
) media object.
MediaUrlValidator.MediaType.UNKNOWN
OR if object is part of a container object, such as Media
the container's type will be used (see Media.getMediaType()
).CAContentCore.Visibility.PRIVATE
.<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <object> <backendId>811294222</backendId> <confidence>0.20135624842974498</confidence> <mediaObjectId>8102478566423944712</mediaObjectId> <mediaType>PHOTO</mediaType> <objectId>xehekOwUiFuQlVNngAtuehiBZELdxtjgOfxsyjzlQsWanftQWOGeVWeiZpcvsosa</objectId> <rank>1202910753</rank> <serviceId>6</serviceId> <status>USER_CONFIRMED</status> <objectType>KEYWORD</objectType> <value>RRPByJYExeiXMCyBhHAiaLUAhmnYgGmFncCFGpsplJdKWIrYMYrvIUyylboEFHvX</value> <visibility>PUBLIC</visibility> <userId>696722578499386597</userId> </object>
VisualShape
Modifier and Type | Class and Description |
---|---|
static class |
MediaObject.ConfirmationStatus
The confirmation status of the media object.
|
static class |
MediaObject.MediaObjectType
The type of the media object.
|
Constructor and Description |
---|
MediaObject()
for serialization, must be public for solr.
|
MediaObject(MediaUrlValidator.MediaType mediaType,
MediaObject.MediaObjectType mediaObjectType) |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getBackendId() |
java.lang.Double |
getConfidence() |
MediaObject.ConfirmationStatus |
getConfirmationStatus() |
java.lang.Integer |
getConfirmationStatusValue() |
java.lang.String |
getMediaObjectId()
Internally generated, unique Id.
|
MediaObject.MediaObjectType |
getMediaObjectType() |
java.lang.Integer |
getMediaObjectTypeValue() |
MediaUrlValidator.MediaType |
getMediaType() |
java.lang.Integer |
getMediaTypeValue() |
java.lang.String |
getName() |
java.lang.String |
getObjectId()
Generally externally generated id, unique only when used in combination with back-end id, or if back-end id is missing, with user id.
|
UserIdentity |
getOwnerUserId() |
java.lang.Long |
getOwnerUserIdValue() |
java.lang.Integer |
getRank() |
java.lang.Integer |
getServiceId() |
CAContentCore.ServiceType |
getServiceType() |
java.util.List<java.lang.String> |
getSolrTimecodes()
Solr serializing helper method
|
TimecodeList |
getTimecodes() |
java.util.Date |
getUpdated() |
java.lang.String |
getValue() |
CAContentCore.Visibility |
getVisibility() |
java.lang.Integer |
getVisibilityValue() |
VisualShape |
getVisualShape() |
java.lang.Integer |
getVisualShapeTypeId() |
java.lang.String |
getVisualShapeValue() |
static boolean |
isValid(MediaObject object) |
void |
setBackendId(java.lang.Integer backendId) |
void |
setConfidence(java.lang.Double confidence) |
void |
setConfirmationStatus(MediaObject.ConfirmationStatus status) |
void |
setMediaObjectId(java.lang.String id) |
void |
setMediaObjectType(MediaObject.MediaObjectType type) |
void |
setMediaType(MediaUrlValidator.MediaType mediaType) |
void |
setName(java.lang.String name) |
void |
setObjectId(java.lang.String objectId) |
void |
setOwnerUserId(UserIdentity userId) |
void |
setRank(java.lang.Integer rank) |
void |
setServiceType(CAContentCore.ServiceType serviceType) |
void |
setSolrTimecodes(java.util.List<java.lang.String> timecodes)
Solr serializing helper method
|
void |
setTimecodes(TimecodeList timecodes) |
void |
setUpdated(java.util.Date updated) |
void |
setValue(java.lang.String value) |
void |
setVisibility(CAContentCore.Visibility visibility) |
void |
setVisualShape(VisualShape shape) |
void |
setVisualShapeTypeId(java.lang.Integer type) |
void |
setVisualShapeValue(java.lang.String value) |
public MediaObject()
public MediaObject(MediaUrlValidator.MediaType mediaType, MediaObject.MediaObjectType mediaObjectType)
mediaType
- mediaObjectType
- public java.lang.Double getConfidence()
setConfidence(Double)
public void setConfidence(java.lang.Double confidence)
confidence
- getConfidence()
public UserIdentity getOwnerUserId()
setOwnerUserId(UserIdentity)
public void setOwnerUserId(UserIdentity userId)
userId
- getOwnerUserId()
public java.lang.Long getOwnerUserIdValue()
getOwnerUserId()
public CAContentCore.ServiceType getServiceType()
setServiceType(service.tut.pori.contentanalysis.CAContentCore.ServiceType)
public void setServiceType(CAContentCore.ServiceType serviceType)
serviceType
- getServiceType()
public java.lang.String getValue()
getName()
,
setValue(String)
public java.lang.String getObjectId()
setObjectId(String)
public void setObjectId(java.lang.String objectId)
objectId
- getObjectId()
public java.lang.String getMediaObjectId()
setMediaObjectId(String)
public void setMediaObjectId(java.lang.String id)
id
- DB (row) idgetMediaObjectId()
public java.lang.Integer getBackendId()
setBackendId(Integer)
public void setBackendId(java.lang.Integer backendId)
backendId
- getBackendId()
public MediaObject.ConfirmationStatus getConfirmationStatus()
setConfirmationStatus(ConfirmationStatus)
public void setConfirmationStatus(MediaObject.ConfirmationStatus status)
status
- getConfirmationStatus()
public java.lang.Integer getConfirmationStatusValue()
getConfirmationStatus()
public VisualShape getVisualShape()
setVisualShape(VisualShape)
public void setVisualShape(VisualShape shape)
shape
- getVisualShape()
public void setValue(java.lang.String value)
value
- getValue()
public void setMediaObjectType(MediaObject.MediaObjectType type)
type
- getMediaObjectType()
public MediaObject.MediaObjectType getMediaObjectType()
setMediaObjectType(MediaObjectType)
public java.lang.Integer getMediaObjectTypeValue()
getMediaObjectType()
public java.lang.Integer getServiceId()
getServiceType()
public java.lang.String getName()
setName(String)
public static boolean isValid(MediaObject object)
object
- can be nullpublic void setVisibility(CAContentCore.Visibility visibility)
visibility
- getVisibility()
public CAContentCore.Visibility getVisibility()
setVisibility(service.tut.pori.contentanalysis.CAContentCore.Visibility)
public java.lang.Integer getVisibilityValue()
getVisibility()
public java.util.Date getUpdated()
public void setUpdated(java.util.Date updated)
updated
- the updated to setpublic void setVisualShapeTypeId(java.lang.Integer type) throws java.lang.IllegalArgumentException
setVisualShapeTypeId
in interface VisualShape.VisualShapeSolrCapable
java.lang.IllegalArgumentException
- on bad type valueVisualShape.VisualShapeSolrCapable.getVisualShapeTypeId()
public java.lang.Integer getVisualShapeTypeId()
getVisualShapeTypeId
in interface VisualShape.VisualShapeSolrCapable
VisualShape.VisualShapeSolrCapable.getVisualShapeTypeId()
public void setVisualShapeValue(java.lang.String value)
setVisualShapeValue
in interface VisualShape.VisualShapeSolrCapable
VisualShape.VisualShapeSolrCapable.getVisualShapeValue()
public java.lang.String getVisualShapeValue()
getVisualShapeValue
in interface VisualShape.VisualShapeSolrCapable
VisualShape.VisualShapeSolrCapable.setVisualShapeValue(String)
public java.lang.Integer getRank()
setRank(Integer)
public void setRank(java.lang.Integer rank)
rank
- the rank to setgetRank()
public MediaUrlValidator.MediaType getMediaType()
public void setMediaType(MediaUrlValidator.MediaType mediaType)
mediaType
- the mediaType to setpublic java.lang.Integer getMediaTypeValue()
getMediaType()
public TimecodeList getTimecodes()
public void setSolrTimecodes(java.util.List<java.lang.String> timecodes)
timecodes
- the timecodes to set in SolrJ format.public java.util.List<java.lang.String> getSolrTimecodes()
public void setTimecodes(TimecodeList timecodes)
timecodes
- the timecodes to setCopyright © 2015 Tampere University of Technology, Pori Department.