microsoft.exchange.webservices.data
Class Contact

java.lang.Object
  extended by microsoft.exchange.webservices.data.ServiceObject
      extended by microsoft.exchange.webservices.data.Item
          extended by microsoft.exchange.webservices.data.Contact

public class Contact
extends Item

Represents a contact. Properties available on contacts are defined in the ContactSchema class.


Constructor Summary
  Contact(ExchangeService service)
          Initializes an unsaved local instance of .
protected Contact(ItemAttachment parentAttachment)
          Initializes a new instance of the class.
 
Method Summary
static Contact bind(ExchangeService service, ItemId id)
          Binds to an existing contact and loads its first class properties.
static Contact bind(ExchangeService service, ItemId id, PropertySet propertySet)
          Binds to an existing contact and loads the specified set of properties.
 java.lang.String getAlias()
          Gets the Alias from the directory
 java.lang.String getAssistantName()
          Gets the contact's assistant name.
 java.util.Date getBirthday()
          Gets the contact's assistant name.
 java.lang.String getBusinessHomePage()
          Gets the business home page of the contact.
 StringList getChildren()
          Gets a list of children for the contact.
 StringList getCompanies()
          Gets a list of companies for the contact.
 java.lang.String getCompanyName()
          Gets the company name of the contact.
 CompleteName getCompleteName()
          Gets the complete name of the contact.
 FileAttachment getContactPictureAttachment()
          Retrieves the file attachment that holds the contact's picture.
 ContactSource getContactSource()
          Gets the source of the contact.
 java.lang.String getDepartment()
          Gets the department of the contact.
 java.lang.String getDirectoryId()
          Gets the DirectoryID as Guid or DN string
 byte[] getDirectoryPhoto()
          Gets the Photo from the directory
 EmailAddressCollection getDirectReports()
          Get the direct reports mailbox information
 java.lang.String getDisplayName()
          Gets the display name of the contact.
 EmailAddressDictionary getEmailAddresses()
          Gets an indexed list of e-mail addresses for the contact.
 java.lang.String getFileAs()
          Gets the name under which this contact is filed as.
 FileAsMapping getFileAsMapping()
          Gets a value indicating how the FileAs property should be automatically calculated.
 java.lang.String getGeneration()
          Gets the generation of the contact.
 java.lang.String getGivenName()
          Gets the given name of the contact.
 java.lang.Boolean getHasPicture()
          Gets a value indicating whether this contact has a picture associated with it.
 ImAddressDictionary getImAddresses()
          Gets an indexed list of Instant Messaging addresses for the contact.
 java.lang.String getInitials()
          Gets the initials of the contact.
 java.lang.String getJobTitle()
          Gets the contact's job title.
 java.lang.String getManager()
          Gets the name of the contact's manager.
 EmailAddress getManagerMailbox()
          Gets the manager mailbox information
 java.lang.String getMiddleName()
          Gets the middle name of the contact.
 java.lang.String getMileage()
          Gets the mileage for the contact.
protected  ExchangeVersion getMinimumRequiredServerVersion()
          Gets the minimum required server version.
 byte[][] getMSExchangeCertificate()
          Gets the MSExchange certificate from the directory
 java.lang.String getNickName()
          Gets the nick name of the contact.
 java.lang.String getNotes()
          Get the Notes from the directory
 java.lang.String getOfficeLocation()
          Gets the location of the contact's office.
 PhoneNumberDictionary getPhoneNumbers()
          Gets an indexed list of phone numbers for the contact.
 java.lang.String getPhoneticFirstName()
          Gets the funn phonetic name from the directory
 java.lang.String getPhoneticFullName()
          Gets the funn phonetic name from the directory
 java.lang.String getPhoneticLastName()
          Gets the phonetic last name from the directory
 PhysicalAddressDictionary getPhysicalAddresses()
          Gets an indexed list of physical addresses for the contact.
 PhysicalAddressIndex getPostalAddressIndex()
          Gets the index of the contact's postal address.
 java.lang.String getProfession()
          Gets the contact's profession.
