Coalevo Logo

net.coalevo.discussion.service
Interface DiscussionService

All Superinterfaces:
Identifiable, Maintainable, Service

public interface DiscussionService
extends Service, Maintainable

Defines the discussion service.

Version:
1.0.0 (10/02/2009)
Author:
Dieter Wimberger (wimpi)

Field Summary
 
Fields inherited from interface net.coalevo.foundation.model.Maintainable
DO_MAINTENANCE
 
Method Summary
 void assignForumModerator(Agent caller, ForumIdentifier fid, AgentIdentifier aid)
          Assigns the forum moderator of a given forum.
 EditableEntry beginAnonymousEntryCreate(Agent caller, ForumIdentifier fid)
          Begin to create a new anonymous entry.
 EditableEntry beginEntryCreate(Agent caller, ForumIdentifier fid)
          Begin to create a new entry.
 EditableForumDescriptor beginForumCreate(Agent caller)
          Returns an editable forum descriptor for creation.
 EditableLink beginLinkCreate(Agent caller, ForumIdentifier fid)
          Begin to create a new Link.
 EditableEntry beginOfficialEntryCreate(Agent caller, ForumIdentifier fid)
          Begin to create a new official entry.
 Subscription beginSubscriptionCreate(Agent caller, ForumIdentifier fid, AgentIdentifier aid)
          Returns a Subscription for subscription.
 void cancelEntryCreate(Agent caller, EditableEntry ee)
          Cancel the creation of a new entry.
 void cancelForumCreate(Agent caller, EditableForumDescriptor efd)
          Cancels a forum creation.
 void cancelLinkCreate(Agent caller, EditableLink el)
          Cancel the creation of a new Link.
 void cancelSubscription(Agent caller, ForumIdentifier fid, AgentIdentifier aid)
          Cancels the subscription of an agent.
 void commitEntry(Agent caller, EditableEntry entry)
          Commits a new entry.
 void commitForum(Agent caller, EditableForumDescriptor efd)
          Commits a forum creation.
 void commitLink(Agent caller, EditableLink link)
          Commits a new Link.
 void commitSubscription(Agent caller, Subscription s)
          Commits a Subscription.
 void destroyForum(Agent caller, ForumIdentifier fid)
          Destroys a forum and all its related information.
 Content getEntryContent(Agent caller, ForumIdentifier fid, java.lang.String id)
          Returns the actual Content of a given entry or comment.
 int getEntryCount(Agent caller, ForumIdentifier fid)
          Returns the number of active entries in the given forum.
 EntryDescriptor getEntryDescriptor(Agent caller, ForumIdentifier fid, java.lang.String id)
          Returns the EntryDescriptor of a given entry.
 ForumDescriptor getForumDescriptor(Agent caller, ForumIdentifier fid)
          Returns a forum descriptor by its identifier.
 ForumDescriptor getForumDescriptorByMnemonic(Agent caller, java.lang.String mnemonic)
          Returns a forum descriptor by mnemonic.
 ForumDescriptor getForumDescriptorByName(Agent caller, java.lang.String name)
          Returns a forum descriptor by name.
 ForumDescriptor getForumDescriptorBySequenceNumber(Agent caller, int seqnum)
          Returns a ForumDescriptor by sequence number.
 Content getForumInfo(Agent caller, ForumIdentifier fid)
          Returns the forum info of a given forum.
 Link getLink(Agent caller, ForumIdentifier fid, java.lang.String id)
          Returns a Link for the given identifier.
 int getLinkCount(Agent caller, ForumIdentifier fid)
          Returns the number of links in a given forum.
 int getNewEntryCount(Agent caller, ForumIdentifier fid, long timestamp)
          Returns the number of new entries in a specific forum.
 Subscription getSubscription(Agent caller, ForumIdentifier fid, AgentIdentifier aid)
           
 boolean hasNewEntries(Agent caller, ForumIdentifier fid, long timestamp)
          Checks if the discussion service has a new entry.
 boolean isBanned(Agent caller, ForumIdentifier fid, AgentIdentifier aid)
          Tests if a given agent is banned.
 boolean isInviteOnly(Agent caller, ForumIdentifier fid)
          Tests if a given forum is invite only.
 boolean isSubscribed(Agent caller, ForumIdentifier fid, AgentIdentifier aid)
          Tests if a given agent is subscribed.
 java.util.List<java.lang.String> listEntries(Agent caller, ForumIdentifier fid)
          Lists the entries in a given forum.
 java.util.List<java.lang.String> listEntries(Agent caller, ForumIdentifier fid, int numentries)
          Lists a given number of entries in a given forum.
 java.util.List<java.lang.String> listEntriesFrom(Agent caller, ForumIdentifier fid, long timestamp)
          Lists the entries in a given forum from the given timestamp.
 java.util.List<ForumDescriptor> listFora(Agent caller)
          Lists the existing foras.
 java.util.List<java.lang.String> listForaMnemonics(Agent caller)
          Lists all forum mnemonics.
 java.util.List<java.lang.String> listForaNames(Agent caller)
          Lists all forum names.
 java.util.List<ForumIdentifier> listForaWithNewEntries(Agent caller, long timestamp)
          Lists all fora with new entries from a given timestamp.
 java.util.List<java.lang.String> listLinks(Agent caller, ForumIdentifier fid)
          Returns the links by identifier in a given forum.
 java.util.List<ForumDescriptor> listPublicFora(Agent caller)
          Lists existing public foras.
 java.util.List<AgentIdentifier> listSubscribers(Agent caller, ForumIdentifier fid)
          Lists all the subscribers of a given forum.
 java.util.List<ForumIdentifier> listSubscriptions(Agent caller, AgentIdentifier aid)
           
 void rebuildEntryIndex(Agent caller)
          Rebuilds the entry index.
 void removeEntry(Agent caller, ForumIdentifier fid, java.lang.String id)
          Removes an entry.
 void removeLink(Agent caller, ForumIdentifier fid, java.lang.String id)
          Removes a Link from a given forum.
 java.util.List<java.lang.String> resolveIdentifiers(Agent caller, java.util.List<ForumIdentifier> list, boolean names)
           
 java.util.List<EntryHit> searchEntries(Agent caller, java.lang.String query, int numhits)
          Searches for Entries with a given lucene query.
 void updateEntryIndex(Agent caller)
          Updates the entry index with entries added after the last index modification.
 void updateSubscription(Agent caller, Subscription s)
          Tracks a subscription update and ensures that notification is updated.
 
Methods inherited from interface net.coalevo.foundation.model.Service
activate, deactivate, getActions
 
Methods inherited from interface net.coalevo.foundation.model.Identifiable
getIdentifier
 
Methods inherited from interface net.coalevo.foundation.model.Maintainable
doMaintenance
 

Method Detail

beginForumCreate

EditableForumDescriptor beginForumCreate(Agent caller)
                                         throws java.lang.SecurityException
Returns an editable forum descriptor for creation.

This method should be followed by commitForum(Agent,EditableForumDescriptor) to commit the update (transaction style).

Parameters:
caller - the requesting Agent.
Returns:
an EditableForumDescriptor
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
See Also:
commitForum(Agent,EditableForumDescriptor)

cancelForumCreate

void cancelForumCreate(Agent caller,
                       EditableForumDescriptor efd)
                       throws java.lang.SecurityException,
                              java.lang.IllegalStateException
Cancels a forum creation.

This method should be preceded by beginForumCreate(Agent) to begin a create (transaction style).

Parameters:
caller - the requesting Agent.
efd - an EditableForumDescriptor.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
java.lang.IllegalStateException - if the transaction was not started by beginForumCreate(Agent).
See Also:
beginForumCreate(Agent)

commitForum

void commitForum(Agent caller,
                 EditableForumDescriptor efd)
                 throws java.lang.SecurityException,
                        java.lang.IllegalStateException,
                        DiscussionServiceException
Commits a forum creation.

This method should be preceded by beginForumCreate(Agent) to begin a create (transaction style).

Parameters:
caller - the requesting Agent.
efd - an EditableForumDescriptor.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
java.lang.IllegalStateException - if the transaction was not started by beginForumCreate(Agent).
DiscussionServiceException - if an error occurs while executing this action.
See Also:
beginForumCreate(Agent)

getForumDescriptor

ForumDescriptor getForumDescriptor(Agent caller,
                                   ForumIdentifier fid)
                                   throws java.lang.SecurityException,
                                          NoSuchForumException
Returns a forum descriptor by its identifier.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
a ForumDescriptor.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
NoSuchForumException - if a forum with the given name does not exist.

