microsoft.exchange.webservices.data
Class UserConfiguration

java.lang.Object
  extended by microsoft.exchange.webservices.data.UserConfiguration

public class UserConfiguration
extends java.lang.Object

Represents an object that can be used to store user-defined configuration settings.


Constructor Summary
  UserConfiguration(ExchangeService service)
          Initializes a new instance of class.
protected UserConfiguration(ExchangeService service, java.util.EnumSet<UserConfigurationProperties> requestedProperties)
          Initializes a new instance of class.
 
Method Summary
static UserConfiguration bind(ExchangeService service, java.lang.String name, FolderId parentFolderId, UserConfigurationProperties properties)
          Binds to an existing user configuration and loads the specified properties.
static UserConfiguration bind(ExchangeService service, java.lang.String name, WellKnownFolderName parentFolderName, UserConfigurationProperties properties)
          Binds to an existing user configuration and loads the specified properties.
 void delete()
          Deletes the user configuration.
 byte[] getBinaryData()
          Gets the binary data of the user configuration.
 UserConfigurationDictionary getDictionary()
          Gets the dictionary of the user configuration.
 boolean getIsDirty()
          Gets a value indicating whether this user configuration has been modified.
 ItemId getItemId()
          Gets the Id of the user configuration.
 java.lang.String getName()
          Gets the name of the user configuration.
 FolderId getParentFolderId()
          Gets the Id of the folder containing the user configuration.
 byte[] getXmlData()
          Gets the xml data of the user configuration.
 void load(UserConfigurationProperties properties)
          Loads the specified properties on the user configuration.
protected  void loadFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
          Loads from XML.
 void save(java.lang.String name, FolderId parentFolderId)
          Saves the user configuration.
 void save(java.lang.String name, WellKnownFolderName parentFolderName)
          Saves the user configuration.
 void setBinaryData(byte[] value)
          Sets the binary data.
protected  void setName(java.lang.String value)
          Sets the name.
protected  void setParentFolderId(FolderId value)
          Sets the parent folder id.
 void setXmlData(byte[] value)
          Sets the xml data.
 void update()
          Updates the user configuration by applying local changes to the Exchange server.
protected  void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, microsoft.exchange.webservices.data.XmlNamespace xmlNamespace, java.lang.String xmlElementName)
          Writes to XML.
protected static void writeUserConfigurationNameToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer, microsoft.exchange.webservices.data.XmlNamespace xmlNamespace, java.lang.String name, FolderId parentFolderId)
          Writes to Xml.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserConfiguration

public UserConfiguration(ExchangeService service)
                  throws java.lang.Exception
Initializes a new instance of class.

Parameters:
service - The service to which the user configuration is bound.
Throws:
java.lang.Exception - the exception

UserConfiguration

protected UserConfiguration(ExchangeService service,
                            java.util.EnumSet<UserConfigurationProperties> requestedProperties)
                     throws java.lang.Exception
Initializes a new instance of class.

Parameters:
service - The service to which the user configuration is bound.
requestedProperties - The properties requested for this user configuration.
Throws:
java.lang.Exception - the exception
Method Detail

writeUserConfigurationNameToXml

protected static void writeUserConfigurationNameToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                                                      microsoft.exchange.webservices.data.XmlNamespace xmlNamespace,
                                                      java.lang.String name,
                                                      FolderId parentFolderId)
                                               throws java.lang.Exception
Writes to Xml.

Parameters:
writer - The writer.
xmlNamespace - The XML namespace.
name - The user configuration name.
parentFolderId - The Id of the folder containing the user configuration.
Throws:
java.lang.Exception - the exception

getName

public java.lang.String getName()
Gets the name of the user configuration.

Returns:
the name

setName

protected void setName(java.lang.String value)
Sets the name.

Parameters:
value - the new name

getParentFolderId

public FolderId getParentFolderId()
Gets the Id of the folder containing the user configuration.

Returns:
the parent folder id

setParentFolderId

protected void setParentFolderId(FolderId value)
Sets the parent folder id.

Parameters:
value - the new parent folder id

getItemId

public ItemId getItemId()
Gets the Id of the user configuration.

Returns:
the item id

getDictionary

public UserConfigurationDictionary getDictionary()
Gets the dictionary of the user configuration.

Returns:
the dictionary

getXmlData

public byte[] getXmlData()
                  throws PropertyException
Gets the xml data of the user configuration.

Returns:
the xml data
Throws:
PropertyException - the property exception

setXmlData

public void setXmlData(byte[] value)
Sets the xml data.

Parameters:
value - the new xml data

getBinaryData

public byte[] getBinaryData()
                     throws PropertyException
Gets the binary data of the user configuration.

Returns:
the binary data
Throws:
PropertyException - the property exception

setBinaryData

public void setBinaryData(byte[] value)
Sets the binary data.

Parameters:
value - the new binary data

getIsDirty

public boolean getIsDirty()
Gets a value indicating whether this user configuration has been modified.

Returns:
the checks if is dirty

bind

public static UserConfiguration bind(ExchangeService service,
                                     java.lang.String name,
                                     FolderId parentFolderId,
                                     UserConfigurationProperties properties)
                              throws java.lang.IndexOutOfBoundsException,
                                     java.lang.Exception
Binds to an existing user configuration and loads the specified properties. Calling this method results in a call to EWS.

Parameters:
service - The service to which the user configuration is bound.
name - The name of the user configuration.
parentFolderId - The Id of the folder containing the user configuration.
properties - The properties to load.
Returns:
A user configuration instance.
Throws:
java.lang.IndexOutOfBoundsException - the index out of bounds exception
java.lang.Exception - the exception

bind

public static UserConfiguration bind(ExchangeService service,
                                     java.lang.String name,
                                     WellKnownFolderName parentFolderName,
                                     UserConfigurationProperties properties)
                              throws java.lang.IndexOutOfBoundsException,
                                     java.lang.Exception
Binds to an existing user configuration and loads the specified properties.

Parameters:
service - The service to which the user configuration is bound.
name - The name of the user configuration.
parentFolderName - The name of the folder containing the user configuration.
properties - The properties to load.
Returns:
A user configuration instance.
Throws:
java.lang.IndexOutOfBoundsException - the index out of bounds exception
java.lang.Exception - the exception

save

public void save(java.lang.String name,
                 FolderId parentFolderId)
          throws java.lang.Exception
Saves the user configuration. Calling this method results in a call to EWS.

Parameters:
name - The name of the user configuration.
parentFolderId - The Id of the folder in which to save the user configuration.
Throws:
java.lang.Exception - the exception

save

public void save(java.lang.String name,
                 WellKnownFolderName parentFolderName)
          throws java.lang.Exception
Saves the user configuration. Calling this method results in a call to EWS.

Parameters:
name - The name of the user configuration.
parentFolderName - The name of the folder in which to save the user configuration.
Throws:
java.lang.Exception - the exception

update

public void update()
            throws java.lang.Exception
Updates the user configuration by applying local changes to the Exchange server. Calling this method results in a call to EWS

Throws:
java.lang.Exception - the exception

delete

public void delete()
            throws java.lang.Exception
Deletes the user configuration. Calling this method results in a call to EWS.

Throws:
java.lang.Exception - the exception

load

public void load(UserConfigurationProperties properties)
          throws java.lang.Exception
Loads the specified properties on the user configuration. Calling this method results in a call to EWS.

Parameters:
properties - The properties to load.
Throws:
java.lang.Exception - the exception

writeToXml

protected void writeToXml(microsoft.exchange.webservices.data.EwsServiceXmlWriter writer,
                          microsoft.exchange.webservices.data.XmlNamespace xmlNamespace,
                          java.lang.String xmlElementName)
                   throws java.lang.Exception
Writes to XML.

Parameters:
writer - The writer.
xmlNamespace - The XML namespace.
xmlElementName - Name of the XML element.
Throws:
java.lang.Exception - the exception

loadFromXml

protected void loadFromXml(microsoft.exchange.webservices.data.EwsServiceXmlReader reader)
                    throws java.lang.Exception
Loads from XML.

Parameters:
reader - The reader.
Throws:
java.lang.Exception - the exception