Compoze Software, Inc.

com.compoze.exchange
Class Task


java.lang.Object

  |

  +--com.compoze.exchange.AbstractItem

        |

        +--com.compoze.exchange.Message

              |

              +--com.compoze.exchange.Task

All Implemented Interfaces:
java.io.Serializable

public class Task
extends Message
implements java.io.Serializable

This class is an Exchange task. Task instances are obtained from the Tasks class. Methods that access properites on the class require that the properties were loaded beforehand, when the message was initially retrieved. Any methods in this class that begin with the string server make a query to the server, and require that the PropertyKey.MESSAGE_ID and PropertyKey.MESSAGE_TYPE properties to be loaded beforehand. Any additional property requirements are indicated on each individual method.

See Also:
Serialized Form

Field Summary
static PropertyKey[] ALL_PROPS
          Contains an array of all of the properties available on a task.
 
Fields inherited from class com.compoze.exchange.AbstractItem
m_props, m_session
 
Method Summary
 int getActualWork()
          Gets the actual work of the task.
 java.lang.String getBillingInfo()
          Gets the billing info of the task.
 java.lang.String[] getCompanies()
          Gets the companies of the task.
 java.lang.String[] getContactNames()
          Gets the contact names of the task.
 java.util.Date getDateCompleted()
          Gets the date completed of the task.
 java.util.Calendar getDueCalendar()
          Gets the due date of the task as a calendar object configured to the GMT time zone.
 java.util.Date getDueDate()
          Gets the due date of the task.
 boolean getHasReminder()
          Gets whether the task has a reminder.
 java.lang.String getMileage()
          Gets the mileage of the task.
 double getPercentComplete()
          Gets the percent complete of the task.
 TaskRecurrencePattern getRecurrencePattern()
          Gets the recurrence pattern.
 java.util.Date getReminderDate()
          Gets the date for the reminder.
 java.util.Calendar getStartCalendar()
          Gets the start date of the task as a calendar object configured to the GMT time zone.
 java.util.Date getStartDate()
          Gets the start date of the task.
 TaskStatus getTaskStatus()
          Gets the status of the task.
 int getTotalWork()
          Gets the total work of the task.
 boolean isComplete()
          Checks the complete flag of the task.
 boolean isCurrentUserRecipient()
          Determines if the current user is a recipient of the message.
 boolean isRecurring()
          Gets whether the task is recurring or not.
 boolean isTaskRequest()
          Determines if a task is a task request.
 boolean isTeamTask()
          Gets whether or not not this task is a "team task".
 void serverDecline(PropertyValue[] propValues, boolean bSend, boolean bSaveInSent)
          Declines a task that has already been accepted.
 void serverMarkComplete(PropertyValue[] propValues, boolean bSend, boolean bSaveInSent)
          Marks this task complete and creates a message to the task originator if this task was delegated through a task request.
 void serverSkip()
          Sets the task due date to the next available due date (only for recurring, non-regenerating tasks).
 void serverUpdate(boolean bSaveSent)
          Updates a task and sends a task request update if applicable.
 void setActualWork(int iActualWork)
          Sets the actual work of the task.
 void setBillingInfo(java.lang.String sBillingInfo)
          Sets the billing info of the task.
 void setCompanies(java.lang.String[] companies)
          Sets the companies of the task.
 void setComplete(boolean bFlag)
          Sets the complete flag of the task.
 void setContactNames(java.lang.String[] contactNames)
          Sets the contact names of the task.
 void setDateCompleted(java.util.Date dateCompleted)
          Sets the date completed of the task.
 void setDateCompleted(int iMonth, int iDay, int iYear)
          Sets the date completed.
 void setDueDate(java.util.Date dueDate)
          Sets the due date of the task.
 void setDueDate(int iMonth, int iDay, int iYear)
          Sets the due date of the task.
 void setHasReminder(boolean bSetReminder)
          Sets whether the task has a reminder.
 void setMileage(java.lang.String sMileage)
          Sets the mileage of the task.
 void setPercentComplete(double dPercentComplete)
          Sets the percent complete of the task.
 void setRecurrencePattern(TaskRecurrencePattern pattern)
          Sets the recurrence pattern for this task (set to TaskRecurrencePattern.NONE to clear).
 void setReminderDate(java.util.Date date)
          Sets the date for the reminder.
 void setSender(AddressEntry addressEntry)
          This method is not allowed on this Message type.
 void setStartDate(java.util.Date startDate)
          Sets the start date of the task.
 void setStartDate(int iMonth, int iDay, int iYear)
          Sets the start date of the task.
 void setTaskStatus(TaskStatus status)
          Sets the status of the task.
 void setTotalWork(int iTotalWork)
          Sets the total work of the task.
 
Methods inherited from class com.compoze.exchange.Message
getActionStatus, getAttachmentCount, getAttachmentInfo, getAttachmentInfoArray, getCategories, getConversationIndex, getConversationTopic, getDeliveryReceipt, getEncrypted, getFlagStatus, getFlagText, getFolderID, getFolderName, getHtml, getHtml, getID, getImportance, getMessageType, getNormalizedSubject, getReadReceipt, getRecipientInfo, getRecipientInfoArray, getRichTextFormat, getRichTextFormatAsHtml, getRichTextFormatAsHtml, getRichTextFormatAsPlain, getSender, getSenderName, getSensitivity, getSent, getSigned, getSize, getStoreID, getSubject, getSubject, getSubmitted, getText, getTimeCreated, getTimeExpired, getTimeLastModified, getTimeReceived, getTimeReceivedString, getTimeSent, getUnread, hasAttachment, serverAddAttachment, serverCopyTo, serverDelete, serverDelete, serverDeleteAttachment, serverGetAttachment, serverGetAttachments, serverMoveTo, serverMoveTo, serverResolveRecipients, serverUpdate, serverUpdate, serverUpdate, setActionStatus, setCategories, setConversationIndex, setConversationTopic, setDeliveryReceipt, setEncrypted, setFlagStatus, setFlagText, setFlagText, setHtml, setImportance, setMessageType, setReadReceipt, setRichTextFormat, setSensitivity, setSent, setSigned, setSubject, setSubmitted, setText, setTimeExpired, setTimeReceived, setTimeSent, setUnread, toString
 
Methods inherited from class com.compoze.exchange.AbstractItem
get, getBoolean, getByteArray, getDate, getDouble, getInt, getInvalidPropertyValues, getPropertyKeys, getString, getStringArray, getUpdatedPropertyValues, set, setBoolean, setByteArray, setDate, setDouble, setInt, setString, setStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_PROPS


public static final PropertyKey[] ALL_PROPS
Contains an array of all of the properties available on a task. Although this can be used when specifying property keys to retrieve, it's preferable to only specify the keys that are required as the number of properties that are pulled back from the server has a direct impact on performance.
Method Detail

getBillingInfo


public java.lang.String getBillingInfo()
                                throws ExchangeException
Gets the billing info of the task.
Returns:
the billing info of the task
See Also:
PropertyKey.BILLING_INFO

setBillingInfo


public void setBillingInfo(java.lang.String sBillingInfo)
                    throws ExchangeException
Sets the billing info of the task.
Parameters:
sBillingInfo - the billing info of the task
See Also:
PropertyKey.BILLING_INFO

getMileage


public java.lang.String getMileage()
                            throws ExchangeException
Gets the mileage of the task.
Returns:
the mileage of the task
See Also:
PropertyKey.MILEAGE

setMileage


public void setMileage(java.lang.String sMileage)
                throws ExchangeException
Sets the mileage of the task.
Parameters:
sMileage - the mileage of the task
See Also:
PropertyKey.MILEAGE

getCompanies


public java.lang.String[] getCompanies()
                                throws ExchangeException
Gets the companies of the task.
Returns:
the companies of the task
See Also:
PropertyKey.COMPANIES

setCompanies


public void setCompanies(java.lang.String[] companies)
                  throws ExchangeException
Sets the companies of the task.
Parameters:
companies - the companies of the task
See Also:
PropertyKey.COMPANIES

getContactNames


public java.lang.String[] getContactNames()
                                   throws ExchangeException
Gets the contact names of the task.
Returns:
the contact names of the task
See Also:
PropertyKey.CONTACT_NAMES

setContactNames


