de.bea.domingo.proxy
Class AgentContextProxy

java.lang.Object
  extended by de.bea.domingo.monitor.AbstractMonitorEnabled
      extended by de.bea.domingo.proxy.BaseProxy
          extended by de.bea.domingo.proxy.AgentContextProxy
All Implemented Interfaces:
DAgentContext, DBase, MonitorEnabled, java.io.Serializable

public final class AgentContextProxy
extends BaseProxy
implements DAgentContext

Represents the agent environment of the current program, if an agent is running it.

Author:
Kurt Riede
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.bea.domingo.proxy.BaseProxy
BaseProxy.DocumentCollectionIterator
 
Field Summary
 
Fields inherited from class de.bea.domingo.proxy.BaseProxy
DATETIME_STRING_LENGTH, EMPTY_STRING, MAX_DATETIME_LENGTH, NUM_DATETIME_VALUES, RESOURCES
 
Method Summary
 DAgent getCurrentAgent()
          The agent that's currently running.
 DDatabase getCurrentDatabase()
          The database in which the current agent resides.
 DDocument getDocumentContext()
          The in-memory document when an agent starts.
 java.lang.String getEffectiveUserName()
          The user name that is in effect for the current agent.
static DAgentContext getInstance(NotesProxyFactory theFactory, SessionProxy session, lotus.domino.AgentContext theAgentContext, DNotesMonitor monitor)
          Factory method for instances of this class.
 int getLastExitStatus()
          The exit status code returned by the Agent Manager the last time the current agent ran.
 java.util.Calendar getLastRun()
          The date and time when the current agent was last executed.
 DDocument getSavedData()
          A document that an agent uses to store information between invocations.
 java.util.Iterator getUnprocessedDocuments()
          The documents in a database that the current agent considers to be unprocessed.
 java.lang.String toString()
          Returns a short description of an instance.
 java.util.Iterator unprocessedFTSearch(java.lang.String query, int maxDocs)
          Performs a full-text search within the unprocessed documents.
 java.util.Iterator unprocessedFTSearch(java.lang.String query, int maxDocs, int sortOpt, int otherOpt)
          Performs a full-text search within the unprocessed documents.
 java.util.Iterator unprocessedSearch(java.lang.String query, java.util.Calendar dateTime, int maxDocs)
          Searches for unprocessed documents which were created or modified since the cutoff date.
 void updateProcessedDoc(DDocument document)
          Marks a given document as processed.
 
Methods inherited from class de.bea.domingo.proxy.BaseProxy
checkSession, clearNotesObject, convertCalendarsToNotesDateTime, convertListToVector, convertNotesDateTimesToCalendar, convertVectorToList, createCalendar, createDateRange, createDateTime, decrementDateTimeCounter, finalize, getCountDateTime, getDSession, getFactory, getNotesObject, getParent, incrementDateTimeCounter, newException, newException, newException, newRuntimeException, newRuntimeException, newRuntimeException, recycleDateTimeList, refereceHashCode, toStringGeneric, toStringIntern
 
Methods inherited from class de.bea.domingo.monitor.AbstractMonitorEnabled
getMonitor, setMonitor
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.bea.domingo.DBase
equals, hashCode
 

Method Detail

getInstance

public static DAgentContext getInstance(NotesProxyFactory theFactory,
                                        SessionProxy session,
                                        lotus.domino.AgentContext theAgentContext,
                                        DNotesMonitor monitor)
Factory method for instances of this class.

Parameters:
theFactory - the controlling factory
session - the session that produced the database
theAgentContext - Notes agent context object
monitor - the monitor that handles logging
Returns:
Returns instance of DAgentContext

updateProcessedDoc

public void updateProcessedDoc(DDocument document)
Marks a given document as processed.

Specified by:
updateProcessedDoc in interface DAgentContext
Parameters:
document - a document
See Also:
DAgentContext.updateProcessedDoc(de.bea.domingo.DDocument)

unprocessedFTSearch

public java.util.Iterator unprocessedFTSearch(java.lang.String query,
                                              int maxDocs)
Performs a full-text search within the unprocessed documents.

Specified by:
unprocessedFTSearch in interface DAgentContext
Parameters:
query - The full-text query
maxDocs - The maximum number of documents you want returned; 0 means all matching documents
Returns:
An interator of documents that are not yet processed and match the query
See Also:
DAgentContext.unprocessedFTSearch(java.lang.String, int)

unprocessedFTSearch

public java.util.Iterator unprocessedFTSearch(java.lang.String query,
                                              int maxDocs,
                                              int sortOpt,
                                              int otherOpt)
Performs a full-text search within the unprocessed documents.
sortOpt
Use one of the following to specify a sorting option:
  • Database.FT_SCORES (default) sorts by relevance score with highest relevance first.
  • Database.FT_DATECREATED_DES sorts by document creation date in descending order.
  • Database.FT_DATECREATED_ASC sorts by document creation date in ascending order.
  • Database.FT_DATE_DES sorts by document date in descending order.
  • Database.FT_DATE_ASC sorts by document date in ascending order.