getForumDescriptorBySequenceNumber

ForumDescriptor getForumDescriptorBySequenceNumber(Agent caller,
                                                   int seqnum)
                                                   throws java.lang.SecurityException,
                                                          NoSuchForumException
Returns a ForumDescriptor by sequence number.

Parameters:
caller - the requesting Agent.
seqnum - a forum sequence number.
Returns:
a ForumDescriptor.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
NoSuchForumException - if a forum with the given name does not exist.

getForumDescriptorByName

ForumDescriptor getForumDescriptorByName(Agent caller,
                                         java.lang.String name)
                                         throws java.lang.SecurityException,
                                                NoSuchForumException
Returns a forum descriptor by name.

Parameters:
caller - the requesting Agent.
name - a forum name.
Returns:
a ForumDescriptor.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
NoSuchForumException - if a forum with the given name does not exist.

getForumDescriptorByMnemonic

ForumDescriptor getForumDescriptorByMnemonic(Agent caller,
                                             java.lang.String mnemonic)
                                             throws java.lang.SecurityException,
                                                    NoSuchForumException
Returns a forum descriptor by mnemonic.

Parameters:
caller - the requesting Agent.
mnemonic - a forum mnemonic.
Returns:
a ForumDescriptor.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
NoSuchForumException - if a forum with the given name does not exist.

resolveIdentifiers

java.util.List<java.lang.String> resolveIdentifiers(Agent caller,
                                                    java.util.List<ForumIdentifier> list,
                                                    boolean names)
Parameters:
caller - the requesting Agent.
list - a List of ForumIdentifier instances.
names - true if resolve to names, false if to mnemonics.
Returns:
a List of string instances, either names or mnemonics.

listFora

java.util.List<ForumDescriptor> listFora(Agent caller)
                                         throws java.lang.SecurityException
Lists the existing foras.

Parameters:
caller - the requesting Agent.
Returns:
a List of ForumDescriptor instances.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

listPublicFora

java.util.List<ForumDescriptor> listPublicFora(Agent caller)
                                               throws java.lang.SecurityException
Lists existing public foras.

Parameters:
caller - the requesting Agent.
Returns:
a List of ForumDescriptor instances.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

listForaNames

java.util.List<java.lang.String> listForaNames(Agent caller)
Lists all forum names.

Parameters:
caller - the requesting Agent.
Returns:
a List of String instances.

listForaMnemonics

java.util.List<java.lang.String> listForaMnemonics(Agent caller)
Lists all forum mnemonics.

Parameters:
caller - the requesting Agent.
Returns:
a List of String instances.

listForaWithNewEntries

java.util.List<ForumIdentifier> listForaWithNewEntries(Agent caller,
                                                       long timestamp)
                                                       throws java.lang.SecurityException,
                                                              DiscussionServiceException
Lists all fora with new entries from a given timestamp.

Parameters:
caller - the requesting Agent.
timestamp - the timestamp as long millis from UTC.
Returns:
a List of ForumIdentifier instances.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

destroyForum

void destroyForum(Agent caller,
                  ForumIdentifier fid)
                  throws java.lang.SecurityException,
                         DiscussionServiceException
Destroys a forum and all its related information.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

assignForumModerator

void assignForumModerator(Agent caller,
                          ForumIdentifier fid,
                          AgentIdentifier aid)
                          throws java.lang.SecurityException,
                                 DiscussionServiceException,
                                 NoSuchForumException
Assigns the forum moderator of a given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
aid - the AgentIdentifier of the moderator.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.
NoSuchForumException - if a forum with the given name does not exist.

getForumInfo

Content getForumInfo(Agent caller,
                     ForumIdentifier fid)
                     throws java.lang.SecurityException
Returns the forum info of a given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
the forum info as Content.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

listSubscribers

java.util.List<AgentIdentifier> listSubscribers(Agent caller,
                                                ForumIdentifier fid)
                                                throws java.lang.SecurityException
Lists all the subscribers of a given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
a List of AgentIdentifier instances.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

listSubscriptions

java.util.List<ForumIdentifier> listSubscriptions(Agent caller,
                                                  AgentIdentifier aid)
                                                  throws java.lang.SecurityException,
                                                         DiscussionServiceException