public void setContactNames(java.lang.String[] contactNames)
                     throws ExchangeException
Sets the contact names of the task.
Parameters:
contactNames - the contact names of the task
See Also:
PropertyKey.CONTACT_NAMES

getStartDate


public java.util.Date getStartDate()
                            throws ExchangeException
Gets the start date of the task.
Returns:
the start date of the task (use a GMT calendar set to this date to retrieve the correct month, day and year)
See Also:
PropertyKey.TASK_START_DATE, (Date), (int, int, int)

getStartCalendar


public java.util.Calendar getStartCalendar()
                                    throws ExchangeException
Gets the start date of the task as a calendar object configured to the GMT time zone.
Returns:
the start date of the task in a calendar object configured to the GMT time zone (time of day should always be 12AM GMT for proper operation in Outlook). The YEAR, MONTH and DATE fields of this calendar object should be used to present the date to the user.
See Also:
PropertyKey.TASK_START_DATE

setStartDate


public void setStartDate(java.util.Date startDate)
                  throws ExchangeException
Sets the start date of the task. The start date and due date properties are stored in Outlook different from every other property in that they are kept in GMT and do not change with the time zone. Therefore, in order for proper compatibility with Outlook the passed in Date object should have been created by a GMT calendar with HOUR_OF_DAY and less significant fields set to 0.
Parameters:
startDate - the start date of the task
See Also:
PropertyKey.TASK_START_DATE

setStartDate


public void setStartDate(int iMonth,
                         int iDay,
                         int iYear)
                  throws ExchangeException
Sets the start date of the task. The month, day and year are used to create a Date object whose time is 12AM GMT on the date that's specified, which is what Outlook expects.
Parameters:
iMonth - the month (0 == January)
iDay - the day of the month (first day of month is 1)
iYear - the year

getDueDate


public java.util.Date getDueDate()
                          throws ExchangeException
Gets the due date of the task.
Returns:
the due date of the task (use a GMT calendar set to this date to retrieve the correct month, day and year)
See Also:
PropertyKey.TASK_DUE_DATE, (Date), (int, int, int)

getDueCalendar


public java.util.Calendar getDueCalendar()
                                  throws ExchangeException
Gets the due date of the task as a calendar object configured to the GMT time zone.
Returns:
the due date of the task in a calendar object configured to the GMT time zone (time of day should always be 12AM GMT for proper operation in Outlook). The YEAR, MONTH and DATE fields of this calendar object should be used to present the date to the user.
See Also:
PropertyKey.TASK_DUE_DATE

setDueDate


public void setDueDate(java.util.Date dueDate)
                throws ExchangeException
Sets the due date of the task. The start date and due date properties are stored in Outlook different from every other property in that they are kept in GMT and do not change with the time zone. Therefore, in order for proper compatibility with Outlook the passed in Date object should have been created by a GMT calendar with HOUR_OF_DAY and less significant fields set to 0.
Parameters:
dueDate - the due date of the task
See Also:
PropertyKey.TASK_DUE_DATE, (int, int, int)

setDueDate


public void setDueDate(int iMonth,
                       int iDay,
                       int iYear)
                throws ExchangeException
Sets the due date of the task. The month, day and year are used to create a Date object whose time is 12AM GMT on the date that's specified, which is what Outlook expects.
Parameters:
iMonth - the month (0 == January)
iDay - the day of the month (first day of month is 1)
iYear - the year

getDateCompleted


public java.util.Date getDateCompleted()
                                throws ExchangeException
Gets the date completed of the task.
Returns:
the date completed of the task
See Also:
PropertyKey.TASK_DATE_COMPLETED

setDateCompleted


public void setDateCompleted(java.util.Date dateCompleted)
                      throws ExchangeException
Sets the date completed of the task. For compatibility with Outlook, the date completed property should be set to 12AM midnight of the desired date in the user's local time zone.
Parameters:
dateCompleted - the date completed of the task (null for not complete)
See Also:
PropertyKey.TASK_DATE_COMPLETED

setDateCompleted


public void setDateCompleted(int iMonth,
                             int iDay,
                             int iYear)
                      throws ExchangeException