protected  ServiceObjectSchema getSchema()
          Internal method to return the schema associated with this type of object.
 java.lang.String getSpouseName()
          Gets the name of the contact's spouse.
 java.lang.String getSurname()
          Gets the surname of the contact.
 byte[][] getUserSMIMECertificate()
          Gets the User SMIME certificate from the directory
 java.util.Date getWeddingAnniversary()
          Gets the date of the contact's wedding anniversary.
 void removeContactPicture()
          Removes the contact's picture.
 void setAssistantName(java.lang.String value)
          Sets the assistant name.
 void setBirthday(java.util.Date value)
          Sets the birthday.
 void setBusinessHomePage(java.lang.String value)
          Sets the business home page.
 void setChildren(StringList value)
          Sets the children.
 void setCompanies(StringList value)
          Sets the companies.
 void setCompanyName(java.lang.String value)
          Sets the company name.
 void setContactPicture(byte[] content)
          Sets the contact's picture using the specified byte array.
 void setContactPicture(java.io.InputStream contentStream)
          Sets the contact's picture using the specified stream.
 void setContactPicture(java.lang.String fileName)
          Sets the contact's picture using the specified file.
 void setDepartment(java.lang.String value)
          Sets the department.
 void setDisplayName(java.lang.String value)
          Sets the display name.
 void setFileAs(FileAsMapping value)
          Sets the file as.
 void setFileAs(java.lang.String value)
          Sets the file as.
 void setGeneration(java.lang.String value)
          Sets the generation.
 void setGivenName(java.lang.String value)
          Sets the given name.
 void setInitials(java.lang.String value)
          Sets the initials.
 void setJobTitle(java.lang.String value)
          Sets the job title.
 void setManager(java.lang.String value)
          Sets the manager.
 void setMiddleName(java.lang.String value)
          Sets the middle name.
 void setMileage(java.lang.String value)
          Sets the mileage.
 void setNickName(java.lang.String value)
          Sets the nick name.
 void setOfficeLocation(java.lang.String value)
          Sets the office location.
 void setPostalAddressIndex(PhysicalAddressIndex value)
          Sets the postal address index.
 void setProfession(java.lang.String value)
          Sets the profession.
 void setSpouseName(java.lang.String value)
          Sets the spouse name.
 void setSurname(java.lang.String value)
          Sets the surname.
 void setWeddingAnniversary(java.util.Date value)
          Sets the wedding anniversary.
protected  void validate()
          Validates this instance.
 
Methods inherited from class microsoft.exchange.webservices.data.Item
copy, copy, delete, getAllowedResponseActions, getAttachments, getBody, getCategories, getConversationId, getCulture, getDateTimeCreated, getDateTimeReceived, getDateTimeSent, getDefaultAffectedTaskOccurrences, getDefaultSendCancellationsMode, getDefaultSendInvitationsMode, getDefaultSendInvitationsOrCancellationsMode, getDisplayCc, getDisplayTo, getEffectiveRights, getExtendedProperties, getHasAttachments, getId, getIdPropertyDefinition, getImportance, getInReplyTo, getInternetMessageHeaders, getIsAssociated, getIsDraft, getIsFromMe, getIsNew, getIsReminderSet, getIsResend, getIsSubmitted, getIsTimeZoneHeaderRequired, getIsUnmodified, getItemClass, getLastModifiedName, getLastModifiedTime, getMimeContent, getParentAttachment, getParentFolderId, getReminderDueBy, getReminderMinutesBeforeStart, getRootItemId, getSensitivity, getSize, getSubject, getUniqueBody, getWebClientEditFormQueryString, getWebClientReadFormQueryString, hasUnprocessedAttachmentChanges, internalCreate, internalDelete, internalLoad, internalUpdate, isAttachment, move, move, removeExtendedProperty, save, save, save, setBody, setCategories, setCulture, setExtendedProperty, setImportance, setInReplyTo, setIsReminderSet, setItemClass, setMimeContent, setReminderDueBy, setReminderMinutesBeforeStart, setSensitivity, setSubject, setSubject, throwIfThisIsAttachment, update
 
Methods inherited from class microsoft.exchange.webservices.data.ServiceObject
addServiceObjectChangedEvent, changed, clearChangeLog, clearServiceObjectChangedEvent, getChangeXmlElementName, getDeleteFieldXmlElementName, getIsCustomDateTimeScopingRequired, getLoadedPropertyDefinitions, getObjectFromPropertyDefinition, getPropertyBag, getService, getSetFieldXmlElementName, getXmlElementName, getXmlElementNameOverride, isDirty, isNew, load, load, loadFromXml, loadFromXml, removeServiceObjectChangedEvent, schema, setService, throwIfThisIsNew, throwIfThisIsNotNew, tryGetExtendedProperty, tryGetProperty, tryGetProperty, writeToXml, writeToXmlForUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Contact

public Contact(ExchangeService service)
        throws java.lang.Exception
Initializes an unsaved local instance of . To bind to an existing contact, use Contact.Bind() instead.

Parameters:
service - the service
Throws:
java.lang.Exception - the exception

Contact

protected Contact(ItemAttachment parentAttachment)
           throws java.lang.Exception
Initializes a new instance of the class.

Parameters:
parentAttachment - the parent attachment
Throws:
java.lang.Exception - the exception
Method Detail

bind

public static Contact bind(ExchangeService service,
                           ItemId id,
                           PropertySet propertySet)
                    throws java.lang.Exception
Binds to an existing contact and loads the specified set of properties. Calling this method results in a call to EWS.

Parameters:
service - the service
id - the id
propertySet - the property set
Returns:
A Contact instance representing the contact corresponding to the specified Id.
Throws:
java.lang.Exception - the exception

bind

public static Contact bind(ExchangeService service,
                           ItemId id)
                    throws java.lang.Exception
Binds to an existing contact and loads its first class properties. Calling this method results in a call to EWS.

Parameters:
service - the service
id - the id
Returns:
A Contact instance representing the contact corresponding to the specified Id.
Throws:
java.lang.Exception - the exception

getSchema

protected ServiceObjectSchema getSchema()
Internal method to return the schema associated with this type of object.

Overrides:
getSchema in class Item
Returns:
The schema associated with this type of object.

getMinimumRequiredServerVersion

protected ExchangeVersion getMinimumRequiredServerVersion()
Gets the minimum required server version.

Overrides:
getMinimumRequiredServerVersion in class Item
Returns:
Earliest Exchange version in which this service object type is supported.

setContactPicture

public void setContactPicture(byte[] content)
                       throws java.lang.Exception
Sets the contact's picture using the specified byte array.

Parameters:
content - the new contact picture
Throws:
java.lang.Exception - the exception

setContactPicture

public void setContactPicture(java.io.InputStream contentStream)
                       throws java.lang.Exception
Sets the contact's picture using the specified stream.

Parameters:
contentStream - the new contact picture
Throws:
java.lang.Exception - the exception

setContactPicture

public void setContactPicture(java.lang.String fileName)
                       throws java.lang.Exception
Sets the contact's picture using the specified file.

Parameters:
fileName - the new contact picture
Throws:
java.lang.Exception - the exception

getContactPictureAttachment

public FileAttachment getContactPictureAttachment()
                                           throws ServiceLocalException
Retrieves the file attachment that holds the contact's picture.

Returns:
The file attachment that holds the contact's picture.
Throws:
ServiceLocalException - the service local exception

removeContactPicture

public void removeContactPicture()
                          throws java.lang.Exception
Removes the contact's picture.

Throws:
java.lang.Exception - the exception

validate

protected void validate()
                 throws ServiceVersionException,
                        java.lang.Exception
Validates this instance.

Overrides:
validate in class Item
Throws:
ServiceVersionException - the service version exception
java.lang.Exception - the exception

getFileAs

public java.lang.String getFileAs()
                           throws ServiceLocalException
Gets the name under which this contact is filed as. FileAs can be manually set or can be automatically calculated based on the value of the FileAsMapping property.

Returns:
the file as
Throws:
ServiceLocalException - the service local exception

setFileAs

public void setFileAs(java.lang.String value)
               throws java.lang.Exception
Sets the file as.

Parameters:
value - the new file as
Throws:
java.lang.Exception - the exception

getFileAsMapping

public FileAsMapping getFileAsMapping()
                               throws ServiceLocalException
Gets a value indicating how the FileAs property should be automatically calculated.

Returns:
the file as mapping
Throws:
ServiceLocalException - the service local exception

setFileAs

public void setFileAs(FileAsMapping value)
               throws java.lang.Exception
Sets the file as.

