Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.compoze.exchange
Class AbstractItem

    java.lang.Object
      com.compoze.exchange.AbstractItem

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  AddressEntry, Attachment, Folder, Message

public abstract class AbstractItem
extends java.lang.Object
implements java.io.Serializable

This class represents an Exchange item, which can either be a message or a folder. An item contains any number of properties that correspond to properties or the results of a method call on the message or folder in Exchange. Accessor methods for the properties do not modify of retrieve from the server immediately. For changes to be committed the `serverUpdate` method must be called. Properties must be explicitly loaded into the item before they can be accessed. This is done by specifying the desired properties when the item is initially created.

See Also:
  Serialized Form

Field Summary
`protected PropertyValue[]` | `m_props`
`protected Session` | `m_session`

Constructor Summary
`protected` | `AbstractItem(Session session, PropertyValue[] props)` Constructor.

Method Summary
`PropertyValue` | `get(PropertyKey key)` Gets the value of a property from the item.
`boolean` | `getBoolean(PropertyKey key)` Gets a boolean property from the item.
`byte[]` | `getByteArray(PropertyKey key)` Gets a byte array property from the item.
`java.util.Date` | `getDate(PropertyKey key)` Gets a date property from the item.
`double` | `getDouble(PropertyKey key)` Gets a double property from the item.
`int` | `getInt(PropertyKey key)` Gets an int property from the item.
`PropertyValue[]` | `getInvalidPropertyValues()` Gets the invalid property values for this item.
`PropertyKey[]` | `getPropertyKeys()` Gets the keys of all of the currently loaded properties.
`java.lang.String` | `getString(PropertyKey key)` Gets a String property from the item.
`java.lang.String[]` | `getStringArray(PropertyKey key)` Gets a String array property from the item.
`protected PropertyValue[]` | `getUpdatedPropertyValues()` Gets the updated property values.
`abstract void` | `serverUpdate()` Queries the server to update any changed properties.
`void` | `set(PropertyValue value)` Sets the value of a property, or adds a new value if it is not already set.
`void` | `setBoolean(PropertyKey key, boolean bValue)` Sets the boolean value of a property.
`void` | `setByteArray(PropertyKey key, byte[] arrayValue)` Sets a byte array property from the item.
`void` | `setDate(PropertyKey key, java.util.Date date)` Sets the date value of a property.
`void` | `setDouble(PropertyKey key, double dValue)` Sets the double value of a property.
`void` | `setInt(PropertyKey key, int iValue)` Sets the int value of a property.
`void` | `setString(PropertyKey key, java.lang.String sValue)` Sets the string value of a property.
`void` | `setStringArray(PropertyKey key, java.lang.String[] arrayValue)` Sets a String array property from the item.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_session

    protected Session m_session

### m_props

    protected PropertyValue[] m_props

Constructor Detail

### AbstractItem

    protected AbstractItem(Session session,
                           PropertyValue[] props)

  Constructor.

Method Detail

### get

    public PropertyValue get(PropertyKey key)

  Gets the value of a property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the property value, or `null` if the property is not loaded

### set

    public void set(PropertyValue value)

  Sets the value of a property, or adds a new value if it is not already set. The property value is flagged as updated.

### setString

    public void setString(PropertyKey key,
                          java.lang.String sValue)
                   throws ExchangeException

  Sets the string value of a property.

  Parameters:
    `key` - the property key
    `sValue` - the string value
  Throws:
    `ExchangeException` - if the property key's value type is not a string

### setStringArray

    public void setStringArray(PropertyKey key,
                               java.lang.String[] arrayValue)
                        throws ExchangeException

  Sets a String array property from the item.

  Parameters:
    `key` - the property key
    `arrayValue` - the string array value
  Returns:
    the string array value
  Throws:
    `ExchangeException` - if the property key is not found

### setByteArray

    public void setByteArray(PropertyKey key,
                             byte[] arrayValue)
                      throws ExchangeException

  Sets a byte array property from the item.

  Parameters:
    `key` - the property key
    `arrayValue` - the byte array value
  Returns:
    the byte array value
  Throws:
    `ExchangeException` - if the property key is not found

### setInt

    public void setInt(PropertyKey key,
                       int iValue)
                throws ExchangeException

  Sets the int value of a property.

  Parameters:
    `key` - the property key
    `iValue` - the int value
  Throws:
    `ExchangeException` - if the property key's value type is not an int

### setDouble

    public void setDouble(PropertyKey key,
                          double dValue)
                   throws ExchangeException

  Sets the double value of a property.

  Parameters:
    `key` - the property key
    `dValue` - the double value
  Throws:
    `ExchangeException` - if the property key's value type is not an int

### getString

    public java.lang.String getString(PropertyKey key)
                               throws ExchangeException

  Gets a String property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the string value
  Throws:
    `ExchangeException` - if the property key is not found

### getByteArray

    public byte[] getByteArray(PropertyKey key)
                        throws ExchangeException

  Gets a byte array property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the byte array value
  Throws:
    `ExchangeException` - if the property key is not found

### getStringArray

    public java.lang.String[] getStringArray(PropertyKey key)
                                      throws ExchangeException

  Gets a String array property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the string array value
  Throws:
    `ExchangeException` - if the property key is not found

### getInt

    public int getInt(PropertyKey key)
               throws ExchangeException

  Gets an int property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the int value
  Throws:
    `ExchangeException` - if the property key is not found

### getDouble

    public double getDouble(PropertyKey key)
                     throws ExchangeException

  Gets a double property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the double value
  Throws:
    `ExchangeException` - if the property key is not found

### getBoolean

    public boolean getBoolean(PropertyKey key)
                       throws ExchangeException

  Gets a boolean property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the boolean value
  Throws:
    `ExchangeException` - if the property key is not found

### setBoolean

    public void setBoolean(PropertyKey key,
                           boolean bValue)
                    throws ExchangeException

  Sets the boolean value of a property.

  Parameters:
    `key` - the property key
    `bValue` - the boolean value
  Throws:
    `ExchangeException` - if the property key's value type is not an int

### setDate

    public void setDate(PropertyKey key,
                        java.util.Date date)
                 throws ExchangeException

  Sets the date value of a property.

  Parameters:
    `key` - the property key
    `date` - the date
  Throws:
    `ExchangeException` - if the property key's value type is not an int

### getDate

    public java.util.Date getDate(PropertyKey key)
                           throws ExchangeException

  Gets a date property from the item.

  Parameters:
    `key` - the property key
  Returns:
    the date value
  Throws:
    `ExchangeException` - if the property key is not found

### getUpdatedPropertyValues

    protected PropertyValue[] getUpdatedPropertyValues()

  Gets the updated property values.

  Returns:
    an array of the updated property values, or `null` if no properties have been updated

### getInvalidPropertyValues

    public PropertyValue[] getInvalidPropertyValues()

  Gets the invalid property values for this item. Invalid properties are those which are requested, but may not be present for a particular item. For example, there are properties available to Appointments but not to Mail Messages. Requesting such a property will not cause an exception, but the value would not be available.

### getPropertyKeys

    public PropertyKey[] getPropertyKeys()

  Gets the keys of all of the currently loaded properties.

  Returns:
    an array containing the keys of all of the currently loaded properties

### serverUpdate

    public abstract void serverUpdate()
                               throws ExchangeException

  Queries the server to update any changed properties.

  Throws:
    `ExchangeException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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