Sets the date completed. The month, day and year are used to create a Date object whose time is 12AM GMT on the date that's specified, which is what Outlook expects.
Parameters:
iMonth - the month (0 == January)
iDay - the day of the month (first day of month is 1)
iYear - the year

getPercentComplete


public double getPercentComplete()
                          throws ExchangeException
Gets the percent complete of the task.
 examples:
 100% = 1.000000e+000
 25% = 2.500000e-001
 10% = 1.000000e-001
 5% = 5.000000e-002
 2.5% = 2.500000e-002
 
Returns:
the percent complete
See Also:
PropertyKey.TASK_PERCENT_COMPLETE

setPercentComplete


public void setPercentComplete(double dPercentComplete)
                        throws ExchangeException
Sets the percent complete of the task.
 examples:
 100% = 1.000000e+000
 25% = 2.500000e-001
 10% = 1.000000e-001
 5% = 5.000000e-002
 2.5% = 2.500000e-002
 
Parameters:
dPercentComplete - the percent complete
See Also:
PropertyKey.TASK_PERCENT_COMPLETE

getTotalWork


public int getTotalWork()
                 throws ExchangeException
Gets the total work of the task.
Returns:
the total work of the task (in minutes)
See Also:
PropertyKey.TASK_TOTAL_WORK

setTotalWork


public void setTotalWork(int iTotalWork)
                  throws ExchangeException
Sets the total work of the task.
Parameters:
iTotalWork - the total work of the task (in minutes)
See Also:
PropertyKey.TASK_TOTAL_WORK

getActualWork


public int getActualWork()
                  throws ExchangeException
Gets the actual work of the task.
Returns:
the actual work of the task (in minutes)
See Also:
PropertyKey.TASK_ACTUAL_WORK

setActualWork


public void setActualWork(int iActualWork)
                   throws ExchangeException
Sets the actual work of the task.
Parameters:
iActualWork - the actual work of the task (in minutes)
See Also:
PropertyKey.TASK_ACTUAL_WORK

getTaskStatus


public TaskStatus getTaskStatus()
                         throws ExchangeException
Gets the status of the task.
Returns:
the status of the task
See Also:
PropertyKey.TASK_STATUS

setTaskStatus


public void setTaskStatus(TaskStatus status)
                   throws ExchangeException
Sets the status of the task. If the status is set to TaskStatus.COMPLETED, the task complete flag is also set to true.
Parameters:
status - the status of the task (may not be null)
See Also:
PropertyKey.TASK_STATUS, setComplete(boolean)

setComplete


public void setComplete(boolean bFlag)
                 throws ExchangeException
Sets the complete flag of the task.
Parameters:
bFlag - the complete flag of the task; true for complete; false otherwise
See Also:
PropertyKey.TASK_COMPLETE

isComplete


public boolean isComplete()
                   throws ExchangeException
Checks the complete flag of the task.
Returns:
true if the task is complete; false otherwise
See Also:
PropertyKey.TASK_COMPLETE

isCurrentUserRecipient


public boolean isCurrentUserRecipient()
                               throws ExchangeException
Determines if the current user is a recipient of the message.
Returns:
true if the current user is a recipient of the message

isRecurring


public boolean isRecurring()
                    throws ExchangeException
Gets whether the task is recurring or not.
Returns:
true if the task is recurring, false if not
See Also:
PropertyKey.TASK_IS_RECURRING

getHasReminder


public boolean getHasReminder()
                       throws ExchangeException
Gets whether the task has a reminder.
Returns:
true if the reminder was set, false otherwise.
See Also:
PropertyKey.TASK_REMINDER_SET

setHasReminder


public void setHasReminder(boolean bSetReminder)
                    throws ExchangeException
Sets whether the task has a reminder.
Parameters:
bSetReminder - set to true to set the reminder, false to unset the reminder.
See Also:
PropertyKey.TASK_REMINDER_SET

getReminderDate


public java.util.Date getReminderDate()
                               throws ExchangeException
Gets the date for the reminder.
See Also:
PropertyKey.TASK_REMINDER_DATE

setReminderDate


public void setReminderDate(java.util.Date date)
                     throws ExchangeException
Sets the date for the reminder.
Parameters:
date - the reminder date
See Also:
PropertyKey.TASK_REMINDER_DATE

setSender


