- All Implemented Interfaces:
AutoCloseable
The ECDB class provides an API for initializing and manipulating a relational database representing an event calendar. In addition to methods that select, insert, update, or delete table entries, ECDB can generate RFC 5545 calendar appointments and send them via email.
Calendar appointments include the starting date, starting time, ending date, and ending time for an event, whether there is some activity before an event and when that starts, and two optional alarms, with the times set on a per-user basis. The class will also send messages with or without calendar appointments to users to either an email address or to the user's MMS service. Each calendar appointment is tagged with fields that allow a previously sent calendar appointment to be updated. Please see the ECDB description for a more detailed overview of this class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Attendee state.static enum
Calendar status.static class
LabeledID class representing a carrier.static class
LabeledID class representing an event.static class
LabeledID class representing an event instance.static class
Base class for labeled IDs This class represents a binding between an integer ID and a string labeling that ID.static class
LabeledID class representing a location.static class
LabeledID class representing an owner.static class
LabeledID class representing a series.static enum
Table type.static class
Calendar data.static class
LabeledID class representing a user.static enum
User status. -
Constructor Summary
ConstructorsConstructorDescriptionECDB()
Constructor.Constructor given a configuration file.ECDB
(Properties properties) Constructor given configuration properties. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttendee
(Connection conn, int userID, int instanceID, boolean attendingPreEvent, int seriesID) Add a row to the attendee table.void
addAttendee
(Connection conn, int userID, int instanceID, boolean attendingPreEvent, int seriesID, boolean commit) Add a row to the attendee table, indicating if database changes should be commmitted.void
addCarrier
(Connection conn, String carrier) Add a cellphone carrier.void
addCarrier
(Connection conn, String[] carriers) Add cellphone carriers.void
addEvent
(Connection conn, int ownerID, String label, String description) Add a row to the event table.void
addEvent
(Connection conn, int ownerID, String label, String description, boolean commit) Add a row to the event table, indicating if database changes should be committed.void
addEventInstance
(Connection conn, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status) Add a row to the event-instance table.void
addEventInstance
(Connection conn, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status, boolean commit) Add a row to the event-instance table, indicating if database changes should be committed.void
addFirstAlarm
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, boolean forEmail, boolean forPhone) Add a row to the first-alarm table.void
addFirstAlarm
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, boolean forEmail, boolean forPhone, boolean commit) Add a row to the first-alarm table, indicating if the database changes should be committed.void
addLocation
(Connection conn, String label, String location) Add an entry to the location table.void
addLocation
(Connection conn, String label, String location, boolean commit) Add an entry to the location table, indicating if the database change should be committed.void
addOwner
(Connection conn, String label, String summary, String idomain) Add a new owner to the owner table.void
addOwner
(Connection conn, String label, String summary, String idomain, boolean commit) Add a new owner to the owner table, indicating if database changes should be committed.void
addPreEventDefault
(Connection conn, int userID, int ownerID, boolean peDefault) Add a rew to the pre-event default table.void
addPreEventDefault
(Connection conn, int userID, int ownerID, boolean peDefault, boolean commit) Add a rew to the pre-event default table, indicating if database changes should be committed.void
addSecondAlarm
(Connection conn, int userID, int ownerID, int locationID, int offset, boolean forEmail, boolean forPhone) Add a row to the second-alarm table.void
addSecondAlarm
(Connection conn, int userID, int ownerID, int locationID, int offset, boolean forEmail, boolean forPhone, boolean commit) Add a row to the second-alarm table, indicating if the database changes should be committed.void
addSeries
(Connection conn, int ownerID, String label) Add a series to the series table.void
addSeries
(Connection conn, int ownerID, String label, boolean commit) Add a series to the series table, indicating if database changes should be committed.void
addSeriesInstance
(Connection conn, int seriesID, int instanceID) Add a row to the series-instance table.void
addSeriesInstance
(Connection conn, int seriesID, int instanceID, boolean commit) Add a row to the series-instance table, indicating if database changes should be committed..void
addUserInfo
(Connection conn, String firstName, String lastName, boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID) Add a new user.void
addUserInfo
(Connection conn, String firstName, String lastName, boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID, boolean commit) Add a new user, indicating if the new table entry should be committed.void
Configure a database to allow roles specified in the configuration file.void
applySeries
(Connection conn, int userID, int seriesID) Apply a series to a uservoid
applySeries
(Connection conn, int userID, int seriesID, boolean commit) Apply a series to a user, indicating if database changes should be committed.void
close()
Close this ECDB session.static void
copyToClipboard
(Vector<byte[]> calendars, boolean headless) Copy a series of calendars to the window-system's clipboard.void
createDB()
Create a database.void
Create a database's ECDB tables.void
deleteAttendee
(Connection conn, int userID, int instanceID, String attendeeState, int seriesID, boolean force) Delete one or more rows from the attendee table.void
Delete all rows from the event-instance table whose state is "CANCELLED".void
deleteCarrier
(Connection conn, int carrierID) Delete a carrier by ID.void
deleteCarrier
(Connection conn, int[] carrierIDs) Delete carriers by ID.void
deleteCarrier
(Connection conn, String carrier) Delete a carrier by name.void
deleteCarrier
(Connection conn, String[] carriers) Delete carriers by name.void
deleteEvent
(Connection conn, int eventID) Delete a row from the event table.void
deleteEvent
(Connection conn, int[] eventIDs) Delete rows from the event table.void
deleteEvent
(Connection conn, String pattern) Delete rows whose labels match a patter from the event table.void
deleteEvent
(Connection conn, String pattern, boolean force) Delete rows whose labels match a patter from the event table, indicating if the deletion is interactive or if all matching rows are to be deleted.boolean
deleteEventInstance
(Connection conn, int instanceID) Delete a row from the event-instance table.int
deleteEventInstances
(Connection conn, int[] instanceIDs) Delete rows from the event-instance table.void
deleteFirstAlarm
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday) Delete a row from the first-alarm table.void
deleteFirstAlarms
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, Boolean weekday, boolean force) Delete rows from the first-alarm table.void
deleteLocation
(Connection conn, int locationID) Delete a row from the location tablevoid
deleteLocation
(Connection conn, int[] locationIDs) Delete rows from the location table given a list of location IDsvoid
deleteLocation
(Connection conn, String pattern) Delete rows from the location table given a pattern.void
deleteLocation
(Connection conn, String pattern, boolean force) Delete a row from the location table given a pattern and indicating if the deletion is interactive.void
deleteOwner
(Connection conn, int ownerID) Delete an entry from the owner table.void
deleteOwner
(Connection conn, int[] ownerIDs) Delete an entry from the owner table a list of owner IDs.void
deleteOwner
(Connection conn, String pattern) Delete an entry from the owner table given a search pattern.void
deleteOwner
(Connection conn, String pattern, boolean force) Delete an entry from the owner table given a search pattern, indicating if the deletion is interactive.void
deletePreEventDefault
(Connection conn, int userID, int ownerID) Delete a row from the pre-event default table.void
deletePreEventDefaults
(Connection conn, int userID, int ownerID, boolean force) Delete rows from the pre-event default table, indicating if the deletions are interactive.void
deleteSecondAlarm
(Connection conn, int userID, int ownerID, int locationID) Delete a row from the second alarm table.void
deleteSecondAlarms
(Connection conn, int userID, int ownerID, int locationID, boolean force) Delete rows from the second alarm table.void
deleteSeries
(Connection conn, int seriesID) Delete a series from the series table.void
deleteSeries
(Connection conn, int[] ownerIDs) Delete a series from the series table.void
deleteSeries
(Connection conn, int ownerID, String pattern) Delete a series from the series table.void
deleteSeries
(Connection conn, int ownerID, String pattern, boolean force) Delete a series from the series table, indicating if the deletions are interactive.void
deleteSeriesInstance
(Connection conn, int seriesID, int instanceID) Delete rows from the series-instance table.void
deleteSeriesInstance
(Connection conn, int seriesID, int instanceID, boolean force) Delete rows from the series-instance table, indicating if multiple deletions should be done interactively.void
deleteUserInfo
(Connection conn, int userID) Delete user data.void
deleteUserInfo
(Connection conn, int[] userIDs) Delete user data based on user IDs.void
deleteUserInfo
(Connection conn, String pattern) Delete user data.void
deleteUserInfo
(Connection conn, String pattern, boolean force) Delete user data optionally asking for confirmation.static void
dryrunForSend
(ECDB ecdb, Connection conn, PrintWriter out, Vector<ECDB.UserCalendars> vector, boolean forEmail, boolean suppressCalendars) Send a calendar appointment or message via email, either to an email address.int
findSeries
(Connection conn, int ownerID, String pattern) Find a series ID given an owner ID and a pattern used to match labels.Get the alternative media type for a message.Get the URL for the alternative message template.getCalendars
(Connection conn, int userID, int ownerID, int eventID, boolean calendarForEmail) Get a list of UserCalendar objects, each associated with a distinct user ID for users attending a specified set of event instances.getCarrierDomain
(Connection conn, String countryPrefix, int carrierID) List a carrier map.long
Get the timeout for email addresses assocated with a cell phone number.Get a database connection.getFullEmailAddress
(Connection conn, int userID, boolean useEmail) Get the full email address for a user.static String[]
getHeading
(ECDB.Table table, boolean full) getHeadingVector
(ECDB.Table table, boolean full) int
getInstanceCount
(Connection conn, int ownerID, int eventID, int locationID, int instanceID) Count the number of rows in the attendee with an instance id that matches an event instance with a specified location and event ID, where the corresponding event has a specified owner.getLocationLabeledID
(Connection conn, int locationID) Get the location labeled ID for an owner table entryGet the media type for a message.getNonAttendees
(Connection conn, int ownerID, int eventID, int locationID, int instanceID, boolean forEmail) Get a list of UserCalendar objects, each associated with a distinct user ID for users not attending a specified set of event instances.getOwnerLabeledID
(Connection conn, int ownerID) Get the owner labeled ID for an owner table entryboolean
getPreEventDefault
(Connection conn, int userID, int ownerID) boolean
Get the preflight mode.getSeriesLabeledID
(Connection conn, int seriesID, boolean withOwner) Get the series labeled ID for an entry in the series table.Get the current subject line.Get the URL for the message template.getUserCellphoneEmail
(Connection conn, int userID, boolean full) Get the email address for a user's MMS gateway.getUserKeyMap
(Connection conn, int userID) Get a user's keymap.getUserLabeledID
(Connection conn, int userID) Get a user labeled ID for a specified userboolean
isClosed()
Determine if this session has been closed.listAttendees
(Connection conn, int userID, int instanceID, int seriesID, String attendeeState, boolean full) List attendees The fields listed are in the following order: userID, instanceID, attendeeState, attendingPreEvent, and seriesIDList all carriers by name and ID.listCarriers
(Connection conn, int[] ids, boolean full) List carriers given their IDs.listCarriers
(Connection conn, String[] patterns, boolean full) List carriers given name-matching patterns.listEventInstance
(Connection conn, int instanceID, boolean full) List rows from the event-instance table for a series of instance IDs.listEventInstances
(Connection conn, int[] ids, boolean full) List rows from the event-instance table for a series of instance IDs.listEventInstances
(Connection conn, int ownerID, int eventID, int locationID, boolean full) List rows from the event-instance table.listEventInstances
(Connection conn, int ownerID, int locationID, Date startDate, Time startTime, String status, boolean full) List rows from the event-instance table matching additional criteria.listEventLabeledIDs
(Connection conn, int ownerID) List the event labeled IDs for rows in the event table with specified ownersObject[]
listEventLabels
(Connection conn, int ownerID) List the labels for rows in the event table with specified ownerslistEvents
(Connection conn, int[] ids, boolean full) List the rows in the event table matching event IDs.listEvents
(Connection conn, String[] patterns, boolean full) List the rows in the event table matching patterns.listEventsForOwner
(Connection conn, int ownerID, boolean full) List the rows in the event table matching specified owner IDs.listFirstAlarms
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, Boolean weekday, boolean full) List rows from the first alarm table.listInstanceLabeledIDs
(Connection conn, int ownerID, int eventID, int locationID) List instance labeled IDs for the event-instance table.listInstanceLabeledIDs
(Connection conn, int ownerID, int eventID, int locationID, boolean all) List instance labeled IDs for the event-instance table, optionally starting with an element matching all event instances.List the location labeled IDs for all locations in the location table.listLocationLabeledIDs
(Connection conn, boolean all) List the location labeled IDs for all locations in the location table, specifying whether an 'all' entry should appear first.Object[]
listLocationLabels
(Connection conn) List the location labels in the location table This method is intended for building combo boxes and similar GUI components.listLocations
(Connection conn, int[] ids, boolean full) List rows from the location table matching specified ids.listLocations
(Connection conn, String[] patterns, boolean full) List rows from the location table matching a pattern.Object[]
listOwnerLabels
(Connection conn) listOwners
(Connection conn, int[] ids, boolean full) List owners matching each in series of owner IDs.listOwners
(Connection conn, String[] patterns, boolean full) List owners matching a series of patterns When the argument full has the value true, each row contains an owner ID, followed by a label, followed by a summary, followed by an Internet domain name.listPreEventDefaults
(Connection conn, int userID, int ownerID, boolean full) List rows from the pre-event default table.listSecondAlarms
(Connection conn, int userID, int ownerID, int locationID, boolean full) List matching rows from the second-alarm table.listSeries
(Connection conn, int[] ids, boolean full) List rows in the series table that match specific series IDs.listSeries
(Connection conn, int seriesID, boolean full) List rows in the series table that match a specific series ID, or optionally all series IDs.listSeries
(Connection conn, int ownerID, String pattern, boolean full) List rows from the series table.listSeriesInstance
(Connection conn, int seriesID, int instanceID, boolean full) List rows from the series-instance table.listSeriesInstanceByOwner
(Connection conn, int seriesID, int ownerID, boolean full) List rows from the series-instance table by owner.listSeriesLabeledIDs
(Connection conn, int ownerID) List the series label IDs for a series.Object[]
listSeriesLabels
(Connection conn, int ownerID, boolean all) List the labels for a series.listUserInfo
(Connection conn, int[] ids, boolean full) List users matching a list of user Ids.listUserInfo
(Connection conn, String[] patterns, boolean full) List users matching a pattern.listUserInfo
(Connection conn, String pattern, boolean full) List users matching a pattern.listUserLabeledIDs
(Connection conn, String pattern) list the user labeled IDs for a specified patternstatic void
Main program for ECDB when used as an application instead of purely as part of a class library.static void
saveToDirectory
(File dir, Vector<byte[]> calendars) Copy a series of calendars to a directory.static boolean
sendViaEmail
(ECDB ecdb, Connection conn, Vector<ECDB.UserCalendars> vector, boolean suppressCalendars, JFrame frame, boolean preflight) Send a calendar appointment or message via email, either to an email address.void
setAltMediaType
(String mediaType) Set the alternative media type for a message (email or MMS via a gateway).void
setAltTemplateURL
(URL templateURL) Set the URL for the alternative message template.void
setAttendee
(Connection conn, int userID, int instanceID, String attendeeState, int seriesID) Set fields in a row of the attendee table.void
setAttendee
(Connection conn, int userID, int instanceID, String attendeeState, int seriesID, boolean commit) Set fields in a row of the attendee table.void
setCarrier
(Connection conn, int carrierID, String carrierName) Set the name of a carrier.void
setCarrier
(Connection conn, int carrierID, String carrierName, boolean commit) Set the name of a carrier, with control over database commits.void
setCarrierMapping
(Connection conn, String countryPrefix, int carrierID, String domain) Set the carrier mapping.void
setCarrierMapping
(Connection conn, String countryPrefix, int carrierID, String domain, boolean commit) Set the carrier mapping.void
setEvent
(Connection conn, int eventID, int ownerID, String label, String description) Set an event table field.void
setEvent
(Connection conn, int eventID, int ownerID, String label, String description, boolean commit) Set an event table field, indicating if database changes should be committed.void
setEventInstance
(Connection conn, int instanceID, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status) Set fields in a row of the event table.void
setEventInstance
(Connection conn, int instanceID, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status, boolean commit) Set fields in a row of the event table, indicating if database changes should be committed.void
setFirstAlarm
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, Boolean forEmail, Boolean forPhone) Set fields in a row from the first alarm table.void
setFirstAlarm
(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, Boolean forEmail, Boolean forPhone, boolean commit) Set fields in a row from the first alarm table, indicating if the database changes should be committed.void
setLocation
(Connection conn, int locationID, String label, String location) Set fields in the location table.void
setLocation
(Connection conn, int locationID, String label, String location, boolean commit) Set fields in the location table, indicating if the database changes should be committed.void
setMediaType
(String mediaType) Set the media type for a message (email or MMS via a gateway).void
setOwner
(Connection conn, int ownerID, String label, String summary, String idomain) Set fields in the owner table.void
setOwner
(Connection conn, int ownerID, String label, String summary, String idomain, boolean commit) Set fields in the owner table, indicating if changes should be committed.void
setPreEventDefault
(Connection conn, int userID, int ownerID, boolean peDefault) Set the pre-event default field in a row in the pre-event default table.void
setPreEventDefault
(Connection conn, int userID, int ownerID, boolean peDefault, boolean commit) Set the pre-event default field in a row in the pre-event default table, indicating if data base changes should be committed.void
setPreflight
(boolean value) Set the preflight mode.void
setSecondAlarm
(Connection conn, int userID, int ownerID, int locationID, int offset, Boolean forEmail, Boolean forPhone) Set fields in the second-alarm table.void
setSecondAlarm
(Connection conn, int userID, int ownerID, int locationID, int offset, Boolean forEmail, Boolean forPhone, boolean commit) Set fields in the second-alarm table, indicating if the changes should be committed to a database.void
setSeries
(Connection conn, int seriesID, int ownerID, String label) Set fields for a row in the series table.void
setSeries
(Connection conn, int seriesID, int ownerID, String label, boolean commit) Set fields for a row in the series table, optionally committing database changes.void
setSubject
(String subject) Set the subject for a message (email or MMS via a gateway).void
setTemplateURL
(URL templateURL) Set the URL for the message template.void
setUserInfo
(Connection conn, int userID, String firstName, String lastName, Boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID, String status) Set the table entry for a user.void
setUserInfo
(Connection conn, int userID, String firstName, String lastName, Boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID, String status, boolean commit) Set the table entry for a user, indicating if the table change should be committed.
-
Constructor Details
-
ECDB
Constructor.- Throws:
IOException
org.bzdev.ecdb.ECDBException
-
ECDB
Constructor given a configuration file.- Parameters:
file
- the configuration file- Throws:
IOException
- if an IO error occuredorg.bzdev.ecdb.ECDBException
- for an ECDB-specific error
-
ECDB
Constructor given configuration properties.- Parameters:
properties
- the properties- Throws:
IOException
- if an IO error occuredorg.bzdev.ecdb.ECDBException
- for an ECDB-specific error
-
-
Method Details
-
getCellEmailAddrTimeout
public long getCellEmailAddrTimeout()Get the timeout for email addresses assocated with a cell phone number.- Returns:
- the timeout in units of days
-
getConnection
Get a database connection.- Returns:
- a connection
- Throws:
SQLException
- if an SQL error occurred
-
isClosed
public boolean isClosed()Determine if this session has been closed.- Returns:
- true if the session has been closed; false otherwise
-
close
Close this ECDB session.- Specified by:
close
in interfaceAutoCloseable
- Throws:
SQLException
- if an SQL error occurred
-
getFullEmailAddress
public String getFullEmailAddress(Connection conn, int userID, boolean useEmail) throws SQLException Get the full email address for a user. A full email address consists of the user's name followed by an email address delimited by '<' and '>'.- Parameters:
conn
- the database connectionuserID
- the recipient's user IDuseEmail
- true if the recipient's email address will be used; false if the MMS email address for the recipient's cell phone is used.- Returns:
- the full email address
- Throws:
SQLException
- if an SQL error occurred
-
createDB
Create a database. This method uses information in the configuration file to create a database's tables and, when possible, the database itself.- Throws:
IOException
- if an IO error occurredSQLException
- if an SQL error occurred
-
allowRoles
Configure a database to allow roles specified in the configuration file.- Throws:
IOException
- if an IO error occurredSQLException
- if an SQL error occurred
-
createTables
Create a database's ECDB tables.- Throws:
IOException
- if an IO error occurredSQLException
- if an SQL error occurred
-
addCarrier
Add a cellphone carrier.- Parameters:
conn
- the database connectioncarrier
- the carrier's name- Throws:
SQLException
- if an SQL error occurred
-
addCarrier
Add cellphone carriers.- Parameters:
conn
- the database connectioncarriers
- an array containing the carrier's name- Throws:
SQLException
- if an SQL error occurred
-
deleteCarrier
Delete a carrier by ID.- Parameters:
conn
- the database connectioncarrierID
- the carrier's ID- Throws:
SQLException
- if an SQL error occurred
-
deleteCarrier
Delete a carrier by name.- Parameters:
conn
- the database connectioncarrier
- the carrier's name- Throws:
SQLException
- if an SQL error occurred
-
deleteCarrier
Delete carriers by name.- Parameters:
conn
- the database connectioncarriers
- an array containing the names of the carriers to delete- Throws:
SQLException
- if an SQL error occurred
-
deleteCarrier
Delete carriers by ID.- Parameters:
conn
- the database connectioncarrierIDs
- an array containing the IDs of the carriers to delete- Throws:
SQLException
- if an SQL error occurred
-
listCarrierLabeledIDs
List all carriers by name and ID.- Parameters:
conn
- the database connection- Returns:
- an array, each element of which specifies a carrier ID and the corresponding name
- Throws:
SQLException
- if an SQL error occurred
-
listCarriers
public Vector<Vector<Object>> listCarriers(Connection conn, String[] patterns, boolean full) throws SQLException List carriers given name-matching patterns. The vector returned represents a table.- Parameters:
conn
- the database connectionpatterns
- the search patternsfull
- true if if the table rows contains a carrier ID followed by aECDB.CarrierLabeledID
; false if the table contains only a carrier ID in each row- Returns:
- a table.
- Throws:
SQLException
- if an SQL error occurred
-
listCarriers
public Vector<Vector<Object>> listCarriers(Connection conn, int[] ids, boolean full) throws SQLException List carriers given their IDs. The vector returned represents a table, each row ofwhich contains a carrier ID followed optionally by a string. Each carrier ID is an integer and each carrier name is a string.- Parameters:
conn
- the database connectionids
- an array of carrier IDs.full
- true if if the table rows contains a carrier ID followed by the carrier name; false if the table contains only a carrier ID in each row- Returns:
- a table.
- Throws:
SQLException
- if an SQL error occurred
-
setCarrier
public void setCarrier(Connection conn, int carrierID, String carrierName) throws IllegalArgumentException, SQLException Set the name of a carrier.- Parameters:
conn
- the database connectioncarrierID
- a carrierIDcarrierName
- the new carrier name- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
setCarrier
public void setCarrier(Connection conn, int carrierID, String carrierName, boolean commit) throws IllegalArgumentException, SQLException Set the name of a carrier, with control over database commits.- Parameters:
conn
- the database connectioncarrierID
- a carrierIDcarrierName
- the new carrier namecommit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
SQLException
-
getCarrierDomain
public String getCarrierDomain(Connection conn, String countryPrefix, int carrierID) throws SQLException List a carrier map. The return value represents a table, each row of which contains a country prefix, a carrierID or a carrier labeled-ID, and an email domain of a gateway to the MMS service.- Parameters:
conn
- the database connectioncountryPrefix
- the country prefix or codecarrierID
- the carrier ID- Returns:
- the email domain used for MMS messages sent via email; null if there is none
- Throws:
SQLException
- if an SQL error occurred
-
setCarrierMapping
public void setCarrierMapping(Connection conn, String countryPrefix, int carrierID, String domain) throws SQLException, IllegalArgumentException Set the carrier mapping.- Parameters:
conn
- the database connectioncountryPrefix
- the country prefix or codecarrierID
- the carrier IDdomain
- the domain name for the email gateway used to forward an email to a carrier's MMS service- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
setCarrierMapping
public void setCarrierMapping(Connection conn, String countryPrefix, int carrierID, String domain, boolean commit) throws SQLException, IllegalArgumentException Set the carrier mapping.- Parameters:
conn
- the database connectioncountryPrefix
- the country prefix or codecarrierID
- the carrier IDdomain
- the domain name for the email gateway used to forward an email to a carrier's MMS servicecommit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
addUserInfo
public void addUserInfo(Connection conn, String firstName, String lastName, boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID) throws SQLException Add a new user.- Parameters:
conn
- the database connectionfirstName
- the user's first namelastName
- the user's last nametitle
- the user's title; null if there is nonelastNameFirst
- true if the first name follows the last name when printed; false if the last name follows the first nameemailAddr
- the user's email addresscountryPrefix
- the user's country prefix (1 for the U.S.)cellNumber
- the user's cell phone numbercarrierID
- the ID for the user's cell phone carrier- Throws:
SQLException
- if an SQL error occurred
-
addUserInfo
public void addUserInfo(Connection conn, String firstName, String lastName, boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID, boolean commit) throws SQLException Add a new user, indicating if the new table entry should be committed.- Parameters:
conn
- the database connectionfirstName
- the user's first namelastName
- the user's last nametitle
- the user's title; null if there is nonelastNameFirst
- true if the first name follows the last name when printed; false if the last name follows the first nameemailAddr
- the user's email addresscountryPrefix
- the user's country prefix (1 for the U.S.)cellNumber
- the user's cell phone numbercarrierID
- the ID for the user's cell phone carriercommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
deleteUserInfo
Delete user data.- Parameters:
conn
- the database connectionuserID
- the user ID- Throws:
SQLException
- if an SQL error occurred
-
deleteUserInfo
Delete user data. Each deletion must be confirmed.- Parameters:
conn
- the database connectionpattern
- a pattern used to find users to delete- Throws:
SQLException
- if an SQL error occurred
-
deleteUserInfo
Delete user data optionally asking for confirmation.- Parameters:
conn
- the database connectionpattern
- a pattern used to find users to deleteforce
- true if all matching users should be deleted; false if each deletion must be confirmed- Throws:
SQLException
- if an SQL error occurred
-
deleteUserInfo
Delete user data based on user IDs.- Parameters:
conn
- the database connectionuserIDs
- the user IDs for the users that are to be deleted- Throws:
SQLException
- if an SQL error occurred
-
getUserLabeledID
public ECDB.UserLabeledID getUserLabeledID(Connection conn, int userID) throws IllegalArgumentException, SQLException Get a user labeled ID for a specified user- Parameters:
conn
- the database connectionuserID
- the user ID- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
listUserLabeledIDs
list the user labeled IDs for a specified pattern- Parameters:
conn
- the database connectionpattern
- the pattern- Throws:
SQLException
- if an SQL error occurred
-
listUserInfo
public Vector<Vector<Object>> listUserInfo(Connection conn, String pattern, boolean full) throws SQLException List users matching a pattern. A full row lists the user ID, first name, last name, last-name first flag, title, email address, country prefix, cell-phone number, carrier, and status.- Parameters:
conn
- the database connectionpattern
- the patternfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only a user ID- Throws:
SQLException
- if an SQL error occurred
-
listUserInfo
public Vector<Vector<Object>> listUserInfo(Connection conn, String[] patterns, boolean full) throws SQLException List users matching a pattern. A full row lists the user ID, first name, last name, last-name first flag, title, email address, country prefix, cell-phone number, carrier, and status.- Parameters:
conn
- the database connectionpatterns
- the patternsfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only a user ID- Throws:
SQLException
-
getUserKeyMap
public TemplateProcessor.KeyMap getUserKeyMap(Connection conn, int userID) throws IllegalArgumentException, SQLException Get a user's keymap. Keymaps are used by template processors. the keymap's keys are firstName, lastName, noFirstName, lastName, noLastName, lastNameFirst, firstNameLast, title, and noTitle- Parameters:
conn
- the database connectionuserID
- the user's user id- Returns:
- the user's key map
- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred- See Also:
-
listUserInfo
public Vector<Vector<Object>> listUserInfo(Connection conn, int[] ids, boolean full) throws SQLException List users matching a list of user Ids. A full row lists the user ID, first name, last name, last-name first flag, title, email address, country prefix, cell-phone number, carrier, and status.- Parameters:
conn
- the database connectionids
- the user IDsfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only a user ID- Throws:
SQLException
- if an SQL error occurred
-
getUserCellphoneEmail
public String getUserCellphoneEmail(Connection conn, int userID, boolean full) throws IllegalArgumentException, SQLException Get the email address for a user's MMS gateway.- Parameters:
conn
- the database connectionuserID
- the userIDfull
- true if the email address includes the user's name with the email address in angle brackets false if the email address alone is returned- Returns:
- the email address
- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
setUserInfo
public void setUserInfo(Connection conn, int userID, String firstName, String lastName, Boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID, String status) throws SQLException Set the table entry for a user.- Parameters:
conn
- the database connectionuserID
- the userIDfirstName
- the user's first name; null if ignoredlastName
- the user's last name; null if ignoredlastNameFirst
- true if the user's last name is followed by the user's first name; false if the user's first name is followed by theuser's last name; null if ignoredtitle
- the user's title; null if ignoredemailAddr
- the user's email address; null if ignoredcountryPrefix
- the country prefix for the user's cell-phone number; null if ignoredcellNumber
- the user's cell-phone number; null if ignoredcarrierID
- the carrierID for the user's cell-phone carrier; -1 if ignoredstatus
- the user's status - ACTIVE, NOTACTIVE, CANCELLED; null if ignored- Throws:
SQLException
- if an SQL error occurred
-
setUserInfo
public void setUserInfo(Connection conn, int userID, String firstName, String lastName, Boolean lastNameFirst, String title, String emailAddr, String countryPrefix, String cellNumber, int carrierID, String status, boolean commit) throws SQLException Set the table entry for a user, indicating if the table change should be committed.- Parameters:
conn
- the database connectionuserID
- the userIDfirstName
- the user's first name; null if ignoredlastName
- the user's last name; null if ignoredlastNameFirst
- true if the user's last name is followed by the user's first name; false if the user's first name is followed by theuser's last name; null if ignoredtitle
- the user's title; null if ignoredemailAddr
- the user's email address; null if ignoredcountryPrefix
- the country prefix for the user's cell-phone number; null if ignoredcellNumber
- the user's cell-phone number; null if ignoredcarrierID
- the carrierID for the user's cell-phone carrier; -1 if ignoredstatus
- the user's status - ACTIVE, NOTACTIVE, CANCELLED; null if ignoredcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
addOwner
public void addOwner(Connection conn, String label, String summary, String idomain) throws SQLException Add a new owner to the owner table.- Parameters:
conn
- the database connectionlabel
- a short string naming the ownersummary
- a description of the owneridomain
- the internet domain name associated with the owner- Throws:
SQLException
- if an SQL error occurred
-
addOwner
public void addOwner(Connection conn, String label, String summary, String idomain, boolean commit) throws SQLException Add a new owner to the owner table, indicating if database changes should be committed.- Parameters:
conn
- the database connectionlabel
- a short string naming the ownersummary
- a description of the owneridomain
- the internet domain name associated with the ownercommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
-
deleteOwner
Delete an entry from the owner table.- Parameters:
conn
- the database connectionownerID
- the owner ID for the entry- Throws:
SQLException
- if an SQL error occurred
-
deleteOwner
Delete an entry from the owner table given a search pattern.- Parameters:
conn
- the database connectionpattern
- a search pattern for the owner- Throws:
SQLException
- if an SQL error occurred
-
deleteOwner
Delete an entry from the owner table given a search pattern, indicating if the deletion is interactive.- Parameters:
conn
- the database connectionpattern
- a search pattern for the ownerforce
- true if all matching users should be deleted; false if each deletion must be confirmed- Throws:
SQLException
- if an SQL error occurred
-
deleteOwner
Delete an entry from the owner table a list of owner IDs.- Parameters:
conn
- the database connectionownerIDs
- the owner IDs for the entries- Throws:
SQLException
- if an SQL error occurred
-
listOwnerLabels
- Throws:
SQLException
-
listOwnerLabeledIDs
- Throws:
SQLException
-
listOwners
public Vector<Vector<Object>> listOwners(Connection conn, String[] patterns, boolean full) throws SQLException List owners matching a series of patterns When the argument full has the value true, each row contains an owner ID, followed by a label, followed by a summary, followed by an Internet domain name.- Parameters:
conn
- the database connectionpatterns
- a list of patternsfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only an owner ID- Throws:
SQLException
- if an SQL error occurred
-
listOwners
public Vector<Vector<Object>> listOwners(Connection conn, int[] ids, boolean full) throws SQLException List owners matching each in series of owner IDs. When the argument full has the value true, each row contains an owner ID, followed by a label, followed by a summary, followed by an Internet domain name.- Parameters:
conn
- the database connectionids
- a list of owner IDsfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only an owner ID- Throws:
SQLException
- if an SQL error occurred
-
setOwner
public void setOwner(Connection conn, int ownerID, String label, String summary, String idomain) throws SQLException Set fields in the owner table.- Parameters:
conn
- the database connectionownerID
- the owner ID for the fields to setlabel
- the label; null if ignoredsummary
- the summary; null if ignoredidomain
- the internet domain name; null if ignored- Throws:
SQLException
- if an SQL error occurred
-
setOwner
public void setOwner(Connection conn, int ownerID, String label, String summary, String idomain, boolean commit) throws SQLException Set fields in the owner table, indicating if changes should be committed.- Parameters:
conn
- the database connectionownerID
- the owner ID for the fields to setlabel
- the label; null if ignoredsummary
- the summary; null if ignoredidomain
- the internet domain name; null if ignoredcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
addLocation
Add an entry to the location table.- Parameters:
conn
- the database connectionlabel
- the labellocation
- a description of the location- Throws:
SQLException
- if an SQL error occurred
-
addLocation
public void addLocation(Connection conn, String label, String location, boolean commit) throws SQLException Add an entry to the location table, indicating if the database change should be committed.- Parameters:
conn
- the database connectionlabel
- the labellocation
- a description of the locationcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
deleteLocation
Delete a row from the location table- Parameters:
conn
- the database connectionlocationID
- the location ID- Throws:
SQLException
- if an SQL error occurred
-
deleteLocation
Delete rows from the location table given a pattern.- Parameters:
conn
- the database connectionpattern
- a search pattern- Throws:
SQLException
- if an SQL error occurred
-
deleteLocation
Delete a row from the location table given a pattern and indicating if the deletion is interactive.- Parameters:
conn
- the database connectionpattern
- a search patternforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
SQLException
- if an SQL error occurred
-
deleteLocation
Delete rows from the location table given a list of location IDs- Parameters:
conn
- the database connectionlocationIDs
- the IDs of the locations to be deleted- Throws:
SQLException
- if an SQL error occurred
-
listLocationLabels
List the location labels in the location table This method is intended for building combo boxes and similar GUI components. The initial entry indicates that all locations should be selected.- Parameters:
conn
- the database connection- Returns:
- the location labels, prefaced with the "[ All ]"
- Throws:
SQLException
- if an SQL error occurred
-
listLocationLabeledIDs
List the location labeled IDs for all locations in the location table.- Parameters:
conn
- the database connection- Returns:
- the location labeled IDs
- Throws:
SQLException
- if an SQL error occurred
-
listLocationLabeledIDs
public ECDB.LocationLabeledID[] listLocationLabeledIDs(Connection conn, boolean all) throws SQLException List the location labeled IDs for all locations in the location table, specifying whether an 'all' entry should appear first. The 'all' labeled ID is an ID whose label is "[ All ]" and whose location id is -1, which is used as a signal that all IDs are wanted.- Parameters:
conn
- the database connectionall
- true if an 'all' labeled ID should appear first; false if this ID never appears- Returns:
- the location labeled IDs
- Throws:
SQLException
-
listLocations
public Vector<Vector<Object>> listLocations(Connection conn, String[] patterns, boolean full) throws SQLException List rows from the location table matching a pattern. For the full listing, each row contains the location ID, followed by the label, followed by the location.- Parameters:
conn
- the database connectionpatterns
- patterns, one of which should match a labelsfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only a location ID- Throws:
SQLException
- if an SQL error occurred
-
listLocations
public Vector<Vector<Object>> listLocations(Connection conn, int[] ids, boolean full) throws SQLException List rows from the location table matching specified ids. For the full listing, each row contains the location ID, followed by the label, followed by the location.- Parameters:
conn
- the database connectionids
- the location IDs to matchfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only a location ID- Returns:
- a table whose rows are described above
- Throws:
SQLException
- if an SQL error occurred
-
setLocation
public void setLocation(Connection conn, int locationID, String label, String location) throws SQLException Set fields in the location table.- Parameters:
conn
- the database connectionlocationID
- the location ID of the fields to setlabel
- the label; null if this field is not changedlocation
- the location description; null if this field is not changed- Throws:
SQLException
- if an SQL error occurred
-
setLocation
public void setLocation(Connection conn, int locationID, String label, String location, boolean commit) throws SQLException Set fields in the location table, indicating if the database changes should be committed.- Parameters:
conn
- the database connectionlocationID
- the location ID of the fields to setlabel
- the label; null if this field is not changedlocation
- the location description; null if this field is not changed- Throws:
SQLException
- if an SQL error occurred
-
addFirstAlarm
public void addFirstAlarm(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, boolean forEmail, boolean forPhone) throws SQLException, IllegalArgumentException Add a row to the first-alarm table.- Parameters:
conn
- the database connectionuserID
- the ID of the user to which the new row appliesownerID
- the ID of the owner to which the new row applieslocationID
- the ID of the location to which the new row applieseventTime
- a possible time for an eventweekday
- true if eventTime refers to a weekday; false for a weekendalarmTime
- the corresponding time for an alarmforEmail
- true if the alarm applies calendar appointments that will be sent to the user's email address; false if no message is to be sentforPhone
- true if the alarm applies calendar appointments that will be sent to the user's cell phone; false if no message is to be sent- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
addFirstAlarm
public void addFirstAlarm(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, boolean forEmail, boolean forPhone, boolean commit) throws SQLException, IllegalArgumentException Add a row to the first-alarm table, indicating if the database changes should be committed.- Parameters:
conn
- the database connectionuserID
- the ID of the user to which the new row appliesownerID
- the ID of the owner to which the new row applieslocationID
- the ID of the location to which the new row applieseventTime
- a possible time for an eventweekday
- true if eventTime refers to a weekday; false for a weekendalarmTime
- the corresponding time for an alarmforEmail
- true if the alarm applies calendar appointments that will be sent to the user's email address; false if no message is to be sentforPhone
- true if the alarm applies calendar appointments that will be sent to the user's cell phone; false if no message is to be sentcommit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
deleteFirstAlarm
public void deleteFirstAlarm(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday) throws SQLException, IllegalArgumentException Delete a row from the first-alarm table.- Parameters:
conn
- the database connectionuserID
- the ID of the user to which the new row appliesownerID
- the ID of the owner to which the new row applieslocationID
- the ID of the location to which the new row applieseventTime
- a possible time for an eventweekday
- true if eventTime refers to a weekday; false for a weekend- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
deleteFirstAlarms
public void deleteFirstAlarms(Connection conn, int userID, int ownerID, int locationID, Time eventTime, Boolean weekday, boolean force) throws SQLException, IllegalArgumentException Delete rows from the first-alarm table. The rows deleted are those that match the criteria set by the userID, ownerID, locationID, eventTime, and weekday arguments.- Parameters:
conn
- the database connectionuserID
- the ID of the user to which the new row applies; -1 to match all user IDsownerID
- the ID of the owner to which the new row applies; -1 to match all owner IDslocationID
- the ID of the location to which the new row applies; to match all locationseventTime
- a possible time for an event; null for any timeweekday
- true if eventTime refers to a weekday; false for a weekend; null if not considered; null null for either possibilityforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
getOwnerLabeledID
Get the owner labeled ID for an owner table entry- Parameters:
conn
- the database connectionownerID
- the ownerID- Returns:
- the matching owner labeled ID; null if there is no match
-
getLocationLabeledID
Get the location labeled ID for an owner table entry- Parameters:
conn
- the database connectionlocationID
- the location ID- Returns:
- the matching location labeled ID; null if there is no match
-
listFirstAlarms
public Vector<Vector<Object>> listFirstAlarms(Connection conn, int userID, int ownerID, int locationID, Time eventTime, Boolean weekday, boolean full) throws SQLException List rows from the first alarm table. The full listing for a row includes the userID, followed by the location ID, followed by the event time, followed by the weekday flag, followed by the alarm time, followed by the 'for email' flag, followed by the 'for phone' flag.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for any ownerlocationID
- the location ID; -1 for any locationeventTime
- the time of the event; null for any timeweekday
- true if the event occurs on a weekday; false for a weekend; null for eitherfull
- true if a row contains all of the the publicly accessible columns; false if a rows contains only a location ID- Throws:
SQLException
- if an SQL error occurred
-
setFirstAlarm
public void setFirstAlarm(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, Boolean forEmail, Boolean forPhone) throws SQLException Set fields in a row from the first alarm table. The fields that can be set are the ones for the alarmTime, forEmail, and forPhone arguments.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner IDlocationID
- the location IDeventTime
- the time of the eventweekday
- true if the event occurs on a weekday; false for a weekendalarmTime
- the alarm time; null to ignoreforEmail
- the 'for email' flag; null to ignoreforPhone
- the 'for phone' flag; null to ignore- Throws:
SQLException
- if an SQL error occurred
-
setFirstAlarm
public void setFirstAlarm(Connection conn, int userID, int ownerID, int locationID, Time eventTime, boolean weekday, Time alarmTime, Boolean forEmail, Boolean forPhone, boolean commit) throws SQLException Set fields in a row from the first alarm table, indicating if the database changes should be committed. The fields that can be set are the ones for the alarmTime, forEmail, and forPhone arguments.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner IDlocationID
- the location IDeventTime
- the time of the eventweekday
- true if the event occurs on a weekday; false for a weekendalarmTime
- the alarm time; null to ignoreforEmail
- the 'for email' flag; null to ignoreforPhone
- the 'for phone' flag; null to ignorecommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
addSecondAlarm
public void addSecondAlarm(Connection conn, int userID, int ownerID, int locationID, int offset, boolean forEmail, boolean forPhone) throws SQLException, IllegalArgumentException Add a row to the second-alarm table.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner IDlocationID
- the location IDoffset
- the number of minutes before the event for this alarmforEmail
- the 'for email' flagforPhone
- the 'for phone' flag- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
addSecondAlarm
public void addSecondAlarm(Connection conn, int userID, int ownerID, int locationID, int offset, boolean forEmail, boolean forPhone, boolean commit) throws SQLException, IllegalArgumentException Add a row to the second-alarm table, indicating if the database changes should be committed.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner IDlocationID
- the location IDoffset
- the number of minutes before the event for this alarmforEmail
- the 'for email' flagforPhone
- the 'for phone' flagcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
deleteSecondAlarm
public void deleteSecondAlarm(Connection conn, int userID, int ownerID, int locationID) throws SQLException, IllegalArgumentException Delete a row from the second alarm table.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner IDlocationID
- the location ID- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
deleteSecondAlarms
public void deleteSecondAlarms(Connection conn, int userID, int ownerID, int locationID, boolean force) throws SQLException, IllegalArgumentException Delete rows from the second alarm table.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for any ownerlocationID
- the location ID; -1 for any locationforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
listSecondAlarms
public Vector<Vector<Object>> listSecondAlarms(Connection conn, int userID, int ownerID, int locationID, boolean full) throws SQLException List matching rows from the second-alarm table. Each row contains the userID, the ownerID, the locationID, the offset, the 'forEmail' flag, and the 'forPhone' flag in that order.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for any ownerlocationID
- the location ID; -1 for any locationfull
- true if the userID, ownerID, and locationID are represented by labeled IDs; false if they are represented by their integer values- Throws:
SQLException
- if an SQL error occurred
-
setSecondAlarm
public void setSecondAlarm(Connection conn, int userID, int ownerID, int locationID, int offset, Boolean forEmail, Boolean forPhone) throws SQLException Set fields in the second-alarm table.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for any ownerlocationID
- the location ID; -1 for any locationoffset
- the difference in minutes between the event and the alarm; -1 for no changeforEmail
- true if this alarm appears in a calendar sent to an email address; false if it does not; null indicates no changeforPhone
- true if this alarm appears in a calendar sent to a cell phone; false if it does not; null indicates no change- Throws:
SQLException
- if an SQL error occurred
-
setSecondAlarm
public void setSecondAlarm(Connection conn, int userID, int ownerID, int locationID, int offset, Boolean forEmail, Boolean forPhone, boolean commit) throws SQLException Set fields in the second-alarm table, indicating if the changes should be committed to a database.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for any ownerlocationID
- the location ID; -1 for any locationoffset
- the difference in minutes between the event and the alarm; -1 for no changeforEmail
- true if this alarm appears in a calendar sent to an email address; false if it does not; null indicates no changeforPhone
- true if this alarm appears in a calendar sent to a cell phone; false if it does not; null indicates no changecommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
addPreEventDefault
public void addPreEventDefault(Connection conn, int userID, int ownerID, boolean peDefault) throws SQLException, IllegalArgumentException Add a rew to the pre-event default table.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for any ownerpeDefault
- true if the user normally attends pre-events for the owner; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
addPreEventDefault
public void addPreEventDefault(Connection conn, int userID, int ownerID, boolean peDefault, boolean commit) throws SQLException, IllegalArgumentException Add a rew to the pre-event default table, indicating if database changes should be committed.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner IDpeDefault
- true if the user normally attends pre-events for the owner; false otherwisecommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
deletePreEventDefault
public void deletePreEventDefault(Connection conn, int userID, int ownerID) throws SQLException, IllegalArgumentException Delete a row from the pre-event default table.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
deletePreEventDefaults
public void deletePreEventDefaults(Connection conn, int userID, int ownerID, boolean force) throws SQLException, IllegalArgumentException Delete rows from the pre-event default table, indicating if the deletions are interactive.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for all ownersforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
listPreEventDefaults
public Vector<Vector<Object>> listPreEventDefaults(Connection conn, int userID, int ownerID, boolean full) throws SQLException List rows from the pre-event default table. Each row consists of a user ID, followed by an owner ID, followed by a boolean value indicating fi the pre-event default is true or false.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID; -1 for all ownersfull
- true if the userID, ownerID, and locationID are represented by labeled IDs; false if they are represented by their integer values- Throws:
SQLException
- if an SQL error occurred
-
setPreEventDefault
public void setPreEventDefault(Connection conn, int userID, int ownerID, boolean peDefault) throws SQLException Set the pre-event default field in a row in the pre-event default table. Each row consists of a user ID, followed by an owner ID, followed by a boolean value indicating fi the pre-event default is true or false.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID;peDefault
- true if the user normally attends pre-events for the owner; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
setPreEventDefault
public void setPreEventDefault(Connection conn, int userID, int ownerID, boolean peDefault, boolean commit) throws SQLException Set the pre-event default field in a row in the pre-event default table, indicating if data base changes should be committed. Each row consists of a user ID, followed by an owner ID, followed by a boolean value indicating fi the pre-event default is true or false.- Parameters:
conn
- the database connectionuserID
- the userIDownerID
- the owner ID;peDefault
- true if the user normally attends pre-events for the owner; false otherwisecommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
getPreEventDefault
public boolean getPreEventDefault(Connection conn, int userID, int ownerID) throws SQLException, IllegalArgumentException - Throws:
SQLException
IllegalArgumentException
-
addEvent
public void addEvent(Connection conn, int ownerID, String label, String description) throws SQLException, IllegalArgumentException Add a row to the event table.- Parameters:
conn
- the database connectionownerID
- the owner IDlabel
- the event's labeldescription
- the event's description- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
addEvent
public void addEvent(Connection conn, int ownerID, String label, String description, boolean commit) throws SQLException, IllegalArgumentException Add a row to the event table, indicating if database changes should be committed.- Parameters:
conn
- the database connectionownerID
- the owner IDlabel
- the event's labeldescription
- the event's descriptioncommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
deleteEvent
Delete a row from the event table.- Parameters:
conn
- the database connectioneventID
- the event ID for the row- Throws:
SQLException
- if an SQL error occurred
-
deleteEvent
Delete rows whose labels match a patter from the event table.- Parameters:
conn
- the database connectionpattern
- a pattern for the event's label- Throws:
SQLException
- if an SQL error occurred
-
deleteEvent
Delete rows whose labels match a patter from the event table, indicating if the deletion is interactive or if all matching rows are to be deleted.- Parameters:
conn
- the database connectionpattern
- a pattern for the event's labelforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
SQLException
- if an SQL error occurred
-
deleteEvent
Delete rows from the event table.- Parameters:
conn
- the database connectioneventIDs
- the event IDs that the rows will match- Throws:
SQLException
- if an SQL error occurred
-
listEventLabels
List the labels for rows in the event table with specified owners- Parameters:
conn
- the database connectionownerID
- the owner ID; -1 for all owners- Returns:
- an array whose contents are string containing labels, after an initial element equal to "[ All ]"
- Throws:
SQLException
- if an SQL error occurred
-
listEventLabeledIDs
List the event labeled IDs for rows in the event table with specified owners- Parameters:
conn
- the database connectionownerID
- the owner ID; -1 for all owners- Returns:
- an array provides the matching event labeled IDs
- Throws:
SQLException
- if an SQL error occurred
-
listEventsForOwner
public Vector<Vector<Object>> listEventsForOwner(Connection conn, int ownerID, boolean full) throws SQLException List the rows in the event table matching specified owner IDs. Each row's entries are in the following order: the event ID, followed by an owner-labeled ID, followed by a label, followed by a description.- Parameters:
conn
- the database connectionownerID
- the owner ID; -1 for all ownersfull
- true if full rows are returned; false if each row contains only an event ID- Returns:
- the table rows matching the specified owners
- Throws:
SQLException
- if an SQL error occurred
-
listEvents
public Vector<Vector<Object>> listEvents(Connection conn, String[] patterns, boolean full) throws SQLException List the rows in the event table matching patterns. Each row's entries are in the following order: the event ID, followed by an owner-labeled ID, followed by a label, followed by a description.- Parameters:
conn
- the database connectionpatterns
- patterns used to match an owner's labelfull
- true if full rows are returned; false if each row contains only an event ID- Returns:
- the table rows matching the specified patterms
- Throws:
SQLException
- if an SQL error occurred
-
listEvents
public Vector<Vector<Object>> listEvents(Connection conn, int[] ids, boolean full) throws SQLException List the rows in the event table matching event IDs. Each row's entries are in the following order: the event ID, followed by an owner-labeled ID, followed by a label, followed by a description.- Parameters:
conn
- the database connectionids
- the event IDs to matchfull
- true if full rows are returned; false if each row contains only an event ID- Returns:
- the table rows matching the specified event IDs
- Throws:
SQLException
- if an SQL error occurred
-
setEvent
public void setEvent(Connection conn, int eventID, int ownerID, String label, String description) throws SQLException Set an event table field.- Parameters:
conn
- the database connectioneventID
- the event IDownerID
- the new owner ID; -1 to ignorelabel
- the new label; null to ignoredescription
- the new description; null to ignore- Throws:
SQLException
- if an SQL error occurred
-
setEvent
public void setEvent(Connection conn, int eventID, int ownerID, String label, String description, boolean commit) throws SQLException Set an event table field, indicating if database changes should be committed.- Parameters:
conn
- the database connectioneventID
- the event IDownerID
- the new owner ID; -1 to ignorelabel
- the new label; null to ignoredescription
- the new description; null to ignorecommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
addEventInstance
public void addEventInstance(Connection conn, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status) throws SQLException, IllegalArgumentException Add a row to the event-instance table.- Parameters:
conn
- the database connectioneventID
- the event IDlocationID
- the location IDpreEventType
- a short description of what a pre-event is; null if there is no pre-eventpreEventOffset
- the pre-event's offset in minutes from the event itself; 0 or negative if there is no pre-eventstartDate
- the starting date for this event instancestartTime
- the starting time for this event instanceendDate
- the ending data for this event instanceendTime
- the ending time for this event instancestatus
- TENTATIVE, CONFIRMED, CANCELLED or null if a status is not explicitly supplied- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
addEventInstance
public void addEventInstance(Connection conn, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status, boolean commit) throws SQLException, IllegalArgumentException Add a row to the event-instance table, indicating if database changes should be committed.- Parameters:
conn
- the database connectioneventID
- the event IDlocationID
- the location IDpreEventType
- a short description of what a pre-event is; null if there is no pre-eventpreEventOffset
- the pre-event's offset in minutes from the event itself; 0 or negative if there is no pre-eventstartDate
- the starting date for this event instancestartTime
- the starting time for this event instanceendDate
- the ending data for this event instanceendTime
- the ending time for this event instancestatus
- TENTATIVE, CONFIRMED, CANCELLED or null if a status is not explicitly suppliedcommit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
deleteEventInstance
Delete a row from the event-instance table.- Parameters:
conn
- the database connectioninstanceID
- the event-instance ID for the row to delete- Throws:
SQLException
- if an SQL error occurred
-
deleteCancelledEventInstances
Delete all rows from the event-instance table whose state is "CANCELLED".- Parameters:
conn
- the database connection- Throws:
SQLException
- if an SQL error occurred
-
deleteEventInstances
Delete rows from the event-instance table.- Parameters:
conn
- the database connectioninstanceIDs
- the event-instance IDs for the rows to delete- Throws:
SQLException
- if an SQL error occurred
-
listInstanceLabeledIDs
public ECDB.InstanceLabeledID[] listInstanceLabeledIDs(Connection conn, int ownerID, int eventID, int locationID) throws SQLException List instance labeled IDs for the event-instance table. Normally either the ownerID or the eventID (or both) will be -1: an eventID matches only a single ownerID, so providing both is redundant.- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownereventID
- an event; -1 for any eventlocationID
- an location ID; -1 for any location- Returns:
- an array of instance labeled IDs
- Throws:
SQLException
- if an SQL error occurred
-
listInstanceLabeledIDs
public ECDB.InstanceLabeledID[] listInstanceLabeledIDs(Connection conn, int ownerID, int eventID, int locationID, boolean all) throws SQLException List instance labeled IDs for the event-instance table, optionally starting with an element matching all event instances. Normally either the ownerID or the eventID (or both) will be -1: an eventID matches only a single ownerID, so providing both is redundant. An instance labeled ID that represents all event instances has an ID equal to -1 and a label with some appropraite text ("[ All Instances ]").- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownereventID
- an event; -1 for any eventlocationID
- an location ID; -1 for any locationall
- true if the first instance indicates all instances; false otherwise- Returns:
- an array of instance labeled IDs
- Throws:
SQLException
- if an SQL error occurred
-
listEventInstances
public Vector<Vector<Object>> listEventInstances(Connection conn, int ownerID, int eventID, int locationID, boolean full) throws SQLException List rows from the event-instance table. Each row of the table contains the following publiclly readable fields: an instance ID, an event labeled ID, a location labeled ID, a pre-event type, a pre-event offset, a start data, a start time, and end date, and end time, and a status field- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownereventID
- an event; -1 for any eventlocationID
- an location ID; -1 for any locationfull
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- a vector of rows
- Throws:
SQLException
- if an SQL error occurred
-
listEventInstances
public Vector<Vector<Object>> listEventInstances(Connection conn, int ownerID, int locationID, Date startDate, Time startTime, String status, boolean full) throws SQLException List rows from the event-instance table matching additional criteria. Each row of the table contains the following publiclly readable fields: an instance ID, an event labeled ID, a location labeled ID, a pre-event type, a pre-event offset, a start data, a start time, and end date, and end time, and a status field- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownerlocationID
- an location ID; -1 for any locationstartDate
- the start date for an event instance; null for anystartTime
- the start time for an event instance; null for anyfull
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- a vector of rows
- Throws:
SQLException
- if an SQL error occurred
-
listEventInstances
public Vector<Vector<Object>> listEventInstances(Connection conn, int[] ids, boolean full) throws SQLException List rows from the event-instance table for a series of instance IDs. Each row of the table contains the following publiclly readable fields: an instance ID, an event labeled ID, a location labeled ID, a pre-event type, a pre-event offset, a start data, a start time, and end date, and end time, and a status field- Parameters:
conn
- the database connectionids
- the instance IDs of the rows to includefull
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- a vector of rows
- Throws:
SQLException
- if an SQL error occurred
-
listEventInstance
public Vector<Vector<Object>> listEventInstance(Connection conn, int instanceID, boolean full) throws SQLException, IllegalArgumentException List rows from the event-instance table for a series of instance IDs. Each row of the table contains the following publiclly readable fields: an instance ID, an event labeled ID, a location labeled ID, a pre-event type, a pre-event offset, a start data, a start time, and end date, and end time, and a status field- Parameters:
conn
- the database connectioninstanceID
- the instance ID the row to include.full
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- a vector of rows
- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
setEventInstance
public void setEventInstance(Connection conn, int instanceID, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status) throws SQLException, IllegalArgumentException Set fields in a row of the event table.- Parameters:
conn
- the database connectioninstanceID
- an instance ID for the row to modifiedeventID
- an event; -1 if ignoredlocationID
- an location ID; -1 if ignoredpreEventType
- a descriptive type for a pre-event; null if ignoredpreEventOffset
- the pre-event offset in minutes; -1 if ignoredstartDate
- the start date for an event instance; null if ignoredstartTime
- the start time for an event instance; null if ignoredendDate
- the end date for an event instance; null if ignoredendTime
- the end time for an event instance; null if ignored- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
setEventInstance
public void setEventInstance(Connection conn, int instanceID, int eventID, int locationID, String preEventType, int preEventOffset, Date startDate, Time startTime, Date endDate, Time endTime, String status, boolean commit) throws SQLException, IllegalArgumentException Set fields in a row of the event table, indicating if database changes should be committed.- Parameters:
conn
- the database connectioninstanceID
- an instance ID for the row to modifiedeventID
- an event; -1 if ignoredlocationID
- an location ID; -1 if ignoredpreEventType
- a descriptive type for a pre-event; null if ignoredpreEventOffset
- the pre-event offset in minutes; -1 if ignoredstartDate
- the start date for an event instance; null if ignoredstartTime
- the start time for an event instance; null if ignoredendDate
- the end date for an event instance; null if ignoredendTime
- the end time for an event instance; null if ignoredcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
addSeries
public void addSeries(Connection conn, int ownerID, String label) throws SQLException, IllegalArgumentException Add a series to the series table.- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownerlabel
- a short string naming the series- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
addSeries
public void addSeries(Connection conn, int ownerID, String label, boolean commit) throws SQLException, IllegalArgumentException Add a series to the series table, indicating if database changes should be committed.- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownerlabel
- a short string naming the seriescommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
deleteSeries
Delete a series from the series table.- Parameters:
conn
- the database connectionseriesID
- the series ID- Throws:
SQLException
- if an SQL error occurred
-
deleteSeries
Delete a series from the series table. If there are multiple matches, the deletion will be interactive.- Parameters:
conn
- the database connectionownerID
- an ownerID used to search for a seriespattern
- a pattern used to match the label for the series- Throws:
SQLException
- if an SQL error occurred
-
deleteSeries
public void deleteSeries(Connection conn, int ownerID, String pattern, boolean force) throws SQLException Delete a series from the series table, indicating if the deletions are interactive.- Parameters:
conn
- the database connectionownerID
- an ownerID used to search for a series; -1 for anypattern
- a pattern used to match the label for the series; null for any labelforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
SQLException
- if an SQL error occurred
-
deleteSeries
Delete a series from the series table.- Parameters:
conn
- the database connectionownerIDs
- a list of owner IDs for those series that should be deleted- Throws:
SQLException
- if an SQL error occurred
-
listSeriesLabels
List the labels for a series.- Parameters:
conn
- the database connectionownerID
- the ownerID for the series that should be listed; -1 for any ownerall
- true if there is an entry for all series matching the specified owner (or all owners); false if there is no entry for all series- Throws:
SQLException
- if an SQL error occurred
-
listSeriesLabeledIDs
public ECDB.SeriesLabeledID[] listSeriesLabeledIDs(Connection conn, int ownerID) throws SQLException List the series label IDs for a series.- Parameters:
conn
- the database connectionownerID
- the ownerID for the series that should be listed; -1 for any owner- Throws:
SQLException
- if an SQL error occurred
-
listSeries
public Vector<Vector<Object>> listSeries(Connection conn, int ownerID, String pattern, boolean full) throws SQLException List rows from the series table. A row may contain the following fields: a series ID, followed by an owner ID, followed by a label.- Parameters:
conn
- the database connectionownerID
- the ownerID for the series that should be listed; -1 for any ownerpattern
- a pattern used to match the label for the series; null for any labelfull
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- selected rows from the series table
- Throws:
SQLException
- if an SQL error occurred
-
getSeriesLabeledID
public ECDB.SeriesLabeledID getSeriesLabeledID(Connection conn, int seriesID, boolean withOwner) throws SQLException Get the series labeled ID for an entry in the series table.- Parameters:
conn
- the database connectionseriesID
- the series IDwithOwner
- true if the owner label should be inlcuded in the labeled ID; false if just the series label should be included- Returns:
- a series labeled ID for the specified series ID
- Throws:
SQLException
- if an SQL error occurred
-
listSeries
public Vector<Vector<Object>> listSeries(Connection conn, int[] ids, boolean full) throws SQLException List rows in the series table that match specific series IDs.- Parameters:
conn
- the database connectionids
- the series IDs for the series to listfull
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- a series labeled ID for the specified series ID
- Throws:
SQLException
- if an SQL error occurred
-
listSeries
public Vector<Vector<Object>> listSeries(Connection conn, int seriesID, boolean full) throws SQLException List rows in the series table that match a specific series ID, or optionally all series IDs.- Parameters:
conn
- the database connectionseriesID
- the series ID; -1 for all series IDsfull
- true if all publicly readable fields are include; false if a row contains only the instance ID field- Returns:
- rows that match the specified series IDs
- Throws:
SQLException
- if an SQL error occurred
-
findSeries
public int findSeries(Connection conn, int ownerID, String pattern) throws SQLException, IllegalArgumentException Find a series ID given an owner ID and a pattern used to match labels.- Parameters:
conn
- the database connectionownerID
- the ownerID for the series that should be listed; -1 if ignoredpattern
- a pattern used to match labels- Returns:
- the series ID; -1 if there was not a match
- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
setSeries
Set fields for a row in the series table.- Parameters:
conn
- the database connectionseriesID
- the series ID for the rowownerID
- the new ownerID; -1 if ignoredlabel
- the new label; null if ignored- Throws:
SQLException
- if an SQL error occurred
-
setSeries
public void setSeries(Connection conn, int seriesID, int ownerID, String label, boolean commit) throws SQLException Set fields for a row in the series table, optionally committing database changes.- Parameters:
conn
- the database connectionseriesID
- the series ID for the rowownerID
- the new ownerID; -1 if ignoredlabel
- the new label; null if ignoredcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurred
-
addSeriesInstance
public void addSeriesInstance(Connection conn, int seriesID, int instanceID) throws SQLException, IllegalArgumentException Add a row to the series-instance table.- Parameters:
conn
- the database connectionseriesID
- the series ID for the new rowinstanceID
- the instanceID for the new row- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
addSeriesInstance
public void addSeriesInstance(Connection conn, int seriesID, int instanceID, boolean commit) throws SQLException, IllegalArgumentException Add a row to the series-instance table, indicating if database changes should be committed..- Parameters:
conn
- the database connectionseriesID
- the series ID for the new rowinstanceID
- the instanceID for the new rowcommit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
deleteSeriesInstance
Delete rows from the series-instance table.- Parameters:
conn
- the database connectionseriesID
- the series ID for the row; -1 for anyinstanceID
- the instanceID for the row; -1 for any- Throws:
SQLException
- if an SQL error occurred
-
deleteSeriesInstance
public void deleteSeriesInstance(Connection conn, int seriesID, int instanceID, boolean force) throws SQLException Delete rows from the series-instance table, indicating if multiple deletions should be done interactively.- Parameters:
conn
- the database connectionseriesID
- the series ID for the row; -1 for anyinstanceID
- the instanceID for the row; -1 for anyforce
- true if all entries that match the pattern should be automatically deleted; false if the deletion is interactive- Throws:
SQLException
- if an SQL error occurred
-
listSeriesInstance
public Vector<Vector<Object>> listSeriesInstance(Connection conn, int seriesID, int instanceID, boolean full) throws SQLException List rows from the series-instance table. Each row in the table contains a series ID followed by am instance ID.- Parameters:
conn
- the database connectionseriesID
- the series ID for a row; -1 if ignoredinstanceID
- the instanceID for a row; -1 if ignoredfull
- true if the IDs are returned as labeled ids; false if returned as integers- Returns:
- a table of rows
- Throws:
SQLException
- if an SQL error occurred
-
listSeriesInstanceByOwner
public Vector<Vector<Object>> listSeriesInstanceByOwner(Connection conn, int seriesID, int ownerID, boolean full) throws SQLException List rows from the series-instance table by owner. Each row in the table contains a series ID followed by am instance ID.- Parameters:
conn
- the database connectionseriesID
- the series ID for a row; -1 if ignoredownerID
- the owner id for a row; -1 if ignoredfull
- true if the IDs are returned as labeled ids; false if returned as integers- Returns:
- a table of rows
- Throws:
SQLException
- if an SQL error occurred
-
addAttendee
public void addAttendee(Connection conn, int userID, int instanceID, boolean attendingPreEvent, int seriesID) throws SQLException, IllegalArgumentException Add a row to the attendee table.- Parameters:
conn
- the database connectionuserID
- the userID for the new rowinstanceID
- the instance ID for the newattendingPreEvent
- true if the user will attend any pre-event for the instance; false otherwiseseriesID
- the ID; -1 if there is none for the new row- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
addAttendee
public void addAttendee(Connection conn, int userID, int instanceID, boolean attendingPreEvent, int seriesID, boolean commit) throws SQLException, IllegalArgumentException Add a row to the attendee table, indicating if database changes should be commmitted.- Parameters:
conn
- the database connectionuserID
- the userID for the new rowinstanceID
- the instance ID for the newattendingPreEvent
- true if the user will attend any pre-event for the instance; false otherwiseseriesID
- the ID; -1 if there is none for the new rowcommit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
deleteAttendee
public void deleteAttendee(Connection conn, int userID, int instanceID, String attendeeState, int seriesID, boolean force) throws SQLException Delete one or more rows from the attendee table.- Parameters:
conn
- the database connectionuserID
- the userID for a row; -1 for anyinstanceID
- the instance ID for a row; -1 for anyattendeeState
- the state of an attendee (ACTIVE, CANCELLING, or CANCELLED) with null implying CANCELLED.seriesID
- the ID; -1 for anyforce
- true if all entries that match should be automatically deleted; false if the deletion is interactive when more than one rows were selected- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
listAttendees
public Vector<Vector<Object>> listAttendees(Connection conn, int userID, int instanceID, int seriesID, String attendeeState, boolean full) throws SQLException List attendees The fields listed are in the following order: userID, instanceID, attendeeState, attendingPreEvent, and seriesID- Parameters:
conn
- the database connectionuserID
- the userID for a row; -1 for anyinstanceID
- the instance ID for a row; -1 for anyseriesID
- the ID; -1 for anyattendeeState
- the state of an attendee (ACTIVE, CANCELLING, or CANCELLED) with null implying CANCELLED.full
- true if integer values are represented as labeled ids and the attendeeState as an enum; false if the values are integers and strings .- Throws:
SQLException
- if an SQL error occurred
-
setAttendee
public void setAttendee(Connection conn, int userID, int instanceID, String attendeeState, int seriesID) throws SQLException, IllegalArgumentException Set fields in a row of the attendee table.- Parameters:
conn
- the database connectionuserID
- the userID for a rowinstanceID
- the instance ID for a rowseriesID
- the new series ID; -1 to ignoreattendeeState
- the new state of an attendee (ACTIVE, CANCELLING, or CANCELLED); null to ignore.- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
setAttendee
public void setAttendee(Connection conn, int userID, int instanceID, String attendeeState, int seriesID, boolean commit) throws SQLException, IllegalArgumentException Set fields in a row of the attendee table. This method can change the attendeeState or the seriesID fields.- Parameters:
conn
- the database connectionuserID
- the userID for a rowinstanceID
- the instance ID for a rowseriesID
- the new series ID; -1 to ignoreattendeeState
- the new state of an attendee (ACTIVE, CANCELLING, or CANCELLED); null to ignore.commit
- true if the new changes should be committed; false otherwise- Throws:
IllegalArgumentException
- if an argument is not allowedSQLException
- if an SQL error occurred
-
getInstanceCount
public int getInstanceCount(Connection conn, int ownerID, int eventID, int locationID, int instanceID) throws SQLException Count the number of rows in the attendee with an instance id that matches an event instance with a specified location and event ID, where the corresponding event has a specified owner.- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownereventID
- an event; -1 for any eventlocationID
- an location ID; -1 for any locationinstanceID
- an instance ID; -1 for any instance- Returns:
- the number of rows in the attendee with an instance id that matches and event instance with a specified location ane event ID, where the corresponding event has a specified owner
- Throws:
SQLException
- if an SQL error occurred
-
getNonAttendees
public Vector<ECDB.UserCalendars> getNonAttendees(Connection conn, int ownerID, int eventID, int locationID, int instanceID, boolean forEmail) throws SQLException Get a list of UserCalendar objects, each associated with a distinct user ID for users not attending a specified set of event instances. The userCalendar objects returned do not contain calendars.- Parameters:
conn
- the database connectionownerID
- an owner ID; -1 for any ownereventID
- an event; -1 for any eventlocationID
- an location ID; -1 for any locationinstanceID
- an instance ID; -1 for any instanceforEmail
- true for calendars associated with email; false for text messages- Returns:
- the UserCalendar objects
- Throws:
SQLException
- if an SQL error occurred
-
getCalendars
public Vector<ECDB.UserCalendars> getCalendars(Connection conn, int userID, int ownerID, int eventID, boolean calendarForEmail) throws SQLException Get a list of UserCalendar objects, each associated with a distinct user ID for users attending a specified set of event instances. The corresponding calendars are included inthe UserCalendar objects.- Parameters:
conn
- the database connectionuserID
- the userID; -1 for any userownerID
- an owner ID; -1 for any ownereventID
- an event; -1 for any eventcalendarForEmail
- true for calendars associated with email; false for text messages- Returns:
- the UserCalendar objects
- Throws:
SQLException
- if an SQL error occurred
-
applySeries
public void applySeries(Connection conn, int userID, int seriesID) throws SQLException, IllegalArgumentException Apply a series to a user- Parameters:
conn
- the database connectionuserID
- the userIDseriesID
- the series ID- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
applySeries
public void applySeries(Connection conn, int userID, int seriesID, boolean commit) throws SQLException, IllegalArgumentException Apply a series to a user, indicating if database changes should be committed.- Parameters:
conn
- the database connectionuserID
- the userIDseriesID
- the series IDcommit
- true if the new changes should be committed; false otherwise- Throws:
SQLException
- if an SQL error occurredIllegalArgumentException
- if an argument is not allowed
-
getHeadingVector
-
getHeading
-
copyToClipboard
Copy a series of calendars to the window-system's clipboard.- Parameters:
calendars
- the calendarsheadless
- true if ECDB is being run from the command line and will not open any windows, even if a window system is present- Throws:
IOException
- if an IO error occurred
-
saveToDirectory
Copy a series of calendars to a directory.- Parameters:
dir
- the directorycalendars
- the calendars- Throws:
IOException
- if an IO error occurred
-
setSubject
Set the subject for a message (email or MMS via a gateway).- Parameters:
subject
- the subject line
-
getSubject
Get the current subject line.- Returns:
- the subject line
-
setMediaType
Set the media type for a message (email or MMS via a gateway).- Parameters:
mediaType
- the media type (e.g., text/html)
-
getMediaType
Get the media type for a message.- Returns:
- the media type (e.g., text/html)
-
setAltMediaType
Set the alternative media type for a message (email or MMS via a gateway).- Parameters:
mediaType
- the media type (e.g., text/plain)
-
getAltMediaType
Get the alternative media type for a message.- Returns:
- the media type (e.g., text/plain)
-
setTemplateURL
Set the URL for the message template.- Parameters:
templateURL
- the url
-
getTemplateURL
Get the URL for the message template.- Returns:
- the url
-
setAltTemplateURL
Set the URL for the alternative message template.- Parameters:
templateURL
- the url
-
getAltTemplateURL
Get the URL for the alternative message template.- Returns:
- the url
-
getPreflight
public boolean getPreflight()Get the preflight mode.- Returns:
- true if the messages should be previewed before being sent; false otherwise
-
setPreflight
public void setPreflight(boolean value) Set the preflight mode.- Parameters:
value
- true if the messages should be previewed before being sent; false otherwise
-
sendViaEmail
public static boolean sendViaEmail(ECDB ecdb, Connection conn, Vector<ECDB.UserCalendars> vector, boolean suppressCalendars, JFrame frame, boolean preflight) throws Exception, SQLException Send a calendar appointment or message via email, either to an email address. For MMS, the recipient address is that for a gateway.- Parameters:
ecdb
- the instance of ECDB to use.conn
- a database connection obtained from ecdbvector
- a vector of UserCalendar objects, each containing calendars and data needed to identify recipients and format messagessuppressCalendars
- true if calendars should not be attached to a message; false otherwiseframe
- a JFrame on which any dialog boxes should be centered; null if there are nonepreflight
- true if the user should be shown a representation of the messages in a web browser (e.g., to verify that the messages are formated or created as desired); false otherwise- Throws:
SQLException
- if an SQL error occurredException
- an error occurred
-
dryrunForSend
public static void dryrunForSend(ECDB ecdb, Connection conn, PrintWriter out, Vector<ECDB.UserCalendars> vector, boolean forEmail, boolean suppressCalendars) throws IOException, SQLException Send a calendar appointment or message via email, either to an email address. For MMS, the recipient address is that for a gateway.- Parameters:
ecdb
- the instance of ECDB to use.conn
- a database connection obtained from ecdbout
- the print stream on which the message will be displayedvector
- a vector of UserCalendar objects, each containing calendars and data needed to identify recipients and format messagesforEmail
- true if the message should be formatted as an email messages; false if it should be formatted as an MMS messagesuppressCalendars
- true if calendars should not be attached to a message; false otherwise- Throws:
SQLException
- if an SQL error occurredIOException
- an IO error occurred
-
main
Main program for ECDB when used as an application instead of purely as part of a class library.
-