Parameters:
value - the new file as
Throws:
java.lang.Exception - the exception

getDisplayName

public java.lang.String getDisplayName()
                                throws ServiceLocalException
Gets the display name of the contact.

Returns:
the display name
Throws:
ServiceLocalException - the service local exception

setDisplayName

public void setDisplayName(java.lang.String value)
                    throws java.lang.Exception
Sets the display name.

Parameters:
value - the new display name
Throws:
java.lang.Exception - the exception

getGivenName

public java.lang.String getGivenName()
                              throws ServiceLocalException
Gets the given name of the contact.

Returns:
the given name
Throws:
ServiceLocalException - the service local exception

setGivenName

public void setGivenName(java.lang.String value)
                  throws java.lang.Exception
Sets the given name.

Parameters:
value - the new given name
Throws:
java.lang.Exception - the exception

getInitials

public java.lang.String getInitials()
                             throws ServiceLocalException
Gets the initials of the contact.

Returns:
the initials
Throws:
ServiceLocalException - the service local exception

setInitials

public void setInitials(java.lang.String value)
                 throws java.lang.Exception
Sets the initials.

Parameters:
value - the new initials
Throws:
java.lang.Exception - the exception

getMiddleName

public java.lang.String getMiddleName()
                               throws ServiceLocalException
Gets the middle name of the contact.

Returns:
the middle name
Throws:
ServiceLocalException - the service local exception

setMiddleName

public void setMiddleName(java.lang.String value)
                   throws java.lang.Exception
Sets the middle name.

Parameters:
value - the new middle name
Throws:
java.lang.Exception - the exception

getNickName

public java.lang.String getNickName()
                             throws ServiceLocalException
Gets the nick name of the contact.

Returns:
the nick name
Throws:
ServiceLocalException - the service local exception

setNickName

public void setNickName(java.lang.String value)
                 throws java.lang.Exception
Sets the nick name.

Parameters:
value - the new nick name
Throws:
java.lang.Exception - the exception

getCompleteName

public CompleteName getCompleteName()
                             throws ServiceLocalException
Gets the complete name of the contact.

Returns:
the complete name
Throws:
ServiceLocalException - the service local exception

getCompanyName

public java.lang.String getCompanyName()
                                throws ServiceLocalException
Gets the company name of the contact.

Returns:
the company name
Throws:
ServiceLocalException - the service local exception

setCompanyName

public void setCompanyName(java.lang.String value)
                    throws java.lang.Exception
Sets the company name.

Parameters:
value - the new company name
Throws:
java.lang.Exception - the exception

getEmailAddresses

public EmailAddressDictionary getEmailAddresses()
                                         throws ServiceLocalException
Gets an indexed list of e-mail addresses for the contact. For example, to set the first e-mail address, use the following syntax: EmailAddresses[EmailAddressKey.EmailAddress1] = "john.doe@contoso.com"

Returns:
the email addresses
Throws:
ServiceLocalException - the service local exception

getPhysicalAddresses

public PhysicalAddressDictionary getPhysicalAddresses()
                                               throws ServiceLocalException
Gets an indexed list of physical addresses for the contact. For example, to set the first business address, use the following syntax: physical[PhysicalAddressKey.Business] = new PhysicalAddressEntry()

Returns:
the physical addresses
Throws:
ServiceLocalException - the service local exception

getPhoneNumbers

public PhoneNumberDictionary getPhoneNumbers()
                                      throws ServiceLocalException
Gets an indexed list of phone numbers for the contact. For example, to set the home phone number, use the following syntax: PhoneNumbers[PhoneNumberKey.HomePhone] = "phone number"

Returns:
the phone numbers
Throws:
ServiceLocalException - the service local exception

getAssistantName

public java.lang.String getAssistantName()
                                  throws ServiceLocalException
Gets the contact's assistant name.

Returns:
the assistant name
Throws:
ServiceLocalException - the service local exception

setAssistantName

public void setAssistantName(java.lang.String value)
                      throws java.lang.Exception
Sets the assistant name.

Parameters:
value - the new assistant name
Throws:
java.lang.Exception - the exception

getBirthday

public java.util.Date getBirthday()
                           throws ServiceLocalException
Gets the contact's assistant name.

Returns:
the birthday
Throws:
ServiceLocalException - the service local exception