Parameters:
caller - the requesting Agent.
aid - an AgentIdentifier.
Returns:
a List of ForumIdentifier instances.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

beginSubscriptionCreate

Subscription beginSubscriptionCreate(Agent caller,
                                     ForumIdentifier fid,
                                     AgentIdentifier aid)
                                     throws java.lang.SecurityException,
                                            BannedException
Returns a Subscription for subscription.

This method should be followed by commitSubscription(Agent,Subscription) to commit the update (transaction style).

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
aid - the banned Agent.
Returns:
a Subscription instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
BannedException - if the specified agent is banned.
See Also:
commitSubscription(Agent,Subscription)

commitSubscription

void commitSubscription(Agent caller,
                        Subscription s)
                        throws java.lang.SecurityException,
                               java.lang.IllegalStateException,
                               DiscussionServiceException
Commits a Subscription.

This method should be preceded by beginSubscriptionCreate(Agent,ForumIdentifier,AgentIdentifier) to begin acreate (transaction style).

Parameters:
caller - the requesting Agent.
s - a Subscription.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
java.lang.IllegalStateException - if the transaction was not started by beginSubscriptionCreate(Agent,ForumIdentifier,AgentIdentifier).
DiscussionServiceException - if an error occurs while executing this action.
See Also:
beginSubscriptionCreate(Agent,ForumIdentifier,AgentIdentifier)

getSubscription

Subscription getSubscription(Agent caller,
                             ForumIdentifier fid,
                             AgentIdentifier aid)
                             throws java.lang.SecurityException,
                                    DiscussionServiceException,
                                    NoSuchSubscriptionException
Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
aid - the banned Agent.
Returns:
a Subscription instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.
NoSuchSubscriptionException - if such a subscription does not exist.

updateSubscription

void updateSubscription(Agent caller,
                        Subscription s)
                        throws java.lang.SecurityException
Tracks a subscription update and ensures that notification is updated.

Parameters:
caller - the requesting Agent.
s - a Subscription.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

isSubscribed

boolean isSubscribed(Agent caller,
                     ForumIdentifier fid,
                     AgentIdentifier aid)
                     throws java.lang.SecurityException
Tests if a given agent is subscribed.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
aid - the identifier of an Agent.
Returns:
true if subscribed, false otherwise.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

cancelSubscription

void cancelSubscription(Agent caller,
                        ForumIdentifier fid,
                        AgentIdentifier aid)
                        throws java.lang.SecurityException,
                               DiscussionServiceException
Cancels the subscription of an agent.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
aid - the identifier of an Agent.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

isInviteOnly

boolean isInviteOnly(Agent caller,
                     ForumIdentifier fid)
                     throws NoSuchForumException
Tests if a given forum is invite only.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
true if inivteonly, false otherwise.
Throws:
NoSuchForumException - if such a forum does not exist.

isBanned

boolean isBanned(Agent caller,
                 ForumIdentifier fid,
                 AgentIdentifier aid)
                 throws java.lang.SecurityException
Tests if a given agent is banned.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
aid - the banned Agent.
Returns:
true if banned, false otherwise.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.

beginLinkCreate

EditableLink beginLinkCreate(Agent caller,
                             ForumIdentifier fid)
                             throws java.lang.SecurityException,
                                    BannedException,
                                    NotSubscribedException
Begin to create a new Link.

This method should be followed by commitLink(Agent,EditableLink) to commit the update (transaction style).

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
an EditableLink instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
BannedException - if the caller is banned.
NotSubscribedException - if the caller is not subscribed.
See Also:
commitLink(Agent,EditableLink)

cancelLinkCreate

void cancelLinkCreate(Agent caller,
                      EditableLink el)
                      throws java.lang.SecurityException
Cancel the creation of a new Link.

This method should be preceded by beginLinkCreate(Agent,ForumIdentifier) to begin the create (transaction style).

Parameters:
caller - the requesting Agent.
el - an EditableLink instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
See Also:
beginLinkCreate(Agent,ForumIdentifier)

commitLink

void commitLink(Agent caller,
                EditableLink link)
                throws java.lang.SecurityException,
                       java.lang.IllegalStateException,
                       DiscussionServiceException
Commits a new Link.

This method should be preceded by beginLinkCreate(Agent,ForumIdentifier) to begin an update (transaction style).

Parameters:
caller - the requesting Agent.
link - an EditableLink instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
java.lang.IllegalStateException - if the transaction was not started by beginLinkCreate(Agent,ForumIdentifier).
DiscussionServiceException - if an error occurs while executing this action.
See Also:
beginLinkCreate(Agent,ForumIdentifier)

getLink

Link getLink(Agent caller,
             ForumIdentifier fid,
             java.lang.String id)
             throws java.lang.SecurityException,
                    DiscussionServiceException
Returns a Link for the given identifier.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
id - the identifier of the link.
Returns:
link an Link instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

removeLink

void removeLink(Agent caller,
                ForumIdentifier fid,
                java.lang.String id)
                throws java.lang.SecurityException,
                       DiscussionServiceException
Removes a Link from a given forum.

This method is supposed to be used by the author of a Link to remove it him/herself.

Parameters:
caller - the requesting Agent.
id - the identifier of the entry.
fid - a ForumIdentifier.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

listLinks

java.util.List<java.lang.String> listLinks(Agent caller,
                                           ForumIdentifier fid)
                                           throws java.lang.SecurityException,
                                                  DiscussionServiceException
Returns the links by identifier in a given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
a List of Link instances.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

getLinkCount

int getLinkCount(Agent caller,
                 ForumIdentifier fid)
                 throws java.lang.SecurityException,
                        DiscussionServiceException
Returns the number of links in a given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
the number of links in the given forum.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

beginEntryCreate

EditableEntry beginEntryCreate(Agent caller,
                               ForumIdentifier fid)
                               throws java.lang.SecurityException,
                                      BannedException,
                                      NotSubscribedException
Begin to create a new entry.

This method should be followed by commitEntry(Agent,EditableEntry) to commit the create (transaction style).

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
an EditableEntry instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
BannedException - if the caller is banned.
NotSubscribedException - if the caller is not subscribed.
See Also:
commitEntry(Agent,EditableEntry)

beginOfficialEntryCreate

EditableEntry beginOfficialEntryCreate(Agent caller,
                                       ForumIdentifier fid)
                                       throws java.lang.SecurityException
Begin to create a new official entry.

This method should be followed by commitEntry(Agent,EditableEntry) to commit the create (transaction style).

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
an EditableEntry instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
See Also:
commitEntry(Agent,EditableEntry)

beginAnonymousEntryCreate

EditableEntry beginAnonymousEntryCreate(Agent caller,
                                        ForumIdentifier fid)
                                        throws java.lang.SecurityException,
                                               AnonymousNotAllowedException
Begin to create a new anonymous entry.

This method should be followed by commitEntry(Agent,EditableEntry) to commit the create (transaction style).

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
an EditableEntry instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
AnonymousNotAllowedException - if anonymous entries are not allowed in the specified forum.
See Also:
commitEntry(Agent,EditableEntry)

commitEntry

void commitEntry(Agent caller,
                 EditableEntry entry)
                 throws java.lang.SecurityException,
                        java.lang.IllegalStateException,
                        DiscussionServiceException
Commits a new entry.

This method should be preceded by beginEntryCreate(Agent,ForumIdentifier) to begin an update or beginOfficialEntryCreate(Agent,ForumIdentifier) to begin a create (transaction style).

Parameters:
caller - the requesting Agent.
entry - an EditableEntry.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
java.lang.IllegalStateException - if the transaction was not started either by beginEntryCreate(Agent,ForumIdentifier) or by beginOfficialEntryCreate(Agent,ForumIdentifier).
DiscussionServiceException - if an error occurs while executing this action.
See Also:
beginEntryCreate(Agent,ForumIdentifier), beginOfficialEntryCreate(Agent,ForumIdentifier)

cancelEntryCreate

void cancelEntryCreate(Agent caller,
                       EditableEntry ee)
                       throws java.lang.SecurityException
Cancel the creation of a new entry.

This method should be preceded by beginEntryCreate(Agent,ForumIdentifier) to begin the create (transaction style).

Parameters:
caller - the requesting Agent.
ee - an EditableEntry instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
See Also:
beginEntryCreate(Agent,ForumIdentifier)

removeEntry

void removeEntry(Agent caller,
                 ForumIdentifier fid,
                 java.lang.String id)
                 throws java.lang.SecurityException,
                        DiscussionServiceException
Removes an entry.

