|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.sentinel.client.bean.SentinelBean
public abstract class SentinelBean
The base class for "bean" objects that represent Sentinel data items.
Sentinel data object "beans" are classes designed to be used in client code (Java or GWT). The bean classes are generated automatically from metadata descriptions of the data objects.
A Sentinel bean class is a container for data. Each Sentinel data object is a collection of named values and, optionally, of named relationships to other data objects. These named items are referred to as fields.
BeanTransporter
.
java.lang.String
, boolean
,
long
, int
, java.util.Date
, java.util.Collection
, etc.
A field that represents a relationship to another data object is presented either as the URL of the related object, or as a contained bean instance.
null
and is
used when sending a bean to the server via an HTTP PUT operation to indicate to the server that a field's value should be removed.
The reason Null exists is to allow less than the full set of values to be written to the server when updating a data object.
Without Null the client would have to get the entire set of values from the server,
modify the value or values of interest, and then write back the entire set of values representing the
complete state of the object. (A limited set of fields can be obtained by using the fields
parameter in certain overrides of list
and listFromURL
in the
BeanTransporter
interface.)
With Null the client can send only those fields that are to be modified fields to the server. Setting a field's value to Null indicates something different than simply clearing the field's value. A cleared value is not sent to the server; a "nulled" value is sent to the server.
A cleared value in a bean received from the server may, or may not, indicate that the underlying Sentinel data object has no value value for the field. If all fields for the data object type are requested from the server and a field in the resulting bean has no value, then the data object does not have a value for that field. If, however, a particular field is not requested from the server, then there is no way to tell from the bean whether or not the data object has a value for that particular field.
The internal name is the name by which the object or field is referred to by Sentinel server code. Internal names may not always reflect exactly the current use of an object or field, nor the names by which an object or field is referred to in the Sentinel user interface. The internal name reflects many years of Sentinel development and so may reflect terminology formerly in use (e.g., GlobalFilter objects are referred to in the user interface as "Event Routing Rules").
The generated bean class names and their associated constant and method names are based on the internal names. The values of the constants are from the bean names.
Bean names are typically shorter than the internal name in an effort to minimize the amount of data that must be transported over the network when using the Sentinel REST interface.
BeanTransporter
Constructor Summary | |
---|---|
protected |
SentinelBean(BeanMetaData<? extends SentinelBean> _metadata)
|
Method Summary | ||
---|---|---|
void |
clearField(String fieldName)
Remove any existing value of the specified field from this instance. |
|
static
|
cloneBean(B bean)
|
|
boolean |
equals(Object o)
|
|
Iterable<Map.Entry<String,BeanValue>> |
fields()
Return the fields (name-value pairs) set in this instance. |
|
String |
getBeanName()
Return the "bean name" of the data item (e.g., "identity"). |
|
BeanValue |
getBeanValue(String fieldName)
Get the value holder for the specified field's value. |
|
BeanValue |
getField(String fieldName)
Get the value holder for the specified field. |
|
BeanValue |
getFieldNoNull(String fieldName)
Get the value holder for the specified field, or if the field is clear (doesn't exist in this instance), get a special value holder that returns appropriate values for the various types. |
|
String |
getLink()
Get the URL which refers to the data represented by this instance. |
|
|
getMetaData()
|
|
boolean |
isFieldClear(String fieldName)
Return if the specified field is not set in this instance. |
|
boolean |
isFieldNull(String fieldName)
Return if the specified field is set but Null. |
|
boolean |
isLinkClear()
Returns if the URL addresses the data item represented by this bean is present or not. |
|
void |
setField(String fieldName,
BeanValue value)
Set a field to the passed value. |
|
void |
setFieldNull(String fieldName)
Set any existing value of the specified field to Null. |
|
String |
toString()
Return a String representation of this bean. |
|
Iterable<BeanValue> |
values()
Return the values (no names) of the data set in this instance. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected SentinelBean(BeanMetaData<? extends SentinelBean> _metadata)
Method Detail |
---|
public <B extends SentinelBean> BeanMetaData<B> getMetaData()
public String getBeanName()
public String getLink()
public boolean isLinkClear()
public BeanValue getField(String fieldName)
fieldName
- The name of the field.
null
.public BeanValue getFieldNoNull(String fieldName)
fieldName
- The name of the field.
public boolean isFieldNull(String fieldName)
fieldName
- The name of the field.
public boolean isFieldClear(String fieldName)
fieldName
- The name of the field.
public void setField(String fieldName, BeanValue value)
fieldName
- The name of the fieldvalue
- The value holder.public void clearField(String fieldName)
fieldName
- The name of the field.public void setFieldNull(String fieldName)
fieldName
- The name of the field.public Iterable<Map.Entry<String,BeanValue>> fields()
public Iterable<BeanValue> values()
public BeanValue getBeanValue(String fieldName)
fieldName
- The name of the field.
public boolean equals(Object o)
equals
in class Object
public static <B extends SentinelBean> B cloneBean(B bean)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |