public class NSFDatabase extends NSFHandle
Modifier and Type | Class and Description |
---|---|
static class |
NSFDatabase.ModificationTimePair
This class represents the pair of dates returned by
getLastModified() . |
Constructor and Description |
---|
NSFDatabase(NSFSession session,
long handle,
String serverName,
boolean destroyOnFree)
Constructs a new
NSFDatabase from the provided parent NSFSession ,
opened API handle, and effective server name. |
Modifier and Type | Method and Description |
---|---|
NSFView |
createFolder(String name,
boolean isPrivate)
Create a folder in the database with the given name.
|
NSFNote |
createNote() |
void |
deleteNoteByID(int noteId,
boolean force,
boolean purge)
Delete the specified note from the database.
|
protected void |
doFree()
This method is called when the final reference to this object is freed.
|
static NSFDatabase |
fromLotus(NSFSession session,
lotus.domino.Database lotusDatabase) |
NSFACL |
getACL() |
String |
getApiPath() |
ACLLevel |
getCurrentAccessLevel() |
DBClass |
getDatabaseClass() |
NSFDatabaseDesign |
getDesign()
Returns an
NSFDatabaseDesign view of the database, which allows encapsulated
access to the design notes of the database. |
String |
getEffectiveUserName()
Returns the effective user name used to open the database.
|
String |
getFilePath() |
List<NSFView> |
getFolders()
Retrieve a
List of the folders in the database. |
List<NSFView> |
getFoldersContainingNoteID(int noteId) |
NSFDatabase.ModificationTimePair |
getLastModified()
Retrieves the last modification time of data and non-data notes in the database.
|
NSFNoteIDCollection |
getModifiedNotes(short noteClassMask,
TIMEDATE since)
Returns an
NSFNoteIDCollection containing the IDs of notes in the database matching the
provided note class mask and modified since the provided TIMEDATE . |
NSFNoteIDCollection |
getModifiedNotes(short noteClassMask,
TIMEDATE since,
TIMEDATE until)
Returns an
NSFNoteIDCollection containing the IDs of notes in the database matching the
provided note class mask and modified since the provided TIMEDATE . |
NSFNote |
getNoteByID(int noteId) |
NSFNote |
getNoteByID(String noteId) |
NSFNote |
getNoteByUNID(String unid) |
int |
getNoteIDForUNID(String unid) |
NSFNoteInfo |
getNoteInfo(int noteId)
This method retrieves information from the note's header, without opening the note itself,
and so is useful for efficiency and for querying deleted notes.
|
Set<DBOption> |
getOptions() |
NSFSession |
getParent() |
String |
getReplicaId() |
String |
getServer() |
String |
getTitle() |
String |
getUNIDForNoteID(int noteId) |
NSFView |
getView(int noteId)
Retrieve the view or folder by its design note's ID.
|
NSFView |
getView(String viewName)
Retrieve the first view or folder with the specified name or alias.
|
List<NSFView> |
getViews()
Retrieve a
List of the views and folders in the database. |
void |
search(String query,
NSFSEARCHPROC proc) |
void |
search(String query,
NSFSEARCHPROC proc,
int searchFlags,
int searchFlags1,
int searchFlags2,
int searchFlags3,
int searchFlags4,
short noteClassMask,
TIMEDATE since,
TIMEDATE until) |
void |
search(String query,
NSFSEARCHPROC proc,
short searchFlags,
short noteClassMask,
TIMEDATE since,
TIMEDATE until) |
void |
transactionBegin(Collection<TransactionFlag> flags)
Begins a transaction for the current database handle.
|
void |
transactionCommit(Collection<TransactionCommitFlag> flags)
Commits an active transaction for the current database handle.
|
void |
transactionRollback()
Rolls back an active transaction for the current database handle.
|
_checkRefValidity, equals, getHandle, getSession, hashCode, isRefValid, setHandle, toString
addChild, addChildStruct, debugPrintChildHierarchy, finalize, free, free, free, getAPI, getChildObjectCount, getChildObjectCount, getChildStructCount, isFreed, isTraceCreation, removeChild, removeChildStruct, removeFromParent, retain, setNeedsFree, setTraceCreation
public NSFDatabase(NSFSession session, long handle, String serverName, boolean destroyOnFree)
NSFDatabase
from the provided parent NSFSession
,
opened API handle, and effective server name. Note: as this does not guarantee proper
parent/child relationships, it should be used rarely, and the getDatabase*
methods from NSFSession
should be preferred.destroyOnFree
- whether or not to call NSFDbClose
on deallocationpublic static NSFDatabase fromLotus(NSFSession session, lotus.domino.Database lotusDatabase) throws lotus.domino.NotesException, DominoException
lotus.domino.NotesException
DominoException
public NSFNote createNote() throws DominoException
DominoException
public NSFNote getNoteByID(String noteId) throws DominoException
DominoException
public NSFNote getNoteByID(int noteId) throws DominoException
DominoException
public NSFNote getNoteByUNID(String unid) throws DominoException
DominoException
public NSFNoteInfo getNoteInfo(int noteId) throws DominoException
This information is retrieved via NSFDbGetNoteInfoExt
.
noteId
- the note ID to query (may contain deletion flags)NSFNoteInfo
object with the note's informationDominoException
- if there is a lower-level-API problem retrieving the note infromationpublic void deleteNoteByID(int noteId, boolean force, boolean purge) throws DominoException
force
- whether to force deletionpurge
- whether to delete without leaving a replication stubDominoException
- if there is a problem deleting the notepublic NSFView getView(String viewName) throws DominoException
viewName
- the name or alias of the view to findDominoException
- if a view of that name cannot be found in the databasepublic NSFView getView(int noteId) throws DominoException
noteId
- the ID of the view or folder's design noteDominoException
- if the specified note cannot be found in the database or if it is not a viewpublic List<NSFView> getViews() throws DominoException
List
of the views and folders in the database.List
of the views and folders in the databaseDominoException
- if there is a lower-level-API problem collecting the viewspublic List<NSFView> getFolders() throws DominoException
List
of the folders in the database. This is equivalent to calling
getViews()
and filtering out non-view objects.List
of the folders in the databaseDominoException
- if there is a lower-level-API problem collecting the viewspublic NSFView createFolder(String name, boolean isPrivate) throws DominoException
name
- the name of the folder to createisPrivate
- whether the folder should be marked as privateDominoException
- if there is a lower-level-API problem creating the folderpublic int getNoteIDForUNID(String unid) throws DominoException
DominoException
public String getUNIDForNoteID(int noteId) throws DominoException
DominoException
public NSFNoteIDCollection getModifiedNotes(short noteClassMask, TIMEDATE since) throws DominoException
NSFNoteIDCollection
containing the IDs of notes in the database matching the
provided note class mask and modified since the provided TIMEDATE
.DominoException
public NSFNoteIDCollection getModifiedNotes(short noteClassMask, TIMEDATE since, TIMEDATE until) throws DominoException
Returns an NSFNoteIDCollection
containing the IDs of notes in the database matching the
provided note class mask and modified since the provided TIMEDATE
.
The ending time of the search is stored in the until
parameter.
DominoException
public String getApiPath() throws DominoException
DominoException
public String getServer() throws DominoException
DominoException
public String getFilePath() throws DominoException
DominoException
public String getReplicaId() throws DominoException
DominoException
public void search(String query, NSFSEARCHPROC proc) throws DominoException, FormulaException
DominoException
FormulaException
public void search(String query, NSFSEARCHPROC proc, short searchFlags, short noteClassMask, TIMEDATE since, TIMEDATE until) throws DominoException, FormulaException
DominoException
FormulaException
public void search(String query, NSFSEARCHPROC proc, int searchFlags, int searchFlags1, int searchFlags2, int searchFlags3, int searchFlags4, short noteClassMask, TIMEDATE since, TIMEDATE until) throws DominoException, FormulaException
DominoException
FormulaException
public String getEffectiveUserName() throws DominoException
DominoEception
- if there is a problem determining the user nameDominoException
public List<NSFView> getFoldersContainingNoteID(int noteId) throws DominoException
DominoException
public ACLLevel getCurrentAccessLevel()
public String getTitle() throws DominoException
DominoException
public DBClass getDatabaseClass() throws DominoException
DominoException
public NSFDatabase.ModificationTimePair getLastModified() throws DominoException
NSFDatabase.ModificationTimePair
containing the two NSFDateTime
sDominoException
- if there is a lower-level-API problem determining the timespublic NSFACL getACL() throws DominoException
DominoException
public NSFDatabaseDesign getDesign()
NSFDatabaseDesign
view of the database, which allows encapsulated
access to the design notes of the database.NSFDatabaseDesign
object representing the databasepublic Set<DBOption> getOptions() throws DominoException
DominoException
public void transactionBegin(Collection<TransactionFlag> flags) throws DominoException
flags
- a set of TransactionFlag
s to pass to the transaction callDominoException
- if there is a lower-level-API problem starting the transactionpublic void transactionCommit(Collection<TransactionCommitFlag> flags) throws DominoException
flags
- a set of TransactionCommitFlag
s to pass to the transaction callDominoException
- if there is a lower-level-API problem committing the transactionpublic void transactionRollback() throws DominoException
DominoException
- if there is a lower-level-API problem rolling back the transactionprotected void doFree()
NSFBase
Implemented classes are expected to release any memory or network resources they have open. They are also expected to write this defensively, allowing the method to be called multiple times on the same object without problem.
public NSFSession getParent()
Copyright © 2014–2018. All rights reserved.