|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.connecterra.ale.alevent.EngineALEImpl
This class implements the Applicaiton Level Events (ALE) processing engine.
Because it implements the ALE interface, it may be called directly by an
application which shares a JVM with the ALE engine. More commonly, however,
an application is deployed in a different JVM, and accesses the ALE Engine by
using one of the remote client classes provided in the com.connecterra.ale.client
package.
Constructor Summary | |
EngineALEImpl(com.connecterra.util.RawConfig rc,
com.connecterra.ale.persistence.PersistenceManager pm,
NotificationManager nm,
com.connecterra.ale.reader.ReaderManager rm,
com.connecterra.ale.reader.CompositeReaderManager crm,
com.connecterra.ale.trigger.TriggerManager tm,
AlarmClock ac,
java.util.logging.Logger logger,
com.connecterra.ale.subscription.SubscriptionControls msc,
com.connecterra.ale.subscription.SubscriptionControls dsc,
java.lang.String aleID)
|
Method Summary | |
void |
define(java.lang.String name,
ECSpec spec)
Define a new event cycle specification for use with the poll(java.lang.String) and
subscribe(java.lang.String, java.net.URI) methods. |
ECSpec |
get(java.lang.String name)
Look up and return a previously defined event cycle specification by name. |
ALEFactory |
getALEFactory()
Returns a factory suitable for creating ALE objects to be used with this connection. |
java.lang.String |
getALEID()
Gets the ID of this ALE server. |
ECSpec |
getECSpec(java.lang.String name)
Look up and return a previously defined event cycle specification by name. |
ECSpecInfo |
getECSpecInfo(java.lang.String name)
Returns administrative information about an event cycle specification. |
java.util.List |
getECSpecNames()
Returns a list of the names of all event cycle specifications currently defined. |
ECSubscriptionInfo |
getECSubscriptionInfo(java.lang.String name,
java.net.URI uri)
Returns administrative information about an event cycle subscriber. |
int |
getEventCyclesCompletedCount()
|
ThreadPoolScheduler |
getScheduler()
|
java.lang.String |
getStandardVersion()
Returns a string that identifies what version of the EPCglobal ALE standard that this implementation complies with. |
java.util.List |
getSubscribers(java.lang.String specName)
Returns a list of URIs which are subscribed to asynchronous reports for the specified ECSpec name. |
java.lang.String |
getVendorVersion()
Returns a string that identifies the vendor and version of the implementation. |
ECReports |
immediate(ECSpec spec)
Immediately define an event cycle specification and activate it for one event cycle, synchronously returning a report. |
boolean |
isUsingCompositeReader(java.lang.String name)
|
boolean |
isUsingLogicalReader(com.connecterra.ale.reader.LogicalReader[] lrs)
|
boolean |
isUsingTrigger(java.lang.String triggerName)
|
java.util.List |
listECSpecNames()
Returns a list of the names of all event cycle specifications currently defined. |
java.util.List |
listLogicalReaderNames()
Returns a list of all logical reader names. |
java.util.List |
listSubscribers(java.lang.String name)
Returns a list of URIs which are subscribed to asynchronous reports for the specified ECSpec name. |
ECReports |
poll(java.lang.String name)
Activates a previously defined event cycle specification for one event cycle, synchronously returning a report. |
void |
redefine(java.lang.String name,
ECSpec spec)
Replace the ECSpec having the specified name with a new ECSpec. |
void |
redefinedCompositeReader(java.lang.String name)
Notification method called whenever the ALE Configuration API is used to define, redefine, or undefine composite readers. |
void |
redefinedLogicalReaders(com.connecterra.ale.reader.LogicalReader[] oldLRs,
com.connecterra.ale.reader.LogicalReader[] newLRs)
Notification method called whenever the ALE Configuration API is used to define, redefine, or undefine logical readers (via defining, redefining, or undefining a physical reader). |
void |
redefinedTrigger(java.lang.String triggerName,
com.connecterra.ale.trigger.TriggerDriver oldTD,
com.connecterra.ale.trigger.TriggerDriver newTD)
|
void |
shutdown()
This is a public, non-ALE method used to shutdown ALE processing. |
void |
subscribe(java.lang.String name,
java.net.URI uri)
Subscribe to asynchronous report delivery from an event cycle specification. |
void |
subscribe(java.lang.String name,
java.net.URI uri,
ECSubscriptionControls controls)
Subscribe to asynchronous report delivery from an event cycle specification. |
void |
suspend(java.lang.String ecSpecName)
Suspend the named event cycle specification. |
void |
undefine(java.lang.String name)
Undefine an event cycle specification. |
void |
unsubscribe(java.lang.String name,
java.net.URI uri)
Unsubscribe a specified destination from receiving asynchronous delivery of reports from a specified event cycle specification. |
void |
unsuspend(java.lang.String ecSpecName)
Return a suspended event cycle specification to its normal state. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EngineALEImpl(com.connecterra.util.RawConfig rc, com.connecterra.ale.persistence.PersistenceManager pm, NotificationManager nm, com.connecterra.ale.reader.ReaderManager rm, com.connecterra.ale.reader.CompositeReaderManager crm, com.connecterra.ale.trigger.TriggerManager tm, AlarmClock ac, java.util.logging.Logger logger, com.connecterra.ale.subscription.SubscriptionControls msc, com.connecterra.ale.subscription.SubscriptionControls dsc, java.lang.String aleID) throws com.connecterra.util.ConfigValidationException
Method Detail |
public ThreadPoolScheduler getScheduler()
public ALEFactory getALEFactory()
ALE
getALEFactory
in interface ALE
ALE.getALEFactory()
public java.lang.String getStandardVersion()
ALE
getStandardVersion
in interface ALE
ALE.getStandardVersion()
public java.lang.String getVendorVersion()
ALE
getVendorVersion
in interface ALE
ALE.getVendorVersion()
public int getEventCyclesCompletedCount()
public java.lang.String getALEID()
ALE
This method is an extension to the ALE 1.0 specification.
getALEID
in interface ALE
public void define(java.lang.String name, ECSpec spec) throws DuplicateNameException, ECSpecValidationException, EngineException
ALE
ALE.poll(java.lang.String)
and
ALE.subscribe(java.lang.String, java.net.URI, com.connecterra.ale.api.ECSubscriptionControls)
methods.
define
in interface ALE
name
- The name of the specification.spec
- The specification to define.
ECSpecValidationException
- if the ECSpec is invalid.
EngineException
- if there is an internal failure within the ALE implementation
DuplicateNameException
- if an ECSpec having the same name is already defined.ECSpec
public void redefine(java.lang.String name, ECSpec spec) throws NoSuchNameException, ECSpecValidationException, EngineException
ALE
redefine
in interface ALE
name
- The name of the specification.
ECSpecValidationException
- if the ECSpec is invalid.
EngineException
- if there is an internal failure within the ALE implementation
NoSuchNameException
- if there no ECSpec defined having the specified name.ECSpec
public void suspend(java.lang.String ecSpecName) throws NoSuchNameException, EngineException
ALE
ALE.poll(java.lang.String)
is
called on a suspended event cycle, it will throw an EngineException. If the event cycle
is already suspended, this call does nothing.
This method is an extension to the ALE 1.0 specification.
suspend
in interface ALE
ecSpecName
- The name of the specification to suspend.
NoSuchNameException
- if there no ECSpec defined having the specified name.
EngineException
- if there is an internal failure within the ALE implementationECSpecInfo.isSuspended()
public void unsuspend(java.lang.String ecSpecName) throws NoSuchNameException, EngineException
ALE
This method is an extension to the ALE 1.0 specification.
unsuspend
in interface ALE
ecSpecName
- The name of the specification to unsuspend.
EngineException
- if there is an internal failure within the ALE implementation
NoSuchNameException
- if there no ECSpec defined having the specified name.ALE.suspend(String)
public void undefine(java.lang.String name) throws NoSuchNameException, EngineException
ALE
undefine
in interface ALE
name
- The name of the specification to undefine.
EngineException
- if there is an internal failure within the ALE implementation
NoSuchNameException
- if there no ECSpec defined having the specified name.ALE.define(String, ECSpec)
public ECSpec getECSpec(java.lang.String name) throws NoSuchNameException, EngineException
ALE
getECSpec
in interface ALE
null
if there is no event
cycle specification defined with that name.
NoSuchNameException
- if an ECSpec with the specified name does not exist
EngineException
- if there is an internal failure within the ALE implementationECSpec
public ECSpec get(java.lang.String name) throws EngineException
ALE
get
in interface ALE
name
- The name of the specification to look up.
null
if there is no event
cycle specification defined with that name.
EngineException
- if there is an internal failure within the ALE implementationpublic java.util.List getECSpecNames()
ALE
getECSpecNames
in interface ALE
public java.util.List listECSpecNames()
ALE
listECSpecNames
in interface ALE
public void subscribe(java.lang.String name, java.net.URI uri) throws NoSuchNameException, InvalidURIException, EngineException
ALE
ALE.subscribe(String, URI, ECSubscriptionControls)
, with both the invalidate
count and invalidate interval set to zero.
subscribe
in interface ALE
name
- uri
-
NoSuchNameException
- if there no ECSpec defined having the specified name.
InvalidURIException
- if the specified URI cannot be interpreted, or has no driver available.
EngineException
- if there is an internal failure within the ALE implementationALE.subscribe(String, URI, ECSubscriptionControls)
,
ALE.unsubscribe(String, URI)
public void subscribe(java.lang.String name, java.net.URI uri, ECSubscriptionControls controls) throws NoSuchNameException, InvalidURIException, EngineException
ALE
ALE.poll(java.lang.String)
invocations, then the event cycle
specification is activated, causing tag reads to commence. The subscription lasts until
explicitly removed by calling the ALE.unsubscribe(java.lang.String, java.net.URI)
method, or when the failure
thresholds specified by controls
are exceeded.
If during report generation, the notification delivery for this subscription fails
controls.getFailureLimitCount()
times in a row with no successes, then the subscription is removed. If zero, the
subscription will not be unsubscribed due to an exceeded count, but may be unsubscribed
due to the interval.
If during report generation, given a previous notification failure at time T, a
notification fails more than controls.getFailureLimitInterval()
milliseconds after time T without an intervening
success, the subscription will be removed. If this is zero, the subscription will not
be unsubscribed due to an exceeded interval, but may be unsubscribed due to the count.
This method is an extension to the ALE 1.0 specification.
subscribe
in interface ALE
name
- The name of the specification to subscribe to.uri
- The destination for asynchronously delivered reports. See the RFTagAware Programmer
Guide for documentation of available notification URIs.controls
- Specifies the parameters which describe the behavior if notification
delivery fails. If null, default controls are used (no limit to the failure
count or failure interval).
EngineException
- if there is an internal failure within the ALE implementation
InvalidURIException
- if the specified URI cannot be interpreted, or has no driver available.
NoSuchNameException
- if there no ECSpec defined having the specified name.ALE.subscribe(String, URI)
,
ALE.unsubscribe(String, URI)
public void unsubscribe(java.lang.String name, java.net.URI uri) throws NoSuchNameException, NoSuchSubscriberException, EngineException
ALE
ALE.poll(java.lang.String)
invocations, then the event cycle specification
is deactivated, ceasing tag reading operations for all readers not otherwise engaged in
servicing other event cycles.
unsubscribe
in interface ALE
name
- The name of the specification to unsubscribe from.uri
- The destination that will no longer receive reports.
EngineException
- if there is an internal failure within the ALE implementation
NoSuchNameException
- if there no ECSpec defined having the specified name.
NoSuchSubscriberException
- if there is no subscription to the specified URI.ALE.subscribe(String, URI)
,
ALE.subscribe(String, URI, ECSubscriptionControls)
public java.util.List getSubscribers(java.lang.String specName) throws NoSuchNameException, EngineException
ALE
getSubscribers
in interface ALE
URI
instances, each a subscriber of the specified
event cycle specification.
EngineException
- if there is an internal failure within the ALE implementation
NoSuchNameException
- if there no ECSpec defined having the specified name.ECSpecInfo.getSubscriberCount()
public java.util.List listSubscribers(java.lang.String name) throws NoSuchNameException, EngineException
ALE
listSubscribers
in interface ALE
name
- The name of the specification.
URI
instances, each a subscriber of the specified
event cycle specification.
NoSuchNameException
- if there no ECSpec defined having the specified name.
EngineException
- if there is an internal failure within the ALE implementationECSpecInfo.getSubscriberCount()
public ECSpecInfo getECSpecInfo(java.lang.String name) throws NoSuchNameException, EngineException
ALE
getECSpecInfo
in interface ALE
name
- The name of the event cycle specification
ECSpecInfo
instance giving administrative information about the
specified event cycle specification.
NoSuchNameException
- if there no ECSpec defined having the specified name.
EngineException
- if there is an internal failure within the ALE implementationECSpecInfo
public ECSubscriptionInfo getECSubscriptionInfo(java.lang.String name, java.net.URI uri) throws NoSuchNameException, NoSuchSubscriberException, EngineException
ALE
This method is an extension to the ALE 1.0 specification.
getECSubscriptionInfo
in interface ALE
name
- The name of the event cycle specification
ECSubscriptionInfo
instance giving administrative information about
the specified event cycle subscription.
NoSuchSubscriberException
- if the URI specified is not subscribed to the specified ECSpec
NoSuchNameException
- if there no ECSpec defined having the specified name.
EngineException
- if there is an internal failure within the ALE implementationECSubscriptionInfo
public ECReports poll(java.lang.String name) throws java.lang.InterruptedException, NoSuchNameException, EngineException
ALE
ALE.poll(java.lang.String)
invocations, then a new activation of the event cycle is begun
immediately or when the start trigger is received (if the event cycle specification
specifies a start trigger). If instead there were previous subscribers or other active
ALE.poll(java.lang.String)
invocations, then this method may return reports from an event cycle
already in progress.
This method is an extension to the ALE 1.0 specification.
poll
in interface ALE
name
- The name of the event cycle specification to activate.
NoSuchNameException
- if there no ECSpec defined having the specified name.
java.lang.InterruptedException
- if this method was interrupted by another thread.
EngineException
- if the event cycle is suspended or redefined, or if there is an internal
failure within the ALE implementationECReports
public ECReports immediate(ECSpec spec) throws java.lang.InterruptedException, ECSpecValidationException, EngineException
ALE
ALE.define(java.lang.String, com.connecterra.ale.api.ECSpec)
, activating it for one event cycle using ALE.poll(java.lang.String)
, and
undefining it using ALE.undefine(java.lang.String)
, except that event cycle specifications created
using this method will not be visible to ALE.listECSpecNames()
or
ALE.getECSpecInfo(java.lang.String)
.
immediate
in interface ALE
spec
- The event cycle specification.
EngineException
- if there is an internal failure within the ALE implementation
java.lang.InterruptedException
- if this method was interrupted by another thread.
ECSpecValidationException
- if the ECSpec is invalid.ECReports
public java.util.List listLogicalReaderNames()
ALE
listLogicalReaderNames
in interface ALE
public boolean isUsingLogicalReader(com.connecterra.ale.reader.LogicalReader[] lrs)
public void redefinedLogicalReaders(com.connecterra.ale.reader.LogicalReader[] oldLRs, com.connecterra.ale.reader.LogicalReader[] newLRs)
public boolean isUsingCompositeReader(java.lang.String name)
public void redefinedCompositeReader(java.lang.String name)
public boolean isUsingTrigger(java.lang.String triggerName)
public void redefinedTrigger(java.lang.String triggerName, com.connecterra.ale.trigger.TriggerDriver oldTD, com.connecterra.ale.trigger.TriggerDriver newTD)
public void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |