interface OutriggerServer extends TransactionParticipant, Landlord, OutriggerAdmin, ServiceProxyAccessor, Remote
EntryRep
Modifier and Type | Interface and Description |
---|---|
static interface |
OutriggerServer.QueryCookie
Marker interface for objects that represent state
that the server finds useful to share across sub-queries.
|
Landlord.RenewResults
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING
Modifier and Type | Method and Description |
---|---|
MatchSetData |
contents(EntryRep[] tmpls,
Transaction tr,
long leaseTime,
long limit)
Start a new contents query.
|
Object |
getAdmin()
Return the admin proxy for this space.
|
EntryRep[] |
nextBatch(Uuid contentsQueryUuid,
Uuid entryUuid)
Return the next batch of entries associated with the specified
contents query.
|
EventRegistration |
notify(EntryRep tmpl,
Transaction txn,
RemoteEventListener listener,
long lease,
MarshalledObject handback)
When entries are written that match this template notify the
given
listener . |
Object |
read(EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find an entry in the space that matches the passed template and
is visible to the passed transaction.
|
Object |
readIfExists(EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find an entry in the space that matches the passed template and
is visible to the passed transaction.
|
EventRegistration |
registerForAvailabilityEvent(EntryRep[] tmpls,
Transaction txn,
boolean visibilityOnly,
RemoteEventListener listener,
long leaseTime,
MarshalledObject handback)
When entries that match one or more of the passed templates
transition from invisible to visible notify the give
listener . |
Object |
take(EntryRep[] tmpls,
Transaction tr,
long timeout,
int limit,
OutriggerServer.QueryCookie cookie)
Find and remove up to
limit entries in the space
that match one or more of the passed templates and are visible
to the passed transaction. |
Object |
take(EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find and remove an entry in the space that matches the passed
template and is visible to the passed transaction.
|
Object |
takeIfExists(EntryRep tmpl,
Transaction txn,
long timeout,
OutriggerServer.QueryCookie cookie)
Find and remove an entry in the space that matches the passed
template and is visible to the passed transaction.
|
long[] |
write(EntryRep[] entries,
Transaction txn,
long[] leaseTimes)
Write a set of entires into the space.
|
long[] |
write(EntryRep entry,
Transaction txn,
long lease)
Write a new entry into the space.
|
abort, commit, prepare, prepareAndCommit
close, contents, delete, nextReps, space
destroy
addLookupAttributes, addLookupGroups, addLookupLocators, getLookupAttributes, getLookupGroups, getLookupLocators, modifyLookupAttributes, removeLookupGroups, removeLookupLocators, setLookupGroups, setLookupLocators
getServiceProxy
long[] write(EntryRep entry, Transaction txn, long lease) throws TransactionException, RemoteException
TransactionException
- A transaction error occurredRemoteException
Object read(EntryRep tmpl, Transaction txn, long timeout, OutriggerServer.QueryCookie cookie) throws TransactionException, RemoteException, InterruptedException
timeout
parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie
as response to the sub-queries, in
these cases it should pass the QueryCookie
to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep
.
If txn
is non-null
the
entry is read locked by the transaction, this allows
other queries to read, but not take the entry. The lock
will be released when the transaction is aborted or prepared.
If no match is found the call will block for up to the
specified timeout for a match to appear. If there
is still no match available the call will return a
QueryCookie
.
tmpl
- The template that describes the entry being
searched for. May be null
if
any visible entry is acceptable.txn
- The transaction the operation should be
performed under. Maybe be null
.
If non-null and entry is found it
will read locked/removed under this
transaction.timeout
- The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null
or a QueryCookie
(as appropriate) should be returned immediately.cookie
- If this call is a continuation of
an earlier query, the cookie from the
last sub-query.RemoteException
- if a network failure occurs.TransactionException
- if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.InterruptedException
- if the thread in the server
is interrupted before the query can be completed.SecurityException
- if the server decides
the caller has insufficient privilege to carry
out the operation.IllegalArgumentException
- if a negative timeout value is usedInternalSpaceException
- if there is an internal problem
with the server.Object readIfExists(EntryRep tmpl, Transaction txn, long timeout, OutriggerServer.QueryCookie cookie) throws TransactionException, RemoteException, InterruptedException
timeout
parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie
as response to the sub-queries, in
these cases it should pass the QueryCookie
to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep
.
If txn
is non-null
the
entry is read locked by the transaction, this allows
other queries to read, but not take the entry. The lock
will be released when the transaction is aborted or prepared.
If no match can be initially found the call will block until
either the timeout expires or for a detectable period of time
there are no entries in the space (visible to the transaction
or not) that match the passed template. If at some point
there are no matching entries in the space null
will be returned. If the timeout expires and there are matching
entries in the space but none are visible to the passed
transaction a QueryCookie
will be returned.
tmpl
- The template that describes the entry being
searched for. May be null
if
any visible entry is acceptable.txn
- The transaction the operation should be
performed under. Maybe be null
.
If non-null and entry is found it
will read locked/removed under this
transaction.timeout
- The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null
or a QueryCookie
(as appropriate) should be returned immediately.cookie
- If this call is a continuation of
an earlier query, the cookie from the
last sub-query.RemoteException
- if a network failure occurs.TransactionException
- if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.InterruptedException
- if the thread in the server
is interrupted before the query can be completed.SecurityException
- if the server decides
the caller has insufficient privilege to carry
out the operation.IllegalArgumentException
- if a negative timeout value is usedInternalSpaceException
- if there is an internal problem
with the server.Object take(EntryRep tmpl, Transaction txn, long timeout, OutriggerServer.QueryCookie cookie) throws TransactionException, RemoteException, InterruptedException
timeout
parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie
as response to the sub-queries, in
these cases it should pass the QueryCookie
to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep
.
If txn
is null
the entry is removed
from the space. If txn
is non-null
the
entry is exclusively locked by the transaction and will be removed
from the space if the transaction is committed.
If no match is found the call will block for up to the
specified timeout for a match to appear. If there
is still no match available the call will return a
QueryCookie
.
tmpl
- The template that describes the entry being
searched for. May be null
if
any visible entry is acceptable.txn
- The transaction the operation should be
performed under. Maybe be null
.
If non-null and entry is found it
will read locked/removed under this
transaction.timeout
- The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null
or a QueryCookie
(as appropriate) should be returned immediately.cookie
- If this call is a continuation of
an earlier query, the cookie from the
last sub-query.RemoteException
- if a network failure occurs.TransactionException
- if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.InterruptedException
- if the thread in the server
is interrupted before the query can be completed.SecurityException
- if the server decides
the caller has insufficient privilege to carry
out the operation.IllegalArgumentException
- if a negative timeout value is usedInternalSpaceException
- if there is an internal problem
with the server.Object takeIfExists(EntryRep tmpl, Transaction txn, long timeout, OutriggerServer.QueryCookie cookie) throws TransactionException, RemoteException, InterruptedException
timeout
parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie
as response to the sub-queries, in
these cases it should pass the QueryCookie
to the
next sub-query (if any) associated with the same request from
the client.
If a match is found it is returned as an EntryRep
.
If txn
is null
the entry is removed
from the space. If txn
is non-null
the
entry is exclusively locked by the transaction and will be removed
from the space if the transaction is committed.
If no match can be initially found the call will block until
either the timeout expires or for a detectable period of time
there are no entries in the space (visible to the transaction
or not) that match the passed template. If at some point there
are no matching entries in the space null
will be
returned. If the timeout expires and there are matching entries
in the space but none are visible to the passed transaction a
QueryCookie
will be returned.
tmpl
- The template that describes the entry being
searched for. May be null
if
any visible entry is acceptable.txn
- The transaction the operation should be
performed under. Maybe be null
.
If non-null and entry is found it
will read locked/removed under this
transaction.timeout
- The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
null
or a QueryCookie
(as appropriate) should be returned immediately.cookie
- If this call is a continuation of
an earlier query, the cookie from the
last sub-query.RemoteException
- if a network failure occurs.TransactionException
- if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.InterruptedException
- if the thread in the server
is interrupted before the query can be completed.SecurityException
- if the server decides
the caller has insufficient privilege to carry
out the operation.IllegalArgumentException
- if a negative timeout value is usedInternalSpaceException
- if there is an internal problem
with the server.EventRegistration notify(EntryRep tmpl, Transaction txn, RemoteEventListener listener, long lease, MarshalledObject handback) throws TransactionException, RemoteException
listener
. Matching is done as for read
.TransactionException
RemoteException
long[] write(EntryRep[] entries, Transaction txn, long[] leaseTimes) throws TransactionException, RemoteException
Uuid
and then the lower order bits
of the Uuid
.TransactionException
- A transaction error occurredRemoteException
Object take(EntryRep[] tmpls, Transaction tr, long timeout, int limit, OutriggerServer.QueryCookie cookie) throws TransactionException, RemoteException
limit
entries in the space
that match one or more of the passed templates and are visible
to the passed transaction. Depending on the state of the space
and the arguments this call may block if no entry can be
immediately returned. The proxy can specify the maximum period
it is willing to wait for a response using the
timeout
parameter. The proxy may choose to
breakup a query from the client with a very long timeout into a
set of sub-queries. In such cases it may get a
QueryCookie
as response to the sub-queries, in
these cases it should pass the QueryCookie
to the
next sub-query (if any) associated with the same request from
the client.
If matchs are found they are returned as in an array of
EntryRep
. If txn
is
null
the entries are removed from the space. If
txn
is non-null
the entries are
exclusively locked by the transaction and will be removed from
the space if the transaction is committed.
If there are no matches the call will block for up to the
specified timeout for a match to appear. If there is still no
match available the call will return a
QueryCookie
.
tmpls
- The templates that describes the entries being
searched fortr
- The transaction the operation should be
performed under. Maybe be null
.
If non-null and entries are found they
will removed under this transaction.timeout
- The maximum number of milliseconds this
call should block in the server before
returning an answer (this not necessarily
the timeout the client asked for.) A value
of 0 indicates the initial search should
be performed, but if no match can be found
a QueryCookie
should be
returned immediately.limit
- The maximum number of entries that should be takencookie
- If this call is a continuation of
an earlier query, the cookie from the
last sub-query.RemoteException
- if a network failure occurs.TransactionException
- if there is a problem
with the specified transaction such as
it can not be joined, or leaves the active
state before the call is complete.SecurityException
- if the server decides
the caller has insufficient privilege to carry
out the operation.IllegalArgumentException
- if a negative timeout value is used
or if a non-positive limit value is usedInternalSpaceException
- if there is an internal problem
with the server.EventRegistration registerForAvailabilityEvent(EntryRep[] tmpls, Transaction txn, boolean visibilityOnly, RemoteEventListener listener, long leaseTime, MarshalledObject handback) throws TransactionException, RemoteException
listener
. Matching is done as for
read
.tmpls
- the templates that specify what entries should
generate eventstxn
- if non-null
entries that become
visible to txn
should generate events even
if txn
is never committed. Registration is
terminated when txn
leaves the active statevisibilityOnly
- if true
, events will
be generated for this registration only when a
matching Entry
transitions from
invisible to visible, otherwise events will be
generated when a matching Entry
makes any transition from unavailable to
availablelistener
- object to notify when an entry becomes (re)visibleleaseTime
- initial requested lease time for the registrationhandback
- object to be included with every notificationTransactionException
- if txn
is
non-null
and not active or otherwise invalidRemoteException
MatchSetData contents(EntryRep[] tmpls, Transaction tr, long leaseTime, long limit) throws TransactionException, RemoteException
MatchSetData
with the initial batch of
entries and (if applicable) the Uuid
and initial
lease duration. If the entire result set is contained in the
returned MatchSetData
the Uuid
will be null
and the lease duration will be
-1
.tmpls
- the templates to use for the iterationtr
- the transaction to perform the iteration under,
may be null
leaseTime
- the requested lease timelimit
- the maximum number of entries to returnMatchSetData
with the initial batch
of entries and (if applicable) the Uuid
and initial
lease duration. Initial batch will be the empty array if
there are no matching entries in the spaceTransactionException
- if
tr
is non-null
and can't be usedIllegaleArgumentException
- if limit is non-positive or
leaseTime is less than -1NullPointerException
- if tmpls is null
RemoteException
EntryRep[] nextBatch(Uuid contentsQueryUuid, Uuid entryUuid) throws RemoteException
contentsQueryUuid
- the id of the contents queryentryUuid
- the id of the last entry in the last batch.
If this does not match what the server has on recored
it will re-send the previous batch.EntryRep
s representing
the next batch of entries from the query. Query
is complete if array is not full. Returns an empty
array if there are no entries leftNoSuchObjectException
- if the server has no record
of contentsQueryUuid
RemoteException
Object getAdmin() throws RemoteException
RemoteException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.