@Entity @Indexed(index="FullText") @ClassBridge(name="details", impl=DetailsFieldBridge.class, index=UN_TOKENIZED, store=NO) public class Session extends Object implements Serializable, IObject, IGlobal, IMutable, IAnnotated
Modifier and Type | Class and Description |
---|---|
static class |
Session.Details |
Modifier | Constructor and Description |
---|---|
|
Session() |
protected |
Session(Long id) |
|
Session(Long id,
boolean loaded)
Main constructor.
|
|
Session(Node _node,
String _uuid,
Experimenter _owner,
Long _timeToIdle,
Long _timeToLive,
Timestamp _started,
String _defaultEventType) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptFilter(Filter __filter) |
void |
addEvent(Event target)
use instead of setEvents .
|
void |
addEventSet(Collection<Event> targets)
use like addEvent.
|
void |
addSessionAnnotationLink(SessionAnnotationLink target)
use instead of setAnnotationLinks .
|
void |
addSessionAnnotationLink(SessionAnnotationLink link,
boolean bothSides)
Adds a ome.model.annotations.SessionAnnotationLink to annotationLinks, allowing for recursion -- whether
or not addSessionAnnotationLink will be called on the addition if it is loaded
|
void |
addSessionAnnotationLinkSet(Collection<SessionAnnotationLink> targets)
use like addSessionAnnotationLink.
|
void |
clearAnnotationLinks()
clears the set.
|
void |
clearEvents()
clears the set.
|
<E> List<E> |
collectAnnotationLinks(CBlock<E> block)
takes a CBlock and calls the block once for each ome.model.annotations.SessionAnnotationLink while
collecting the results.
|
<E> List<E> |
collectEvents(CBlock<E> block)
takes a CBlock and calls the block once for each ome.model.meta.Event while
collecting the results.
|
<E> List<E> |
eachLinkedAnnotation(CBlock<E> block)
takes a CBlock and calls the block once for each ome.model.annotations.Annotation while
collecting the results.
|
protected void |
errorIfUnloaded() |
Set<String> |
fields()
returns a Set of field names that belong to this class
|
Set<SessionAnnotationLink> |
findSessionAnnotationLink(Annotation target)
find all ome.model.annotations.SessionAnnotationLink which have the argument as their child.
|
protected Set<SessionAnnotationLink> |
getAnnotationLinks()
returns annotationLinks .
|
Map<Long,Long> |
getAnnotationLinksCountPerOwner()
If fetched, returns the count(*) of ome.model.annotations.SessionAnnotationLink that a user has.
|
Timestamp |
getClosed()
Simple field ome.model.meta.Session.closed (java.sql.Timestamp)
|
String |
getDefaultEventType()
Simple field ome.model.meta.Session.defaultEventType (java.lang.String)
|
Details |
getDetails()
The details of this object correspond to low-level system
information.
|
protected Set<Event> |
getEvents()
returns events .
|
GraphHolder |
getGraphHolder()
retrieves the
GraphHolder for this entity. |
Long |
getId()
The DB unique identifier for this object.
|
String |
getMessage()
Simple field ome.model.meta.Session.message (java.lang.String)
|
Node |
getNode()
Many-to-one field ome.model.meta.Session.node (ome.model.meta.Node)
|
Experimenter |
getOwner()
Many-to-one field ome.model.meta.Session.owner (ome.model.meta.Experimenter)
|
Timestamp |
getStarted()
Simple field ome.model.meta.Session.started (java.sql.Timestamp)
|
Long |
getTimeToIdle()
Simple field ome.model.meta.Session.timeToIdle (java.lang.Long)
|
Long |
getTimeToLive()
Simple field ome.model.meta.Session.timeToLive (java.lang.Long)
|
String |
getUserAgent()
Simple field ome.model.meta.Session.userAgent (java.lang.String)
|
String |
getUserIP()
Simple field ome.model.meta.Session.userIP (java.lang.String)
|
String |
getUuid()
Simple field ome.model.meta.Session.uuid (java.lang.String)
|
Integer |
getVersion()
This version number is controlled by the database for optimisitic
locking.
|
boolean |
isLoaded()
transient field (not stored in the DB) which specifies whether this
object has been loaded from the DB or is only a wrapper around the ID.
|
boolean |
isValid()
calls the class-specific validator for this instance and returns the
value from
Validation.isValid() |
Iterator<SessionAnnotationLink> |
iterateAnnotationLinks()
should be used rather than accessing the annotationLinks set directly.
|
Iterator<Event> |
iterateEvents()
should be used rather than accessing the events set directly.
|
SessionAnnotationLink |
linkAnnotation(Annotation addition)
Adds a ome.model.annotations.SessionAnnotationLink to annotationLinks .
|
Iterator<Annotation> |
linkedAnnotationIterator()
provides an iterator over the parent values of the annotationLinks.
|
List<Annotation> |
linkedAnnotationList()
produces a
List -copy of the underlying collection. |
Session |
newInstance() |
Session |
proxy() |
void |
putAt(String field,
Object value)
stores a value in this instance.
|
void |
removeEvent(Event target)
removes a single element from this set and makes the inverse call on ome.model.meta.Event
|
void |
removeEventSet(Collection<Event> targets)
use like removeEvent
|
void |
removeSessionAnnotationLink(SessionAnnotationLink target)
removes a single element from this set and makes the inverse call on ome.model.annotations.SessionAnnotationLink
|
void |
removeSessionAnnotationLink(SessionAnnotationLink link,
boolean bothSides)
removes the given SessionAnnotationLink from annotationLinks, allowing for recursion -- whether
or not the removal will call unlinkSession again if loaded.
|
void |
removeSessionAnnotationLinkSet(Collection<SessionAnnotationLink> targets)
use like removeSessionAnnotationLink
|
Object |
retrieve(String field)
retrieves a value from this instance.
|
protected void |
setAnnotationLinks(Set<SessionAnnotationLink> annotationLinks)
setter for annotationLinks should be avoided.
|
protected void |
setAnnotationLinksCountPerOwner(Map<Long,Long> map) |
void |
setClosed(Timestamp closed) |
void |
setDefaultEventType(String defaultEventType) |
protected void |
setDetails(Details details)
Use the
Details.copy(ome.model.internal.Details)
or Details.shallowCopy(ome.model.internal.Details)
methods to set the Session.Details instance instead. |
protected void |
setEvents(Set<Event> events)
setter for events should be avoided.
|
void |
setId(Long id)
usually unneeded.
|
void |
setMessage(String message) |
void |
setNode(Node node) |
void |
setOwner(Experimenter owner) |
void |
setStarted(Timestamp started) |
void |
setTimeToIdle(Long timeToIdle) |
void |
setTimeToLive(Long timeToLive) |
void |
setUserAgent(String userAgent) |
void |
setUserIP(String userIP) |
void |
setUuid(String uuid) |
void |
setVersion(Integer version)
use with caution.
|
int |
sizeOfAnnotationLinks()
returns the size of annotationLinks.
|
int |
sizeOfEvents()
returns the size of events.
|
protected void |
throwNullCollectionException(String propertyName) |
String |
toString() |
void |
unlinkAnnotation(Annotation removal)
unlinks all ome.model.annotations.Annotation instances from this instance.
|
void |
unload()
set the loaded field to false, and set all non-ID fields to null.
|
Collection<SessionAnnotationLink> |
unmodifiableAnnotationLinks()
Returns an unmodifiable collection-view
|
Collection<Event> |
unmodifiableEvents()
Returns an unmodifiable collection-view
|
Validation |
validate()
calls the class-specific validator for this instance and returns the
Validation object. |
public static final String ID
protected Long id
public static final String VERSION
protected Integer version
protected Node node
protected String uuid
protected Experimenter owner
protected Long timeToIdle
protected Long timeToLive
protected Timestamp started
protected Timestamp closed
protected String message
protected String defaultEventType
protected String userAgent
protected String userIP
protected Set<SessionAnnotationLink> annotationLinks
public static final String OWNER_FILTER_ANNOTATIONLINKS
public static final String GROUP_FILTER_ANNOTATIONLINKS
public static final String EVENT_FILTER_ANNOTATIONLINKS
public static final String PERMS_FILTER_ANNOTATIONLINKS
protected Details details
public static final String NODE
public static final String UUID
public static final String OWNER
public static final String TIMETOIDLE
public static final String TIMETOLIVE
public static final String STARTED
public static final String CLOSED
public static final String MESSAGE
public static final String DEFAULTEVENTTYPE
public static final String USERAGENT
public static final String USERIP
public static final String EVENTS
public static final String ANNOTATIONLINKSCOUNTPEROWNER
public static final String ANNOTATIONLINKS
public static final String DETAILS
protected boolean _loaded
public Session()
protected Session(Long id)
public Session(Long id, boolean loaded)
@DocumentId public Long getId()
public void setId(Long id)
IObject
public Integer getVersion()
getVersion
in interface IMutable
public void setVersion(Integer version)
IMutable
setVersion
in interface IMutable
version
- Value for this objects version.public Node getNode()
public void setNode(Node node)
@Fields(value={@Field(index=TOKENIZED),@Field(index=TOKENIZED,name="combined_fields")}) public String getUuid()
public void setUuid(String uuid)
public Experimenter getOwner()
public void setOwner(Experimenter owner)
@Fields(value={@Field(index=UN_TOKENIZED),@Field(index=UN_TOKENIZED,name="combined_fields")}) public Long getTimeToIdle()
public void setTimeToIdle(Long timeToIdle)
@Fields(value={@Field(index=UN_TOKENIZED),@Field(index=UN_TOKENIZED,name="combined_fields")}) public Long getTimeToLive()
public void setTimeToLive(Long timeToLive)
@DateBridge(resolution=MINUTE) @Fields(value={@Field(index=UN_TOKENIZED),@Field(index=UN_TOKENIZED,name="combined_fields")}) public Timestamp getStarted()
public void setStarted(Timestamp started)
@DateBridge(resolution=MINUTE) @Fields(value={@Field(index=UN_TOKENIZED),@Field(index=UN_TOKENIZED,name="combined_fields")}) public Timestamp getClosed()
public void setClosed(Timestamp closed)
@Fields(value={@Field(index=TOKENIZED),@Field(index=TOKENIZED,name="combined_fields")}) public String getMessage()
public void setMessage(String message)
@Fields(value={@Field(index=TOKENIZED),@Field(index=TOKENIZED,name="combined_fields")}) public String getDefaultEventType()
public void setDefaultEventType(String defaultEventType)
@Fields(value={@Field(index=TOKENIZED),@Field(index=TOKENIZED,name="combined_fields")}) public String getUserAgent()
public void setUserAgent(String userAgent)
@Fields(value={@Field(index=TOKENIZED),@Field(index=TOKENIZED,name="combined_fields")}) public String getUserIP()
public void setUserIP(String userIP)
protected Set<Event> getEvents()
protected void setEvents(Set<Event> events)
public int sizeOfEvents()
public Iterator<Event> iterateEvents()
EmptyIterator
. To test for a null collection,
see of sizeOfEvents()
is less than zero.public Collection<Event> unmodifiableEvents()
public <E> List<E> collectEvents(CBlock<E> block)
block == null
, then the
iterator values themselves are collected. This method uses
iterateEvents()
internally and so will return a value
even if the underlying collection is null.public void addEvent(Event target)
public void addEventSet(Collection<Event> targets)
public void removeEvent(Event target)
public void removeEventSet(Collection<Event> targets)
public void clearEvents()
protected Set<SessionAnnotationLink> getAnnotationLinks()
protected void setAnnotationLinks(Set<SessionAnnotationLink> annotationLinks)
public int sizeOfAnnotationLinks()
sizeOfAnnotationLinks
in interface IAnnotated
public Iterator<SessionAnnotationLink> iterateAnnotationLinks()
EmptyIterator
. To test for a null collection,
see of sizeOfAnnotationLinks()
is less than zero.iterateAnnotationLinks
in interface IAnnotated
public Collection<SessionAnnotationLink> unmodifiableAnnotationLinks()
unmodifiableAnnotationLinks
in interface IAnnotated
public <E> List<E> collectAnnotationLinks(CBlock<E> block)
block == null
, then the
iterator values themselves are collected. This method uses
iterateAnnotationLinks()
internally and so will return a value
even if the underlying collection is null.collectAnnotationLinks
in interface IAnnotated
public void addSessionAnnotationLink(SessionAnnotationLink target)
public void addSessionAnnotationLinkSet(Collection<SessionAnnotationLink> targets)
public void removeSessionAnnotationLink(SessionAnnotationLink target)
public void removeSessionAnnotationLinkSet(Collection<SessionAnnotationLink> targets)
public SessionAnnotationLink linkAnnotation(Annotation addition)
linkAnnotation
in interface IAnnotated
public void addSessionAnnotationLink(SessionAnnotationLink link, boolean bothSides)
public Iterator<Annotation> linkedAnnotationIterator()
ConcurrentModificationException
.
Use linkedAnnotationList()
instead.linkedAnnotationIterator
in interface IAnnotated
public Set<SessionAnnotationLink> findSessionAnnotationLink(Annotation target)
public List<Annotation> linkedAnnotationList()
List
-copy of the underlying collection. Unlike,
linkedAnnotationIterator()
, while using the returned List
,
modifications can be made to the underlying collection without throwing
ConcurrentModificationException
.linkedAnnotationList
in interface IAnnotated
public <E> List<E> eachLinkedAnnotation(CBlock<E> block)
block == null
, then the
iterator values themselves are collected.eachLinkedAnnotation
in interface IAnnotated
public void unlinkAnnotation(Annotation removal)
unlinkAnnotation
in interface IAnnotated
public void removeSessionAnnotationLink(SessionAnnotationLink link, boolean bothSides)
public void clearAnnotationLinks()
clearAnnotationLinks
in interface IAnnotated
public Map<Long,Long> getAnnotationLinksCountPerOwner()
public Details getDetails()
Details
type.getDetails
in interface IObject
protected void setDetails(Details details)
Details.copy(ome.model.internal.Details)
or Details.shallowCopy(ome.model.internal.Details)
methods to set the Session.Details
instance instead.public boolean isValid()
IObject
Validation.isValid()
public Validation validate()
IObject
Validation
object.public Session newInstance()
public Session proxy()
public boolean acceptFilter(Filter __filter)
acceptFilter
in interface Filterable
public Set<String> fields()
IObject
public Object retrieve(String field)
IObject
field
which match a field of this instance will be delegated to the accessors.
Otherwise, values will be retrieved from a lazy-loaded map filled by
calls to IObject.putAt(String, Object)
public void putAt(String field, Object value)
IObject
field
which
match a field of this instance will be delegated to the accessors.
Otherwise, values will be stored in a lazy-loaded map.public boolean isLoaded()
IObject
protected void errorIfUnloaded()
public void unload()
IObject
public final GraphHolder getGraphHolder()
IObject
GraphHolder
for this entity. If the GraphHolder has
not been actively set, a new one will be instatiated.getGraphHolder
in interface IObject
protected void throwNullCollectionException(String propertyName)
Version: 5.1.3-ice35-b52
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.