Public Member Functions | |
CCNxServiceControl (Context ctx) | |
void | registerCallback (CCNxServiceCallback cb) |
void | unregisterCallback () |
boolean | startAll () |
Start the CCN daemon and Repo If configuration parameters have been set these will be used This is a BLOCKING call. | |
void | startAllInBackground () |
Start the CCN daemon and Repo If configuration parameters have been set these will be used This is a non-blocking call. | |
void | connect () |
void | disconnect () |
Disconnect from the services. | |
void | stoptAll () |
Stop the CCN daemon and Repo This call will unbind from the service and stop it. | |
boolean | isCcndRunning () |
boolean | isRepoRunning () |
void | startCcnd () |
void | stopCcnd () |
void | startRepo () |
void | stopRepo () |
void | newCCNxAPIStatus (SERVICE_STATUS s) |
void | setCcndOption (CCND_OPTIONS option, String value) |
void | setRepoOption (REPO_OPTIONS option, String value) |
void | setSyncOption (CCNS_OPTIONS option, String value) |
void | setCcnrOption (CCNR_OPTIONS option, String value) |
boolean | isAllRunning () |
Are ccnd and the repo running and ready? | |
SERVICE_STATUS | getCcndStatus () |
SERVICE_STATUS | getRepoStatus () |
Package Attributes | |
CcndWrapper | ccndInterface |
RepoWrapper | repoInterface |
Context | _ctx |
CCNxServiceCallback | _cb = null |
SERVICE_STATUS | ccndStatus = SERVICE_STATUS.SERVICE_OFF |
SERVICE_STATUS | repoStatus = SERVICE_STATUS.SERVICE_OFF |
CCNxServiceCallback | ccndCallback |
CCNxServiceCallback | repoCallback |
It provides abstractions so that the programs can start and stop the services as well as interact with them for configuration and monitoring.
boolean org.ccnx.android.ccnlib.CCNxServiceControl.startAll | ( | ) |
Start the CCN daemon and Repo If configuration parameters have been set these will be used This is a BLOCKING call.
void org.ccnx.android.ccnlib.CCNxServiceControl.startAllInBackground | ( | ) |
Start the CCN daemon and Repo If configuration parameters have been set these will be used This is a non-blocking call.
If you want to be notified when everything has started then you should register a callback before issuing this call.
void org.ccnx.android.ccnlib.CCNxServiceControl.disconnect | ( | ) |
Disconnect from the services.
This is needed for a clean exit from an application. It leaves the services running.
void org.ccnx.android.ccnlib.CCNxServiceControl.stoptAll | ( | ) |
Stop the CCN daemon and Repo This call will unbind from the service and stop it.
There is no need to issue a disconnect().
boolean org.ccnx.android.ccnlib.CCNxServiceControl.isAllRunning | ( | ) |
Are ccnd and the repo running and ready?
CCNxServiceCallback org.ccnx.android.ccnlib.CCNxServiceControl.ccndCallback [package] |
Initial value:
new CCNxServiceCallback(){ @Override public void newCCNxStatus(SERVICE_STATUS st) { Log.i(TAG,"ccndCallback ccndStatus = " + st.toString()); ccndStatus = st; switch(ccndStatus){ case SERVICE_OFF: newCCNxAPIStatus(SERVICE_STATUS.CCND_OFF); break; case SERVICE_INITIALIZING: newCCNxAPIStatus(SERVICE_STATUS.CCND_INITIALIZING); break; case SERVICE_TEARING_DOWN: newCCNxAPIStatus(SERVICE_STATUS.CCND_TEARING_DOWN); break; case SERVICE_RUNNING: newCCNxAPIStatus(SERVICE_STATUS.CCND_RUNNING); break; } } }
CCNxServiceCallback org.ccnx.android.ccnlib.CCNxServiceControl.repoCallback [package] |
Initial value:
new CCNxServiceCallback(){ @Override public void newCCNxStatus(SERVICE_STATUS st) { Log.i(TAG,"repoCallback repoStatus = " + st.toString()); repoStatus = st; switch(repoStatus){ case SERVICE_OFF: newCCNxAPIStatus(SERVICE_STATUS.REPO_OFF); break; case SERVICE_INITIALIZING: newCCNxAPIStatus(SERVICE_STATUS.REPO_INITIALIZING); break; case SERVICE_TEARING_DOWN: newCCNxAPIStatus(SERVICE_STATUS.REPO_TEARING_DOWN); break; case SERVICE_RUNNING: newCCNxAPIStatus(SERVICE_STATUS.REPO_RUNNING); break; } } }