|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class is the superclass of all containers and items in the Collaboration Services API.
Field Summary | |
static ItemClass |
CLASS
The item class of IItem . |
static Key |
ID
Key that represents the item ID. |
static Key |
ITEM_CLASS
Key that represents the item type. |
static int |
KEYID_ID
The int ID for the ID key. |
static int |
KEYID_ITEM_CLASS
The int ID for the ITEM_CLASS key. |
static int |
KEYID_PARENT_ID
The int ID for the PARENT_ID key. |
static Key[] |
MINIMUM_ITEM_KEYS
The minimum required keys when fetching an item. |
static Key |
PARENT_ID
Key that represents the id of the parent item. |
Method Summary | |
void |
commit()
Commits any changed or removed properties on the item to the backend server. |
boolean |
containsKey(Key key)
Determines if the item contains a particular property. |
boolean |
containsKey(Key key,
boolean bAutoFetch)
Determines if the item contains a particular property. |
void |
copyProperties(Key[] props,
Key[] excludedProps,
boolean bOverwrite,
IItem target)
Copy the keys specified from this item to the specified item. |
void |
copyTo(IContainer container)
Copies the item to another container. |
void |
delete()
Deletes the item from the backend. |
IValue[] |
fetchProperties(FetchProfile profile)
Fetch unfetched properties for this item from the server into this item. |
java.lang.Object |
getAttribute(java.lang.String sKey)
Returns a value that was set on this item for the given key. |
Enum |
getEnum(Key key)
Gets the enumeration for the specified key. |
java.lang.String |
getID()
Gets the ID of the item. |
java.io.InputStream |
getInputStream(Key key)
Get a InputStream for reading the contents of a Key.VALUE_BINARY type
Key. |
ItemClass |
getItemClass()
Gets the item class for this item. |
java.io.OutputStream |
getOutputStream(Key key,
int iLength)
Get a OutputStream for outputting the value of a Key.VALUE_BINARY type
Key. |
IItem |
getParent()
Gets the parent of the item, fetching its minimum properties. |
IItem |
getParent(FetchProfile profile)
Gets the parent of the item. |
java.lang.String |
getParentID()
Gets the ID for the parent of the item. |
IValue[] |
getProperties()
Gets all of the properties on the item that have already been retrieved. |
IValue[] |
getProperties(Key[] keys)
Gets the properties on the item for the given set of keys. |
IValue[] |
getProperties(Key[] keys,
boolean bAutoFetch)
Gets the properties on the item for the given set of keys. |
IValue |
getProperty(Key key)
Gets a property on the item. |
IValue |
getProperty(Key key,
boolean bNonexistenceException)
Gets a property on the item. |
IValue |
getProperty(Key key,
boolean bNonexistenceException,
boolean bAutoFetch)
Gets a property on the item. |
java.io.Reader |
getReader(Key key)
Get a Reader for reading the contents of a Key.VALUE_STRING type
Key. |
IRootContainer |
getRootContainer()
Returns the root container this item is under. |
ISession |
getSession()
Gets the session that the item is associated with. |
java.io.Writer |
getWriter(Key key,
int iLength)
Get a Writer for writing the value of a Key.VALUE_STRING type
Key. |
boolean |
isMissing()
Gets whether the current item was not found when requested by its ID during a batch search for items. |
void |
moveTo(IContainer container)
Moves the item to another container. |
java.lang.Object |
removeAttribute(java.lang.String sKey)
Remove the value for the given key from this item. |
IValue |
removeProperty(Key key)
Removes the specified property from the item. |
void |
setAttribute(java.lang.String sKey,
java.lang.Object value)
Set a value on this item that will not be saved when the item is committed. |
void |
setProperties(Key[] keys,
java.lang.Object[] values)
Sets properties on an item (changes are not saved until commit
is called). |
void |
setProperty(Key key,
boolean bValue)
Sets a property on the item to a boolean value (changes are not saved until commit is called). |
void |
setProperty(Key key,
int iValue)
Sets a property on the item to an int value (changes are not saved until commit is called). |
void |
setProperty(Key key,
java.lang.Object value)
Sets a property on the item (changes are not saved until commit
is called). |
Field Detail |
public static final int KEYID_ID
int
ID for the ID
key.public static final int KEYID_PARENT_ID
int
ID for the PARENT_ID
key.public static final int KEYID_ITEM_CLASS
int
ID for the ITEM_CLASS
key.public static final Key ID
public static final Key PARENT_ID
public static final Key ITEM_CLASS
public static final Key[] MINIMUM_ITEM_KEYS
public static final ItemClass CLASS
IItem
.Method Detail |
public boolean containsKey(Key key) throws CollaborationException
key
- the key to checktrue
if there is a property with the specified key,
false
if not or if the key has not been retrievedCollaborationException
- if there was a problem looking up the key
for inclusion.public boolean containsKey(Key key, boolean bAutoFetch) throws CollaborationException
key
- the key to checkbAutoFetch
- if true
, fetch the property from the
server if it has not already been retrievedtrue
if there is a property with the specified key,
false
if not or if the key has not been retrievedCollaborationException
- if there was a problem retrieving
the property with the specified keypublic void setProperties(Key[] keys, java.lang.Object[] values) throws CollaborationException
commit
is called).keys
- the keys for the properties (not null
)values
- the values for the properties (not null
,
and in the same order as the keys)CollaborationException
- if there was a problem setting the value to
the specified key (possible nested exceptions include:
RuntimeException
, ParseException
)public void setProperty(Key key, java.lang.Object value) throws CollaborationException
commit
is called).key
- the property key (must not be null
)value
- the value (must be able to coerce the specified
object to the final type specified by the key)CollaborationException
- if there was a problem setting the value to
the specified key (possible nested exceptions include:
RuntimeException
, ParseException
)public void setProperty(Key key, int iValue) throws CollaborationException
commit
is called).key
- the property key (must not be null
)iValue
- the value (must be able to coerce the corresponding
Integer to the final type specified by the key)CollaborationException
- if there was a problem setting the value to
the specified key (possible nested exceptions include:
RuntimeException
, ParseException
)public void setProperty(Key key, boolean bValue) throws CollaborationException
commit
is called).key
- the property key (must not be null
)bValue
- the value (must be able to coerce the corresponding
Boolean to the final type specified by the key)CollaborationException
- if there was a problem setting the value to
the specified key (possible nested exceptions include:
RuntimeException
, ParseException
)public IValue getProperty(Key key) throws CollaborationException
Session.PROP_AUTO_FETCH
, this method may query the server
to get the specified property if it has not already been retrieved.key
- the property key (must not be null
)null
if there is no value on the item
with the specified key)CollaborationException
- if there was a problem retrieving the
propertypublic IValue getProperty(Key key, boolean bNonexistenceException) throws CollaborationException
bAutoFetch
is
true
, retrieve the property from the server if it has not been
retrieved already. If key
is a default property and it needs
to be retrieved, then all default properties will be retrieved at the
same time.key
- the property key (must not be null
)bNonexistenceException
- if true
, throw an exception
rather than returning null
when the property does
not exist and could not be fetch if bAutoFetch
is specifiednull
if there is no value on the item
with the specified key and bNonexistenceException
was false)CollaborationException
- if there was a problem retrieving the
property, or if the property does not exist and
bNonexistenceException
was specified as true
public IValue getProperty(Key key, boolean bNonexistenceException, boolean bAutoFetch) throws CollaborationException
bAutoFetch
is
true
, retrieve the property from the server if it has not been
retrieved already. If key
is a default property and it needs
to be retrieved, then all default properties will be retrieved at the
same time.key
- the property key (must not be null
)bNonexistenceException
- if true
, throw an exception
rather than returning null
when the property does
not exist and could not be fetch if bAutoFetch
is specifiedbAutoFetch
- if true
, fetch the property from the
server if it has not already been retrievednull
if there is no value on the item
with the specified key and bNonexistenceException
was false)CollaborationException
- if there was a problem retrieving the
property, or if the property does not exist and
bNonexistenceException
was specified as true
public IValue removeProperty(Key key) throws CollaborationException
key
- the key to removenull
if the key did
not exist or was not retrievedCollaborationException
- if the Key is read only or
IContainer.NAME
public IValue[] getProperties()
public IValue[] getProperties(Key[] keys) throws CollaborationException
Session.AUTO_FETCH
property, this method
may hit the server to retrieve additional properties.keys
- the keys to retrieve values for on this item (not
null
)CollaborationException
- if any of the properties could not
retrievedpublic IValue[] fetchProperties(FetchProfile profile) throws CollaborationException
getProperty(Key)
.profile
- the additional properties to fetch (not null
)Value[0]
.CollaborationException
- if any of the properties could not be fetchedpublic IValue[] getProperties(Key[] keys, boolean bAutoFetch) throws CollaborationException
keys
- the keys to retrieve values for on this item (not
null
)bAutoFetch
- if true
, get the properties from the
server that have not already been retrievedCollaborationException
- if any of the properties could not be
retrievedpublic void commit() throws CollaborationException
CollaborationException
- if there was a problem committing the item
to the backendpublic void copyProperties(Key[] props, Key[] excludedProps, boolean bOverwrite, IItem target) throws CollaborationException
props
- the keys to copy from this item (null
means to copy all items)excludedProps
- the keys not to copy if copying all items
(null
means exclude nothing)bOverwrite
- if set to true
, overwrite the keys in
the targettarget
- the target item to copy toCollaborationException
- if there was a problem copying items to the
targetpublic void delete() throws CollaborationException
commit
, and once it has been called the item may no longer be
used.CollaborationException
- if there was a problem removing this item from
the backendpublic java.lang.String getID()
null
if this item has not yet been
committed)ID
public ItemClass getItemClass()
null
)ITEM_CLASS
public ISession getSession()
null
)public IRootContainer getRootContainer()
null
)public IItem getParent() throws CollaborationException
null
if this item is
the root container)CollaborationException
- if there was a problem retrieving the
parentpublic java.lang.String getParentID()
null
if this item has no
parent, for example if it is the root container)public IItem getParent(FetchProfile profile) throws CollaborationException
null
.profile
- the profile to use that defines the keys
(not null
)null
if this item is
the root container)CollaborationException
- if there was a problem retrieving the
parentPARENT_ID
public void moveTo(IContainer container) throws MoveSourceIsTargetException, CollaborationException
container
- the destination containerContainerCycleException
- if the item being moved is a container
and an attempt was made to move it to a child of the source
container (if this exception is thrown, some of the operation
may have completed)MoveSourceIsTargetException
- if the item is moved to its own containerContainerAlreadyExistsException
- if the item being moved is a
container and a container with the same name already exists in the
destination containerCollaborationException
- if there was a problem moving
this item to a container.public void copyTo(IContainer container) throws CollaborationException
container
- the destination containerContainerCycleException
- if the item being copied is a container
and an attempt was made to copy it to a child of the source
container (if this exception is thrown, some of the operation
may have completed)CollaborationException
- if there was a problem copying
this item to a container.public void setAttribute(java.lang.String sKey, java.lang.Object value)
sKey
- the key to store the value forvalue
- the value to place in memory for this itempublic java.lang.Object getAttribute(java.lang.String sKey)
sKey
- the key used to store the value on this itemnull
if no value is
found for the given keypublic Enum getEnum(Key key) throws CollaborationException
key
- the key (not null
)null
if there is no defined
enumeration for the specified key)InvalidArgumentException
- if the specified key is not for
an enumeration
CollaborationException if there was a problem resolving the
key with the providerpublic java.lang.Object removeAttribute(java.lang.String sKey)
sKey
- the key (must not be null
)null
if there was
no attribute with the specified keypublic java.io.Reader getReader(Key key) throws CollaborationException
Reader
for reading the contents of a Key.VALUE_STRING
type
Key. Reader.close()
must be called on the returned Reader after reading
is finished.key
- the key to get a reader forReader
to read the key's value; null
if
this item does not have that valueCollaborationException
- if unable to create the ReaderInvalidArgumentException
- if key
is not for a String valuepublic java.io.Writer getWriter(Key key, int iLength) throws CollaborationException
Writer
for writing the value of a Key.VALUE_STRING
type
Key. Any existing value will be overwritten. Writer.close()
must be called
on the returned Writer after writing is finished.key
- the key to get a writer foriLength
- the exact number of characters to be written;
-1
if not knownWriter
to write the key's valueCollaborationException
- if unable to create the WriterInvalidArgumentException
- if key
is not for a String valuepublic java.io.InputStream getInputStream(Key key) throws CollaborationException
InputStream
for reading the contents of a Key.VALUE_BINARY
type
Key. InputStream.close()
must be called on the returned InputStream after input
is finished.key
- the key to get an InputStream forInputStream
to input the key's value; null
if
this item does not have that valueCollaborationException
- if unable to create the InputStreamInvalidArgumentException
- if key
is not for a binary valuepublic java.io.OutputStream getOutputStream(Key key, int iLength) throws CollaborationException
OutputStream
for outputting the value of a Key.VALUE_BINARY
type
Key. Any existing value will be overwritten. OutputStream.close()
must be called
on the returned OutputStream after output is finished.key
- the key to get an OutputStream foriLength
- the exact number of bytes to be written;
-1
if unknownOutputStream
to output the key's valueCollaborationException
- if unable to create the OutputStreamInvalidArgumentException
- if key
is not for a String valuepublic boolean isMissing()
IMissingItem
.true
if this item wasn't found when requested
with other items by their IDs, false
otherwise.IRootContainer.getItemsByID(String[], FetchProfile)
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |