com.ibm.notes.java.api.data
Class NotesDatabaseData

java.lang.Object
  extended by com.ibm.notes.java.api.data.NotesData
      extended by com.ibm.notes.java.api.data.NotesDatabaseData

public class NotesDatabaseData
extends NotesData

Class that contains data that would be associated with a Notes database.


Field Summary
 
Fields inherited from class com.ibm.notes.java.api.data.NotesData
baseUrl, ENCODE_ERR, NOTES_COMMAND_SEPARATOR, NOTES_PARAMETER_SEPARATOR, NOTES_PATH_SEPARATOR, NOTES_PROTOCOL, NULL_ERR
 
Constructor Summary
NotesDatabaseData(Database database)
          Constructs a NotesDatabaseData object using a lotus.domino.Database object.
NotesDatabaseData(String url)
          Constructs a NotesDatabaseData object using the database's encoded Notes URL.
NotesDatabaseData(String server, String database)
          Constructs a NotesDatabaseData object using a server and a database.
NotesDatabaseData(String server, String database, String title)
          Constructs a NotesDatabaseData object using a server and a database.
NotesDatabaseData(String server, String filePath, String replicaId, String title)
          Constructs a NotesDatabaseData object with all necessary parameters about the database.
 
Method Summary
 boolean equals(Object obj)
          Determines whether two NotesDatabaseData objects are equals to each other.
 String getFilePath()
          Gets the file path to this database.
 String getOpenUrl()
          Gets the encoded Notes URL to open the NotesData object.
 String getReplicaId()
          Gets the replica id of this database.
 String getServer()
          Gets the server of this database.
 String getTitle()
          Gets the title of the database.
 Database open(Session session)
          Gets the lotus.domino.Database object for a given session.
protected  void setBaseUrl()
          Constructs the Notes URL of the data object from the given information.
 void setFilePath(String filePath)
          Sets the file path.
 void setReplicaId(String replicaId)
          Sets the replica id of this database.
 void setTitle(String title)
          Sets the title of the database.
 
Methods inherited from class com.ibm.notes.java.api.data.NotesData
encode, getBaseUrl, getParser, removeCommandAndParams
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotesDatabaseData

public NotesDatabaseData(String server,
                         String database)
                  throws NotesException 
Constructs a NotesDatabaseData object using a server and a database. Neither the server nor the database should be encoded.

Parameters:
server - the name of the server where the database resides, should never be null, use an empty string for a local database, should not be encoded
database - file path on the server, or replica id of the database, should never be null, should not be encoded
Throws:
NotesException - thrown when the object cannot be constructed from the supplied parameters
Since:
1.5.1

NotesDatabaseData

public NotesDatabaseData(String server,
                         String filePath,
                         String replicaId,
                         String title)
                  throws NotesException 
Constructs a NotesDatabaseData object with all necessary parameters about the database.

Parameters:
server - the name of the server where the database resides, should never be null, use an empty string for a local database, should not be encoded
filePath - file path on the server, should not be encoded
replicaId - the replica id of the database
title - the title of the database
Throws:
NotesException - thrown when the object cannot be constructed from the supplied parameters
Since:
1.5.1

NotesDatabaseData

public NotesDatabaseData(String server,
                         String database,
                         String title)
                  throws NotesException 
Constructs a NotesDatabaseData object using a server and a database. Neither the server nor the database should be encoded.

Parameters:
server - the name of the server where the database resides, should never be null, use an empty string for a local database, should not be encoded
database - database file path on the server, or replica id of the database, should never be null, should not be encoded
title - the title of the database
Throws:
NotesException - thrown when the object cannot be constructed from the supplied parameters
Since:
1.5.1

NotesDatabaseData

public NotesDatabaseData(String url)
                  throws NotesException 
Constructs a NotesDatabaseData object using the database's encoded Notes URL. The URL should be UTF-8 encoded and should never be null.

Parameters:
url - the encoded Notes URL of the database
Throws:
NotesException - thrown when the URL specified cannot be parsed
Since:
1.5.1

NotesDatabaseData

public NotesDatabaseData(Database database)
                  throws NotesException 
Constructs a NotesDatabaseData object using a lotus.domino.Database object.

Parameters:
database - database object representing this database
Throws:
NotesException - thrown when the object could not be constructed
Since:
1.5.1
Method Detail

setBaseUrl

protected void setBaseUrl()
                   throws UnsupportedEncodingException
Description copied from class: NotesData
Constructs the Notes URL of the data object from the given information. The URL constructed should only contain the parameters passed in, no commands, or parameters should be added to the URL in this method.

Specified by:
setBaseUrl in class NotesData
Throws:
UnsupportedEncodingException - thrown when the URL cannot be encoded

getServer

public String getServer()
Gets the server of this database. The returned string is not encoded.

Returns:
the server of the database
Since:
1.5.1

getFilePath

public String getFilePath()
Gets the file path to this database. Can be null if one was not specified. The returned string is not encoded.

Returns:
the filePath to this database
Since:
1.5.1

setFilePath

public void setFilePath(String filePath)
                 throws NotesException 
Sets the file path. The file path should not be encoded.

Parameters:
filePath - the unencoded file path to set
Throws:
NotesException - thrown when the file path cannot be set
Since:
1.5.1

getReplicaId

public String getReplicaId()
Gets the replica id of this database. Can be null if one was not specified.

Returns:
the replica id of this database
Since:
1.5.1

setReplicaId

public void setReplicaId(String replicaId)
                  throws NotesException 
Sets the replica id of this database.

Parameters:
replicaId - the replica id to set
Throws:
NotesException - thrown when the replica id cannot be set
Since:
1.5.1

getTitle

public String getTitle()
Gets the title of the database. Can be null if one was not specified.

Returns:
the title of this database
Since:
1.5.1

setTitle

public void setTitle(String title)
Sets the title of the database.

Parameters:
title - the title of the database
Since:
1.5.1

equals

public boolean equals(Object obj)
Determines whether two NotesDatabaseData objects are equals to each other.

Overrides:
equals in class Object
Parameters:
obj - object to test for equality
Returns:
true if the two objects are equal, false otherwise
Since:
1.5.1

getOpenUrl

public String getOpenUrl()
Description copied from class: NotesData
Gets the encoded Notes URL to open the NotesData object. The URL is UTF-8 encoded.

Specified by:
getOpenUrl in class NotesData
Returns:
the encoded Notes URL to open the NotesData object

open

public Database  open(Session session)
                           throws NotesException 
Gets the lotus.domino.Database object for a given session. This method works best when this database has a file path. If not it tries to resolve the open URL. This method will also set any null attributes in this object using the values from the Notes Jar database.

Parameters:
session - the session to use to get the database
Returns:
the lotus.domino.Database object from the given session
Throws:
NotesException - thrown when the database cannot be opened
Since:
1.5.1