public final class Item
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADD_COMMAND
String constant for ADD value of COMMAND field in COMMAND subscription mode.
|
static java.lang.String |
COMMAND
String constant for COMMAND subscription mode.
|
static java.lang.String |
COMMAND_FIELD
String constant for COMMAND field in COMMAND subscription mode.
|
static java.lang.String |
DELETE_COMMAND
String constant for DELETE value of COMMAND field in COMMAND subscription mode.
|
static java.lang.String |
DISTINCT
String constant for DISTINCT subscription mode.
|
static java.lang.String |
KEY_FIELD
String constant for KEY field in COMMAND subscription mode.
|
static java.lang.String |
MERGE
String constant for MERGE subscription mode.
|
static java.lang.String |
RAW
String constant for RAW subscription mode.
|
static java.lang.String |
UPDATE_COMMAND
String constant for UPDATE value of COMMAND field in COMMAND subscription mode.
|
Constructor and Description |
---|
Item(java.lang.String name,
java.lang.String mode)
Constructs a subscription Item with a supplied subscription mode
and default subscription preferences.
|
Item(java.lang.String name,
java.lang.String dataAdapter,
java.lang.String mode)
Constructs a subscription Item with a supplied subscription mode
and Data Adapter name and default subscription preferences.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
Compares two Item instances and declares them as equal if all of the
following conditions apply:
the instances refer to the same information Item;
all subscription preferences coincide;
neither Item has been set as unique.
|
java.lang.Integer |
getBufferSize()
Gets the maximum size for the Server ItemEventBuffer for the Item.
|
java.lang.String |
getDataAdapter()
Gets the name of the Data Adapter (within the Adapter Set used by the
current session) that supplies the Item.
|
int |
getDistinctSnapshotLength()
Gets the length of the Snapshot to be maintained for the Item, if the
Item is to be subscribed in DISTINCT mode
|
java.lang.Double |
getMaxFrequency()
Gets the maximum Server update frequency for the Item.
|
java.lang.String |
getMode()
Gets the subscription mode of the Item.
|
java.lang.String |
getName()
Gets the name of the information Item supplied by Lightstreamer Server
through a Data Adapter.
|
java.lang.String |
getSelector()
Gets the optional selector associated to the Item.
|
int |
hashCode()
Supplies a hash code consistent with object equality.
|
boolean |
isUnfiltered()
Gets the setting for unfiltered dispatching.
|
void |
requestUnfilteredDispatching()
Requests that events for the Item are dispatched in an unfiltered way.
|
void |
setDistinctSnapshotLength(int length)
Sets the length of the Snapshot to be maintained for an Item subscribed
in DISTINCT mode.
|
void |
setRequestedBufferSize(int bufferSize)
Sets the requested size for the Server ItemEventBuffer for the Item.
|
void |
setRequestedMaxFrequency(double maxFrequency)
Sets the maximum Server update frequency for the Item.
|
void |
setSelector(java.lang.String selector)
Specifies a selector to be applied by the Server to the updates
pertaining to the Item.
|
void |
setUnique()
Forces the Item instance not to be equal to other Item instances related
to the same information Item and with the same subscription preferences.
|
java.lang.String |
toString() |
public static final java.lang.String MERGE
public static final java.lang.String DISTINCT
public static final java.lang.String RAW
public static final java.lang.String COMMAND
public static final java.lang.String KEY_FIELD
public static final java.lang.String COMMAND_FIELD
public static final java.lang.String ADD_COMMAND
public static final java.lang.String UPDATE_COMMAND
public static final java.lang.String DELETE_COMMAND
public Item(java.lang.String name, java.lang.String mode) throws ItemException
name
- name of an information Item supplied by Lightstreamer
Server through a Data Adapter.mode
- a subscription mode. Must be chosen among the constants
defined in this class.ItemException
- thrown in case of inconsistency in the supplied
parameters.getDataAdapter()
,
ConnectionInfo.adapter
public Item(java.lang.String name, java.lang.String dataAdapter, java.lang.String mode) throws ItemException
name
- name of an information Item supplied by Lightstreamer
Server through a Data Adapter.dataAdapter
- name of the Data Adapter (within the current
Adapter Set) that supplies the item.mode
- a subscription mode. Must be chosen among the constants
defined in this class.ItemException
- thrown in case of inconsistency in the supplied
parameters.getDataAdapter()
public void setUnique()
public void setSelector(java.lang.String selector)
selector
- name of a Selector. It will be interpreted
by the Metadata Adapter.public void setRequestedBufferSize(int bufferSize) throws ItemException
bufferSize
- the size requested for the ItemEventBuffer. It must
not be negative.ItemException
- thrown if buffer size setting is not compatible
with the Item subscription mode.public void setRequestedMaxFrequency(double maxFrequency) throws ItemException
maxFrequency
- the frequency requested for the Item Updates, in
updates/sec. It must not be negative.ItemException
- thrown if maximum frequency setting is not
compatible with the Item subscription mode.public void requestUnfilteredDispatching() throws ItemException
ItemException
- Thrown if unfiltered dispatching is not
compatible with the Item subscription mode.public void setDistinctSnapshotLength(int length) throws ItemException
length
- the Snapshot length. It must not be negative. A zero
value means that no snapshot will be received for the Item.ItemException
- thrown if the Item subscription mode is not
DISTINCT.public java.lang.String getName()
public java.lang.String getDataAdapter()
public java.lang.String getMode()
public java.lang.String getSelector()
public java.lang.Integer getBufferSize()
public java.lang.Double getMaxFrequency()
public boolean isUnfiltered()
public int getDistinctSnapshotLength()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- object to compare.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object