setBirthday

public void setBirthday(java.util.Date value)
                 throws java.lang.Exception
Sets the birthday.

Parameters:
value - the new birthday
Throws:
java.lang.Exception - the exception

getBusinessHomePage

public java.lang.String getBusinessHomePage()
                                     throws ServiceLocalException
Gets the business home page of the contact.

Returns:
the business home page
Throws:
ServiceLocalException - the service local exception

setBusinessHomePage

public void setBusinessHomePage(java.lang.String value)
                         throws java.lang.Exception
Sets the business home page.

Parameters:
value - the new business home page
Throws:
java.lang.Exception - the exception

getChildren

public StringList getChildren()
                       throws ServiceLocalException
Gets a list of children for the contact.

Returns:
the children
Throws:
ServiceLocalException - the service local exception

setChildren

public void setChildren(StringList value)
                 throws java.lang.Exception
Sets the children.

Parameters:
value - the new children
Throws:
java.lang.Exception - the exception

getCompanies

public StringList getCompanies()
                        throws ServiceLocalException
Gets a list of companies for the contact.

Returns:
the companies
Throws:
ServiceLocalException - the service local exception

setCompanies

public void setCompanies(StringList value)
                  throws java.lang.Exception
Sets the companies.

Parameters:
value - the new companies
Throws:
java.lang.Exception - the exception

getContactSource

public ContactSource getContactSource()
                               throws ServiceLocalException
Gets the source of the contact.

Returns:
the contact source
Throws:
ServiceLocalException - the service local exception

getDepartment

public java.lang.String getDepartment()
                               throws ServiceLocalException
Gets the department of the contact.

Returns:
the department
Throws:
ServiceLocalException - the service local exception

setDepartment

public void setDepartment(java.lang.String value)
                   throws java.lang.Exception
Sets the department.

Parameters:
value - the new department
Throws:
java.lang.Exception - the exception

getGeneration

public java.lang.String getGeneration()
                               throws ServiceLocalException
Gets the generation of the contact.

Returns:
the generation
Throws:
ServiceLocalException - the service local exception

setGeneration

public void setGeneration(java.lang.String value)
                   throws java.lang.Exception
Sets the generation.

Parameters:
value - the new generation
Throws:
java.lang.Exception - the exception

getImAddresses

public ImAddressDictionary getImAddresses()
                                   throws ServiceLocalException
Gets an indexed list of Instant Messaging addresses for the contact. For example, to set the first IM address, use the following syntax: ImAddresses[ImAddressKey.ImAddress1] = "john.doe@contoso.com"

Returns:
the im addresses
Throws:
ServiceLocalException - the service local exception

getJobTitle

public java.lang.String getJobTitle()
                             throws ServiceLocalException
Gets the contact's job title.

Returns:
the job title
Throws:
ServiceLocalException - the service local exception

setJobTitle

public void setJobTitle(java.lang.String value)
                 throws java.lang.Exception
Sets the job title.

Parameters:
value - the new job title
Throws:
java.lang.Exception - the exception

getManager

public java.lang.String getManager()
                            throws ServiceLocalException
Gets the name of the contact's manager.

Returns:
the manager
Throws:
ServiceLocalException - the service local exception

setManager

public void setManager(java.lang.String value)
                throws java.lang.Exception
Sets the manager.

Parameters:
value - the new manager
Throws:
java.lang.Exception - the exception

getMileage

public java.lang.String getMileage()
                            throws ServiceLocalException
Gets the mileage for the contact.

Returns:
the mileage
Throws:
ServiceLocalException - the service local exception

setMileage

public void setMileage(java.lang.String value)
                throws java.lang.Exception
Sets the mileage.

Parameters:
value - the new mileage
Throws:
java.lang.Exception - the exception

getOfficeLocation

public java.lang.String getOfficeLocation()
                                   throws ServiceLocalException
Gets the location of the contact's office.

Returns:
the office location
Throws:
ServiceLocalException - the service local exception

setOfficeLocation

public void setOfficeLocation(java.lang.String value)
                       throws java.lang.Exception
Sets the office location.

Parameters:
value - the new office location
Throws:
java.lang.Exception - the exception

getPostalAddressIndex

public PhysicalAddressIndex getPostalAddressIndex()
                                           throws ServiceLocalException
Gets the index of the contact's postal address. When set, PostalAddressIndex refers to an entry in the PhysicalAddresses indexed list.

Returns:
the postal address index
Throws:
ServiceLocalException - the service local exception

setPostalAddressIndex

public void setPostalAddressIndex(PhysicalAddressIndex value)
                           throws java.lang.Exception
Sets the postal address index.

Parameters:
value - the new postal address index
Throws:
java.lang.Exception - the exception

getProfession

public java.lang.String getProfession()
                               throws ServiceLocalException
Gets the contact's profession.

Returns:
the profession
Throws:
ServiceLocalException - the service local exception

setProfession

public void setProfession(java.lang.String value)
                   throws java.lang.Exception
Sets the profession.

Parameters:
value - the new profession
Throws:
java.lang.Exception - the exception

getSpouseName

public java.lang.String getSpouseName()
                               throws ServiceLocalException
Gets the name of the contact's spouse.

Returns:
the spouse name
Throws:
ServiceLocalException - the service local exception

setSpouseName

public void setSpouseName(java.lang.String value)
                   throws java.lang.Exception
Sets the spouse name.

Parameters:
value - the new spouse name
Throws:
java.lang.Exception - the exception

getSurname

public java.lang.String getSurname()
                            throws ServiceLocalException
Gets the surname of the contact.

Returns:
the surname
Throws:
ServiceLocalException - the service local exception

setSurname

public void setSurname(java.lang.String value)
                throws java.lang.Exception
Sets the surname.

Parameters:
value - the new surname
Throws:
java.lang.Exception - the exception

getWeddingAnniversary

public java.util.Date getWeddingAnniversary()
                                     throws ServiceLocalException
Gets the date of the contact's wedding anniversary.

Returns:
the wedding anniversary
Throws:
ServiceLocalException - the service local exception

setWeddingAnniversary

public void setWeddingAnniversary(java.util.Date value)
                           throws java.lang.Exception
Sets the wedding anniversary.

Parameters:
value - the new wedding anniversary
Throws:
java.lang.Exception - the exception

getHasPicture

public java.lang.Boolean getHasPicture()
                                throws ServiceLocalException
Gets a value indicating whether this contact has a picture associated with it.

Returns:
the checks for picture
Throws:
ServiceLocalException - the service local exception

getPhoneticFullName

public java.lang.String getPhoneticFullName()
                                     throws java.lang.Exception
Gets the funn phonetic name from the directory

Throws:
java.lang.Exception

getPhoneticFirstName

public java.lang.String getPhoneticFirstName()
                                      throws java.lang.Exception
Gets the funn phonetic name from the directory

Throws:
java.lang.Exception

getPhoneticLastName

public java.lang.String getPhoneticLastName()
                                     throws ServiceLocalException
Gets the phonetic last name from the directory

Throws:
ServiceLocalException

getAlias

public java.lang.String getAlias()
                          throws ServiceLocalException
Gets the Alias from the directory

Throws:
ServiceLocalException

getNotes

public java.lang.String getNotes()
                          throws ServiceLocalException
Get the Notes from the directory

Throws:
ServiceLocalException

getDirectoryPhoto

public byte[] getDirectoryPhoto()
                         throws ServiceLocalException
Gets the Photo from the directory

Throws:
ServiceLocalException

getUserSMIMECertificate

public byte[][] getUserSMIMECertificate()
                                 throws ServiceLocalException
Gets the User SMIME certificate from the directory

Throws:
ServiceLocalException

getMSExchangeCertificate

public byte[][] getMSExchangeCertificate()
                                  throws ServiceLocalException
Gets the MSExchange certificate from the directory

Throws:
ServiceLocalException

getDirectoryId

public java.lang.String getDirectoryId()
                                throws ServiceLocalException
Gets the DirectoryID as Guid or DN string

Throws:
ServiceLocalException

getManagerMailbox

public EmailAddress getManagerMailbox()
                               throws ServiceLocalException
Gets the manager mailbox information

Throws:
ServiceLocalException

getDirectReports

public EmailAddressCollection getDirectReports()
                                        throws ServiceLocalException
Get the direct reports mailbox information

Throws:
ServiceLocalException