This method is supposed to be used by the author of an entry to remove it him/herself.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
id - the identifier of the entry.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

listEntries

java.util.List<java.lang.String> listEntries(Agent caller,
                                             ForumIdentifier fid)
                                             throws java.lang.SecurityException,
                                                    DiscussionServiceException
Lists the entries in a given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
a List of identifiers.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

listEntriesFrom

java.util.List<java.lang.String> listEntriesFrom(Agent caller,
                                                 ForumIdentifier fid,
                                                 long timestamp)
                                                 throws java.lang.SecurityException,
                                                        DiscussionServiceException
Lists the entries in a given forum from the given timestamp.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
timestamp - the timestamp of the last read message.
Returns:
a List of identifiers.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

listEntries

java.util.List<java.lang.String> listEntries(Agent caller,
                                             ForumIdentifier fid,
                                             int numentries)
                                             throws java.lang.SecurityException,
                                                    DiscussionServiceException
Lists a given number of entries in a given forum.

Note that the entries are ordered most recent first, and the number of entries returned is from the most recent backwards in approval time.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
numentries - the number of messages.
Returns:
a List of identifiers.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

searchEntries

java.util.List<EntryHit> searchEntries(Agent caller,
                                       java.lang.String query,
                                       int numhits)
                                       throws java.lang.SecurityException,
                                              DiscussionServiceException
Searches for Entries with a given lucene query.

Note that the search will always be restricted to the actually subscribed fora. Also the number of hits should be ranged to make sure you don't get too much hits. You may restrict the forum yourself to a single, as long as it is subscribed.

Parameters:
caller - the requesting Agent.
query - the query.
numhits - the number of max hits to be returned.
Returns:
A List of EntryHit instances identifying the hit.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

rebuildEntryIndex

void rebuildEntryIndex(Agent caller)
                       throws java.lang.SecurityException,
                              DiscussionServiceException
Rebuilds the entry index.

Parameters:
caller - the requesting Agent.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

updateEntryIndex

void updateEntryIndex(Agent caller)
                      throws java.lang.SecurityException,
                             DiscussionServiceException
Updates the entry index with entries added after the last index modification.

Parameters:
caller - the requesting Agent.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

getEntryCount

int getEntryCount(Agent caller,
                  ForumIdentifier fid)
                  throws java.lang.SecurityException,
                         DiscussionServiceException
Returns the number of active entries in the given forum.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
Returns:
number of active entries in the forum.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

hasNewEntries

boolean hasNewEntries(Agent caller,
                      ForumIdentifier fid,
                      long timestamp)
                      throws java.lang.SecurityException,
                             DiscussionServiceException
Checks if the discussion service has a new entry.

Parameters:
caller - the requesting Agent.
timestamp - long in millis UTC.
fid - a ForumIdentifier.
Returns:
true if there is any new entry, false otherwise.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

getNewEntryCount

int getNewEntryCount(Agent caller,
                     ForumIdentifier fid,
                     long timestamp)
                     throws java.lang.SecurityException,
                            DiscussionServiceException
Returns the number of new entries in a specific forum.

Note that this is a high cost operation compared to hasNewEntries(Agent,ForumIdentifier,long).

Parameters:
caller - the requesting Agent.
timestamp - long in millis UTC.
fid - a ForumIdentifier.
Returns:
the number of new entries in the given forum.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action.

getEntryDescriptor

EntryDescriptor getEntryDescriptor(Agent caller,
                                   ForumIdentifier fid,
                                   java.lang.String id)
                                   throws java.lang.SecurityException,
                                          DiscussionServiceException
Returns the EntryDescriptor of a given entry.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
id - the identifier of the entry.
Returns:
a EntryDescriptor instance.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action. not authorized.

getEntryContent

Content getEntryContent(Agent caller,
                        ForumIdentifier fid,
                        java.lang.String id)
                        throws java.lang.SecurityException,
                               DiscussionServiceException
Returns the actual Content of a given entry or comment.

Parameters:
caller - the requesting Agent.
fid - a ForumIdentifier.
id - the identifier of the entry.
Returns:
a Content instance to access the content.
Throws:
java.lang.SecurityException - if the calling Agent is not authentic or not authorized.
DiscussionServiceException - if an error occurs while executing this action. not authorized.

Coalevo Logo

(c) 2004-2009 VFI (http://www.vfi.or.at)