otherOpt
Use the following constants to specify additional search options. To specify more than one option, use a logical OR operation:
  • Database.FT_DATABASE includes Lotus Domino databases in the search scope.
  • Database.FT_FILESYSTEM includes files other than Lotus Domino databases in the search scope.
  • Database.FT_FUZZY specifies a fuzzy search.
  • Database.FT_STEMS uses stem words as the basis of the search.

Specified by:
unprocessedFTSearch in interface DAgentContext
Parameters:
query - The full-text query
maxDocs - The maximum number of documents you want returned; 0 means all matching documents
sortOpt - sorting options
otherOpt - other options
Returns:
An iterator of documents that are not yet processed and match the query
See Also:
DAgentContext.unprocessedFTSearch(java.lang.String, int, int, int)

unprocessedSearch

public java.util.Iterator unprocessedSearch(java.lang.String query,
                                            java.util.Calendar dateTime,
                                            int maxDocs)
Searches for unprocessed documents which were created or modified since the cutoff date. The resulting collection is sorted by relevance with highest relevance first.

Specified by:
unprocessedSearch in interface DAgentContext
Parameters:
query - A Lotus Domino formula that defines the selection criteria
dateTime - A cutoff date
maxDocs - The maximum number of documents you want returned; 0 means all matching documents
Returns:
An iteratorof documents that are not yet processed, match the selection criteria, and were created or modified after the cutoff date.
See Also:
DAgentContext.unprocessedSearch(java.lang.String, java.util.Calendar, int)

getEffectiveUserName

public java.lang.String getEffectiveUserName()
The user name that is in effect for the current agent. In general, getEffectiveUserName and DSession.getUserName()return the same value for a given program. The exceptions are agents that run on a server, where getEffectiveUserName is the name of the script's owner and getUserName is the name of the server on which the script is running. If the user name is hierarchical, this property returns the fully distinguished name.

Specified by:
getEffectiveUserName in interface DAgentContext
Returns:
effective user name
See Also:
DAgentContext.getEffectiveUserName()

getCurrentAgent

public DAgent getCurrentAgent()
The agent that's currently running.

Specified by:
getCurrentAgent in interface DAgentContext
Returns:
current agent
See Also:
DAgentContext.getCurrentAgent()

getCurrentDatabase

public DDatabase getCurrentDatabase()
The database in which the current agent resides.

Specified by:
getCurrentDatabase in interface DAgentContext
Returns:
current database
See Also:
DAgentContext.getCurrentDatabase()

getDocumentContext

public DDocument getDocumentContext()
The in-memory document when an agent starts. Usage
For an agent activated in a view through the Notes client UI, the in-memory document is the document highlighted in the view. For an agent run from a browser with the OpenAgent URL command, the in-memory document is a new document containing an item for each CGI (Common Gateway Interface) variable supported by Lotus Domino. Each item has the name and current value of a supported CGI variable. (No design work on your part is needed; the CGI variables are available automatically.) For an agent run from a browser with Command([RunAgent]) or Command[ToolsRunMacro], the in-memory document is the current document. In the case of WebQueryOpen, this is the document before Lotus Domino converts it to HTML and sends it to the browser; in the case of WebQuerySave, this is the document before Lotus Domino saves it. If the form on which the document is based contains a field named the same as a Lotus Domino-supported CGI variable, the in-memory document also contains the value of that variable. (You must explicitly design the CGI variables into the form, for example, as hidden fields.). You cannot use the encrypt and remove methods on the Document object returned by getDocumentContext, nor use the compact method on the Database object that contains the Document object returned by getDocumentContext.

Specified by:
getDocumentContext in interface DAgentContext
Returns:
The in-memory document when an agent starts.
See Also:
DAgentContext.getDocumentContext()

getLastExitStatus

public int getLastExitStatus()
The exit status code returned by the Agent Manager the last time the current agent ran.

Specified by:
getLastExitStatus in interface DAgentContext
Returns:
last exit status
See Also:
DAgentContext.getLastExitStatus()

getLastRun

public java.util.Calendar getLastRun()
The date and time when the current agent was last executed.

Specified by:
getLastRun in interface DAgentContext
Returns:
date and time of last run
See Also:
DAgentContext.getLastRun()

getSavedData

public DDocument getSavedData()
A document that an agent uses to store information between invocations. The agent can use the information in this document the next time the agent runs.

Specified by:
getSavedData in interface DAgentContext
Returns:
SavedData document
See Also:
DAgentContext.getSavedData()

getUnprocessedDocuments

public java.util.Iterator getUnprocessedDocuments()
The documents in a database that the current agent considers to be unprocessed. The type of agent determines which documents are considered unprocessed.

Specified by:
getUnprocessedDocuments in interface DAgentContext
Returns:
iterator of unprocessed documents
See Also:
DAgentContext.getUnprocessedDocuments()

toString

public java.lang.String toString()
Description copied from interface: DBase
Returns a short description of an instance.

Specified by:
toString in interface DBase
Overrides:
toString in class java.lang.Object
Returns:
"[DAgentContext]"
See Also:
Object.toString()


Domingo Java-API