public void setSender(AddressEntry addressEntry)
               throws ExchangeException
This method is not allowed on this Message type.
Overrides:
setSender in class Message
Throws:
ExchangeException - this method is not allowed

isTaskRequest


public boolean isTaskRequest()
                      throws ExchangeException
Determines if a task is a task request. The MESSAGE_TYPE property must be retrieved for this property to return the correct value.
Returns:
true if the task is a task request
See Also:
PropertyKey.MESSAGE_TYPE

serverUpdate


public void serverUpdate(boolean bSaveSent)
                  throws ExchangeException
Updates a task and sends a task request update if applicable. Task updates will never be sent if this task was assigned to at least two recipients. The TASK_IS_TEAM_TASK properties are required for this method to succeed.
Parameters:
bSaveSent - if true, save the task request update message in the sent items folder
See Also:
PropertyKey.TASK_IS_TEAM_TASK

serverMarkComplete


public void serverMarkComplete(PropertyValue[] propValues,
                               boolean bSend,
                               boolean bSaveInSent)
                        throws ExchangeException
Marks this task complete and creates a message to the task originator if this task was delegated through a task request. A message is only created if this task is a team task that has been delegated to at least 2 recipients. The TASK_IS_TEAM_TASK, MESSAGE_RECIPIENT_INFO and TASK_IS_RECURRING, TASK_RECURRENCE_PATTERN. properties must be retrieved in for this method to succeed.
Parameters:
propVals - Additional values to set on the notification email that will be generated if this is a team task.
bSend - if true then send the message, otherwise do not.
bSaveInSent - if true then a copy of the sent message in the Sent Items folder.
See Also:
PropertyKey.TASK_IS_TEAM_TASK, PropertyKey.TASK_IS_RECURRING, PropertyKey.MESSAGE_RECIPIENT_INFO

serverSkip


public void serverSkip()
                throws ExchangeException
Sets the task due date to the next available due date (only for recurring, non-regenerating tasks). This method requires TASK_IS_RECURRING and TASK_RECURRENCE_PATTERN properties to be available on the task.
Throws:
ExchangeException - if one of the required properties is not available or there was a problem updating the task or the task is regenerative
See Also:
PropertyKey.TASK_IS_RECURRING, PropertyKey.TASK_RECURRENCE_PATTERN

isTeamTask


public boolean isTeamTask()
                   throws ExchangeException
Gets whether or not not this task is a "team task". Team tasks are defined as tasks that have been delegated by an originator to two or more recipients.
Returns:
true if this task has been delegated to at least two recipients, false otherwise.
Throws:
ExchangeException - if there was a problem retrieving this property
See Also:
PropertyKey.TASK_IS_TEAM_TASK

setRecurrencePattern


public void setRecurrencePattern(TaskRecurrencePattern pattern)
                          throws ExchangeException
Sets the recurrence pattern for this task (set to TaskRecurrencePattern.NONE to clear). This method will also set the isRecurring() property.
Parameters:
pattern - the recurrence pattern to set
Throws:
ExchangeException - if there was an error setting the pattern, or if the pattern was invalid
See Also:
getRecurrencePattern()

getRecurrencePattern


public TaskRecurrencePattern getRecurrencePattern()
                                           throws ExchangeException
Gets the recurrence pattern.
Throws:
ExchangeException - if there was an error getting the pattern, or if the pattern was invalid
See Also:
setRecurrencePattern(TaskRecurrencePattern)

serverDecline


public void serverDecline(PropertyValue[] propValues,
                          boolean bSend,
                          boolean bSaveInSent)
                   throws ExchangeException
Declines a task that has already been accepted. If this is not a team task that has been delegated to at least two recipients, a decline message to the originator will be created. The key MESSAGE_RECIPIENT_INFO is required for this method to succeed.
Parameters:
propValues - the values to use on the message sent to the originator. A message will only be created if this task has been delegated to exactly 1 person.
bSend - if true then send the decline message to the originator.
bSaveInSent - if true then save a copy of the sent message to the originator in the Sent Items folder.
Throws:
ExchangeException - if there was a problem declining the task or sending the decline message.
See Also:
PropertyKey.MESSAGE_RECIPIENT_INFO

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.