|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MetadataProvider
Provides an interface to be implemented by a Metadata Adapter in order to attach a Metadata Provider to Lightstreamer Kernel. The configuration of an Adapter instance requires the following items:
init(Map, File)) should
be nonblocking, because they are called in threads taken from limited
pools. Slow execution on one call related to a particular client session
may cause delays on the execution of other sessions.
If the access to some external resource is needed in order to gather user
or item information, then the access should preferably be limited to
init(Map, File), notifyUser(String, String, Map),
getItems(String, String, String) and getSchema(String, String, String, String).
In this case, the size of the thread pool devoted to to the management
of the client requests should be properly set, through the
"server_pool_max_size" flag in the Server configuration file.
| Method Summary | |
|---|---|
void |
customizeUpdate(java.lang.String user,
java.lang.String item,
CustomizableItemEvent event)
Called by Lightstreamer Kernel in order to customize events pertaining to an ItemEventBuffer, if such customization has been requested through the enableUpdateCustomization method. |
boolean |
enableUpdateCustomization(java.lang.String user,
java.lang.String item)
Called by Lightstreamer Kernel to know whether the Metadata Adapter must or must not be given a chance to modify the values carried by the updates for a supplied Item in a push Session owned by a supplied User. |
int |
getAllowedBufferSize(java.lang.String user,
java.lang.String item)
Called by Lightstreamer Kernel to ask for the maximum size allowed for the buffer internally used to enqueue subsequent ItemUpdates for the same Item. |
double |
getAllowedMaxBandwidth(java.lang.String user)
Called by Lightstreamer Kernel to ask for the bandwidth level to be allowed to a User for a push Session. |
double |
getAllowedMaxItemFrequency(java.lang.String user,
java.lang.String item)
Called by Lightstreamer Kernel to ask for the ItemUpdate frequency to be allowed to a User for a specific Item. |
int |
getDistinctSnapshotLength(java.lang.String item)
Called by Lightstreamer Kernel to ask for the maximum allowed length for a Snapshot of an Item that has been requested with publishing Mode DISTINCT. |
java.lang.String[] |
getItems(java.lang.String user,
java.lang.String session,
java.lang.String id)
Called by Lightstreamer Kernel to resolve a Group name supplied in a Request. |
double |
getMinSourceFrequency(java.lang.String item)
Called by Lightstreamer Kernel to ask for the minimum ItemEvent frequency from the supplier Data Adapter at which the events for an Item are guaranteed to be delivered to the Clients without loss of information. |
java.lang.String[] |
getSchema(java.lang.String user,
java.lang.String session,
java.lang.String id,
java.lang.String schema)
Called by Lightstreamer Kernel to resolve a Schema name supplied in a Request. |
java.lang.String[] |
getUserSessions(java.lang.String user)
Deprecated. |
void |
init(java.util.Map params,
java.io.File configDir)
Called by Lightstreamer Kernel to provide initialization information to the Metadata Adapter. |
boolean |
isModeAllowed(java.lang.String user,
java.lang.String item,
Mode mode)
Called by Lightstreamer Kernel to ask for the allowance of a publishing Mode for an Item. |
boolean |
isSelected(java.lang.String user,
java.lang.String item,
java.lang.String selector,
ItemEvent event)
Called by Lightstreamer Kernel in order to filter events pertaining to an ItemEventBuffer, if the related Item was requested within a table with an associated Selector. |
boolean |
isSelectorAllowed(java.lang.String user,
java.lang.String item,
java.lang.String selector)
Called by Lightstreamer Kernel to ask for the allowance of a Selector for an Item. |
boolean |
modeMayBeAllowed(java.lang.String item,
Mode mode)
Called by Lightstreamer Kernel to ask for the allowance of a publishing Mode for an Item (for at least one User). |
void |
notifyNewSession(java.lang.String user,
java.lang.String session,
java.util.Map clientContext)
Called by Lightstreamer Kernel to check that a User is enabled to open a new push Session. |
void |
notifyNewTables(java.lang.String user,
java.lang.String session,
TableInfo[] tables)
Called by Lightstreamer Kernel to check that a User is enabled to add some Tables to a push Session. |
void |
notifySessionClose(java.lang.String session)
Called by Lightstreamer Kernel to notify the Metadata Adapter that a push Session has been closed. |
void |
notifyTablesClose(java.lang.String session,
TableInfo[] tables)
Called by Lightstreamer Kernel to notify the Metadata Adapter that some Tables have been removed from a push Session. |
void |
notifyUser(java.lang.String user,
java.lang.String password,
java.util.Map httpHeaders)
Called by Lightstreamer Kernel as a preliminary check that a user is enabled to make Requests to any of the related Data Providers. |
void |
notifyUserMessage(java.lang.String user,
java.lang.String session,
java.lang.String message)
Called by Lightstreamer Kernel to forward a message received by a User. |
boolean |
wantsTablesNotification(java.lang.String user)
Called by Lightstreamer Kernel to know whether the Metadata Adapter must or must not be notified any time a Table is added or removed from a push Session owned by a supplied User. |
| Method Detail |
|---|
void init(java.util.Map params,
java.io.File configDir)
throws MetadataProviderException
params - A Map-type value object that contains name-value pairs
corresponding to the "param" elements supplied in the Metadata Adapter
configuration file under the "metadata_provider" element.
Both names and values are represented as String objects.configDir - The path of the directory on the local disk
where the Metadata Adapter configuration file resides.
MetadataProviderException - if an error occurs that prevents
the correct behavior of the Metadata Adapter. This causes the Server
not to complete the startup and to exit.
void notifyUser(java.lang.String user,
java.lang.String password,
java.util.Map httpHeaders)
throws AccessException,
CreditsException
user - A User name.password - A password optionally required to validate the User.httpHeaders - A Map-type value object that contains a name-value
pair for each header found in the HTTP request that originated the call.
For headers defined multiple times, a unique name-value pair is reported,
where the value is a concatenation of all the supplied header values,
separated by a "," and, possibly, by some white spaces; this holds
regardless that the HTTP specifications allow the specific header
to be defined multiple times.
AccessException - if the User name is not known or the supplied
password is not correct.
CreditsException - if the User is known but is not enabled to
make further Requests at the moment.
java.lang.String[] getItems(java.lang.String user,
java.lang.String session,
java.lang.String id)
throws ItemsException
user - A User name.session - The name of a Session owned by the User.id - A Group name.
ItemsException - if the supplied Group name is not recognized.
java.lang.String[] getSchema(java.lang.String user,
java.lang.String session,
java.lang.String id,
java.lang.String schema)
throws ItemsException,
SchemaException
user - A User name.session - The name of a Session owned by the User.id - The name of a Group whose Items the Schema is to be applied
to.schema - A Schema name.
ItemsException - if the supplied Group name is not recognized.
SchemaException - if the supplied Schema name is not recognized.double getAllowedMaxBandwidth(java.lang.String user)
user - A User name.
double getAllowedMaxItemFrequency(java.lang.String user,
java.lang.String item)
user - A User name.item - An Item Name.
int getAllowedBufferSize(java.lang.String user,
java.lang.String item)
user - A User name.item - An Item Name.
boolean isModeAllowed(java.lang.String user,
java.lang.String item,
Mode mode)
user - A User name.item - An Item name.mode - A publishing Mode.
boolean modeMayBeAllowed(java.lang.String item,
Mode mode)
item - An Item name.mode - A publishing Mode.
boolean isSelectorAllowed(java.lang.String user,
java.lang.String item,
java.lang.String selector)
user - A User name.item - An Item name.selector - A selector name.
boolean isSelected(java.lang.String user,
java.lang.String item,
java.lang.String selector,
ItemEvent event)
user - A User name.item - An Item name.selector - A selector name.event - An update event for the Item.
boolean enableUpdateCustomization(java.lang.String user,
java.lang.String item)
user - A User name.item - An Item name.
void customizeUpdate(java.lang.String user,
java.lang.String item,
CustomizableItemEvent event)
user - A User name.item - An Item name.event - An update event for the Item, ready to be changed.double getMinSourceFrequency(java.lang.String item)
item - An Item Name.
int getDistinctSnapshotLength(java.lang.String item)
item - An Item Name.
java.lang.String[] getUserSessions(java.lang.String user)
throws AccessException
user - A User name.
AccessException - if the functionality is not available for this
User or for all Users.
void notifyUserMessage(java.lang.String user,
java.lang.String session,
java.lang.String message)
throws CreditsException,
NotificationException
user - A User name.session - The name of a Session owned by the User.message - A non-null string.
CreditsException - if the User is not enabled to send the
message or the message cannot be correctly managed.
NotificationException - if something is wrong in the parameters,
such as a nonexistent Session name.
void notifyNewSession(java.lang.String user,
java.lang.String session,
java.util.Map clientContext)
throws CreditsException,
NotificationException
user - A User name.session - The name of a new Session.clientContext - A Map-type value object that contains information
about the request context. All values are supplied as strings.
Information related to a client connection refers to the HTTP request
that originated the call. Available keys are:
CreditsException - if the User is not enabled to open the new
Session. If the user would be enabled as soon as another Session were
closed, a ConflictingSessionException can be thrown, in which the name
of the other Session must be specified.
NotificationException - if something is wrong in the parameters,
such as a name of a Session already open for this or a different User.
void notifySessionClose(java.lang.String session)
throws NotificationException
session - A Session name.
NotificationException - if something is wrong in the parameters,
such as a name of a Session that is not currently open.boolean wantsTablesNotification(java.lang.String user)
user - A User name.
void notifyNewTables(java.lang.String user,
java.lang.String session,
TableInfo[] tables)
throws CreditsException,
NotificationException
user - A User name.session - The name of a Session owned by the User.tables - An array of TableInfo instances, each of them containing
the details of a Table to be added to the Session.
CreditsException - if the User is not allowed to add the
specified Tables to the Session.
NotificationException - if something is wrong in the parameters,
such as a name of a Session that is not currently open or inconsistent
informations about a Table.
void notifyTablesClose(java.lang.String session,
TableInfo[] tables)
throws NotificationException
session - A Session name.tables - An array of TableInfo instances, each of them containing
the details of a Table that has been removed from the Session.
NotificationException - if something is wrong in the parameters,
such as a name of a Session that is not currently open or a Table that
is not contained in the Session.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||