public abstract class SQLiteHouseSignalAPI
extends java.lang.Object
SQLiteHouseKeeper
and SQLiteHouseRelay
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_EXTRA_TAG_FORMAT
The default format string for constructing intent extra tags.
|
static java.lang.String |
DEFAULT_KEEPER_ACTION_FORMAT
The default format string for constructing keeper actions.
|
static java.lang.String |
DEFAULT_RELAY_ACTION_FORMAT
The default format string for constructing relay actions.
|
static java.lang.String |
EXTRA_INSERT_ROW_ID
Name suffix for the extra that contains the inserted row ID.
|
static java.lang.String |
EXTRA_RESULT_ROW_COUNT
Name suffix for the extra that contains the number of rows selected,
updated, or deleted.
|
static java.lang.String |
EXTRA_SCHEMA_CLASS_DATA
Name suffix for the extra that contains the schematic class data.
|
static java.lang.String |
EXTRA_SCHEMA_CLASS_NAME
Name suffix for the extra that contains the schematic class name.
|
static java.lang.String |
EXTRA_SELECTION_QUERY_SPEC
Name suffix for the extra that contains the bundle that defines a set of
selection parameters.
|
static java.lang.String[] |
KEEPER_ACTIONS
The set of actions which are supported by the keeper implementation.
|
static java.lang.String |
KEEPER_DELETE
Action suffix for deleting objects.
|
static java.lang.String |
KEEPER_INSERT
Action suffix for inserting an object.
|
static java.lang.String |
KEEPER_SELECT
Action suffix for selecting objects.
|
static java.lang.String |
KEEPER_UPDATE
Action suffix for updating objects.
|
static java.lang.String |
LOG_TAG |
protected java.lang.String[] |
m_asCustomKeeperActions
A set of custom actions expected to be supported by a
SQLiteHouseKeeper implementation. |
protected java.lang.String[] |
m_asCustomRelayActions
A set of custom actions expected to be supported by a
SQLiteHouseRelay implementation. |
protected SQLightable.ReflectionMap |
m_mapReflections
Cache of reflections that have been pushed through the relay.
|
protected java.lang.String |
m_sExtraTagFormat
The format string to be used when creating intent extra tags.
|
protected java.lang.String |
m_sKeeperActionFormat
The format string to be used when creating keeper action tags.
|
protected java.lang.String |
m_sRelayActionFormat
The format string to be used when creating relay action tags.
|
static java.lang.String[] |
RELAY_ACTIONS
The set of actions which are supported by the relay implementation.
|
static java.lang.String |
RELAY_NOTIFY_DELETE
Action suffix for notifying a relay that a record was deleted.
|
static java.lang.String |
RELAY_NOTIFY_DELETE_FAILED
Action suffix for notifying a relay that a deletion failed.
|
static java.lang.String |
RELAY_NOTIFY_INSERT
Action suffix for notifying a relay that a record was inserted.
|
static java.lang.String |
RELAY_NOTIFY_INSERT_FAILED
Action suffix for notifying a relay that an insertion failed.
|
static java.lang.String |
RELAY_NOTIFY_SELECT_FAILED
Action suffix when notifying a relay that a selection failed.
|
static java.lang.String |
RELAY_NOTIFY_UPDATE
Action suffix for notifying a relay that a record was updated.
|
static java.lang.String |
RELAY_NOTIFY_UPDATE_FAILED
Action suffix for notifying a relay that an update failed.
|
static java.lang.String |
RELAY_RECEIVE_SELECTION
Action suffix when sending a result set to a relay.
|
Constructor and Description |
---|
SQLiteHouseSignalAPI() |
Modifier and Type | Method and Description |
---|---|
<SC extends SQLightable> |
getClassFromExtra(android.content.Intent sig)
Discovers and returns the schematic class definition that is named in an
intent sent from a relay to a keeper.
|
<SC extends SQLightable> |
getDataFromBundle(android.content.Intent sig,
java.lang.Class<SC> cls)
Discovers and extracts an instance of a schematic class from an extra
provided in an intent from a relay to a keeper.
|
java.lang.String |
getExtraSchemaClassName(android.content.Intent sig)
Shorthand to retrieve the schematic class name, which is used by almost
every keeper and relay function.
|
java.lang.String |
getExtraTagFormat()
Accesses the format string used to construct name tags for
Intent
extras. |
java.lang.String |
getFormattedExtraTag(java.lang.String sToken)
Constructs the full name tag for an
Intent extra to be exchanged
between a keeper and a relay. |
java.lang.String |
getFormattedKeeperAction(java.lang.String sToken)
Creates a fully-formed action name for the keeper.
|
java.lang.String |
getFormattedRelayAction(java.lang.String sToken)
Creates a fully-formed action name for the relay.
|
protected abstract java.lang.String |
getIntentDomain()
Reveals the "domain" under which the keeper and relay will operate.
|
java.lang.String |
getKeeperActionFormat()
Accesses the format string used to construct keeper actions.
|
java.lang.String[] |
getKeeperActions()
Accesses the set of keeper actions which will be registered.
|
android.content.IntentFilter |
getKeeperIntentFilter()
Constructs the
IntentFilter for the SQLiteHouseKeeper
implementation. |
java.lang.String |
getRelayActionFormat()
Accesses the format string used to construct relay actions.
|
java.lang.String[] |
getRelayActions()
Accesses the set of relay actions which will be registered.
|
android.content.IntentFilter |
getRelayIntentFilter()
Constructs the
IntentFilter for the SQLiteHouseRelay
implementation. |
java.lang.String |
getTokenFromKeeperAction(java.lang.String sAction)
Extracts the action token from a fully-formatted keeper action string.
|
java.lang.String |
getTokenFromRelayAction(java.lang.String sAction)
Extracts the action token from a fully-formatted relay action string.
|
protected <SC extends SQLightable> |
reflect(java.lang.Class<SC> cls)
Uses a cached
SQLightable.Reflection if available; otherwise,
caches a new one, then returns it. |
protected <SC extends SQLightable> |
reflect(SC o)
Uses a cached
SQLightable.Reflection if available; otherwise,
caches a new one, then returns it. |
SQLiteHouseSignalAPI |
setExtraTagFormat(java.lang.String sFormat)
Sets the format string used to construct tags for
Intent extras
that are exchanged between the keeper and the relay. |
SQLiteHouseSignalAPI |
setKeeperActionFormat(java.lang.String sFormat)
Sets the format string used to construct actions for
Intent s that
are dispatched to SQLiteHouseKeeper s. |
SQLiteHouseSignalAPI |
setKeeperActions(java.lang.String[] asCustomActions)
Adds a list of custom actions which are expected from a
SQLiteHouseKeeper implementation. |
SQLiteHouseSignalAPI |
setRelayActionFormat(java.lang.String sFormat)
Sets the format string used to construct actions for
Intent s that
are dispatched to SQLiteHouseRelay s. |
SQLiteHouseSignalAPI |
setRelayActions(java.lang.String[] asCustomActions)
Adds a list of custom actions which are expected from a
SQLiteHouseRelay implementation. |
public static final java.lang.String LOG_TAG
public static final java.lang.String EXTRA_SCHEMA_CLASS_NAME
public static final java.lang.String EXTRA_SCHEMA_CLASS_DATA
public static final java.lang.String EXTRA_INSERT_ROW_ID
public static final java.lang.String EXTRA_RESULT_ROW_COUNT
public static final java.lang.String EXTRA_SELECTION_QUERY_SPEC
public static final java.lang.String DEFAULT_EXTRA_TAG_FORMAT
public static final java.lang.String KEEPER_INSERT
public static final java.lang.String KEEPER_SELECT
public static final java.lang.String KEEPER_UPDATE
public static final java.lang.String KEEPER_DELETE
public static final java.lang.String[] KEEPER_ACTIONS
public static final java.lang.String DEFAULT_KEEPER_ACTION_FORMAT
public static final java.lang.String RELAY_NOTIFY_INSERT
public static final java.lang.String RELAY_NOTIFY_INSERT_FAILED
public static final java.lang.String RELAY_RECEIVE_SELECTION
public static final java.lang.String RELAY_NOTIFY_SELECT_FAILED
public static final java.lang.String RELAY_NOTIFY_UPDATE
public static final java.lang.String RELAY_NOTIFY_UPDATE_FAILED
public static final java.lang.String RELAY_NOTIFY_DELETE
public static final java.lang.String RELAY_NOTIFY_DELETE_FAILED
public static final java.lang.String[] RELAY_ACTIONS
public static final java.lang.String DEFAULT_RELAY_ACTION_FORMAT
protected SQLightable.ReflectionMap m_mapReflections
protected java.lang.String[] m_asCustomKeeperActions
SQLiteHouseKeeper
implementation.protected java.lang.String m_sKeeperActionFormat
DEFAULT_KEEPER_ACTION_FORMAT
.protected java.lang.String[] m_asCustomRelayActions
SQLiteHouseRelay
implementation.protected java.lang.String m_sRelayActionFormat
DEFAULT_RELAY_ACTION_FORMAT
.protected java.lang.String m_sExtraTagFormat
protected abstract java.lang.String getIntentDomain()
Intent
action tokens.public final java.lang.String[] getKeeperActions()
KEEPER_ACTIONS
. If the
SQLiteHouseKeeper
implementation also supports custom actions,
then they should be registered with setKeeperActions(java.lang.String[])
, which will
append the custom list to the default.public final SQLiteHouseSignalAPI setKeeperActions(java.lang.String[] asCustomActions)
SQLiteHouseKeeper
implementation.asCustomActions
- the list of custom actionspublic final java.lang.String getKeeperActionFormat()
public final SQLiteHouseSignalAPI setKeeperActionFormat(java.lang.String sFormat)
Intent
s that
are dispatched to SQLiteHouseKeeper
s. This format string
must have two string variables.
Defaults to DEFAULT_KEEPER_ACTION_FORMAT
if a null or empty
value is supplied.sFormat
- the format stringpublic final java.lang.String getFormattedKeeperAction(java.lang.String sToken)
sToken
- the action token (suffix) to be appendedpublic java.lang.String getTokenFromKeeperAction(java.lang.String sAction)
sAction
- the fully-formatted keeper actionpublic final android.content.IntentFilter getKeeperIntentFilter()
IntentFilter
for the SQLiteHouseKeeper
implementation.public final java.lang.String[] getRelayActions()
RELAY_ACTIONS
. If the
SQLiteHouseRelay
implementation also supports custom actions,
then they should be registered with setRelayActions(java.lang.String[])
, which will
append the custom list to the default.public final SQLiteHouseSignalAPI setRelayActions(java.lang.String[] asCustomActions)
SQLiteHouseRelay
implementation.asCustomActions
- the list of custom actionspublic final java.lang.String getRelayActionFormat()
public final SQLiteHouseSignalAPI setRelayActionFormat(java.lang.String sFormat)
Intent
s that
are dispatched to SQLiteHouseRelay
s. This format string
must have two string variables.
Defaults to DEFAULT_RELAY_ACTION_FORMAT
if a null or empty
value is supplied.sFormat
- the format stringpublic final java.lang.String getFormattedRelayAction(java.lang.String sToken)
sToken
- the action token (suffix) to be appendedpublic java.lang.String getTokenFromRelayAction(java.lang.String sAction)
sAction
- the fully-formatted relay actionpublic final android.content.IntentFilter getRelayIntentFilter()
IntentFilter
for the SQLiteHouseRelay
implementation.public final java.lang.String getExtraTagFormat()
Intent
extras.public final SQLiteHouseSignalAPI setExtraTagFormat(java.lang.String sFormat)
Intent
extras
that are exchanged between the keeper and the relay.
Defaults to DEFAULT_EXTRA_TAG_FORMAT
if a null or empty value is
supplied.sFormat
- the format stringpublic final java.lang.String getFormattedExtraTag(java.lang.String sToken)
Intent
extra to be exchanged
between a keeper and a relay.sToken
- the significant part of the extra token which makes it
unique among the extras in this APIpublic java.lang.String getExtraSchemaClassName(android.content.Intent sig)
sig
- the intentpublic <SC extends SQLightable> java.lang.Class<SC> getClassFromExtra(android.content.Intent sig) throws IntrospectionException, SQLiteContentException
SC
- the schematic classsig
- the intentSQLiteContentException
- if the intent is malformed, in that the
class name extra cannot be found or is emptyIntrospectionException
- if something goes wrong while discovering
the class definitionSQLiteContentException
- if the extra that's supposed to have the
class name in it can't be foundpublic <SC extends SQLightable> SC getDataFromBundle(android.content.Intent sig, java.lang.Class<SC> cls) throws SQLiteContentException, IntrospectionException, SchematicException
SC
- the schematic classsig
- the intentcls
- the schematic classSQLiteContentException
- if the intent is malformed, in that the
data extra cannot be found or is emptyIntrospectionException
- if an instance of the schematic class
can't be constructedSchematicException
- if a problem occurs while processing the
schematic classprotected <SC extends SQLightable> SQLightable.Reflection<SC> reflect(java.lang.Class<SC> cls)
SQLightable.Reflection
if available; otherwise,
caches a new one, then returns it.SC
- the schematic classcls
- the schematic classprotected <SC extends SQLightable> SQLightable.Reflection<SC> reflect(SC o)
SQLightable.Reflection
if available; otherwise,
caches a new one, then returns it.SC
- the schematic classo
- an instance of the schematic class