|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IItem
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. |
Object |
getAttribute(String sKey)
Returns a value that was set on this item for the given key. |
CollabEnum |
getEnum(Key key)
Gets the enumeration for the specified key. |
String |
getID()
Gets the ID of the item. |
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. |
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. |
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. |
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. |
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. |
Object |
removeAttribute(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(String sKey,
Object value)
Set a value on this item that will not be saved when the item is committed. |
void |
setProperties(Key[] keys,
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,
Object value)
Sets a property on the item (changes are not saved until commit
is called). |
Field Detail |
---|
static final int KEYID_ID
int
ID for the ID
key.
static final int KEYID_PARENT_ID
int
ID for the PARENT_ID
key.
static final int KEYID_ITEM_CLASS
int
ID for the ITEM_CLASS
key.
static final Key ID
static final Key PARENT_ID
static final Key ITEM_CLASS
static final Key[] MINIMUM_ITEM_KEYS
static final ItemClass CLASS
IItem
.
Method Detail |
---|
boolean containsKey(Key key) throws CollaborationException
key
- the key to check
true
if there is a property with the specified key,
false
if not or if the key has not been retrieved
CollaborationException
- if there was a problem looking up the key
for inclusion.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 retrieved
true
if there is a property with the specified key,
false
if not or if the key has not been retrieved
CollaborationException
- if there was a problem retrieving
the property with the specified keyvoid setProperties(Key[] keys, 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
)void setProperty(Key key, 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
)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
)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
)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
propertyIValue 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 specified
null
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
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 retrieved
null
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
IValue removeProperty(Key key) throws CollaborationException
key
- the key to remove
null
if the key did
not exist or was not retrieved
CollaborationException
- if the Key is read only or
IContainer.NAME
IValue[] getProperties()
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
retrievedIValue[] 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 fetchedIValue[] 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 retrieved
CollaborationException
- if any of the properties could not be
retrievedvoid commit() throws CollaborationException
CollaborationException
- if there was a problem committing the item
to the backendvoid 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 to
CollaborationException
- if there was a problem copying items to the
targetvoid 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 backendString getID()
null
if this item has not yet been
committed)ID
ItemClass getItemClass()
null
)ITEM_CLASS
ISession getSession()
null
)IRootContainer getRootContainer()
null
)IItem getParent() throws CollaborationException
null
if this item is
the root container)
CollaborationException
- if there was a problem retrieving the
parentString getParentID()
null
if this item has no
parent, for example if it is the root container)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
void moveTo(IContainer container) throws MoveSourceIsTargetException, CollaborationException
container
- the destination container
ContainerCycleException
- 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 container
ContainerAlreadyExistsException
- if the item being moved is a
container and a container with the same name already exists in the
destination container
CollaborationException
- if there was a problem moving
this item to a container.void copyTo(IContainer container) throws CollaborationException
container
- the destination container
ContainerCycleException
- 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.void setAttribute(String sKey, Object value)
sKey
- the key to store the value forvalue
- the value to place in memory for this itemObject getAttribute(String sKey)
sKey
- the key used to store the value on this item
null
if no value is
found for the given keyCollabEnum 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 provider
CollaborationException
Object removeAttribute(String sKey)
sKey
- the key (must not be null
)
null
if there was
no attribute with the specified keyReader 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 for
Reader
to read the key's value; null
if
this item does not have that value
CollaborationException
- if unable to create the Reader
InvalidArgumentException
- if key
is not for a String valueWriter 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 known
Writer
to write the key's value
CollaborationException
- if unable to create the Writer
InvalidArgumentException
- if key
is not for a String valueInputStream 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 for
InputStream
to input the key's value; null
if
this item does not have that value
CollaborationException
- if unable to create the InputStream
InvalidArgumentException
- if key
is not for a binary valueOutputStream 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 unknown
OutputStream
to output the key's value
CollaborationException
- if unable to create the OutputStream
InvalidArgumentException
- if key
is not for a String valueboolean isMissing()
IMissingItem
.
true
if this item wasn't found when requested
with other items by their IDs, false
otherwise.IRootContainer.getItemsByID(String[], FetchProfile)
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |