Skip to content

Commit f463667

Browse files
committed
wrote documentation
1 parent 28315ba commit f463667

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/net/sharksystem/asap/android/apps/ASAPApplication.java

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ protected ASAPApplication(Collection<CharSequence> supportedFormats,
111111
this.askForPermissions();
112112
}
113113

114+
/**
115+
* This method must be called launch the ASAP application. The ASAP service is started that
116+
* deals with all supported layer 2 protocol and initiates ASAP session. Objects of
117+
* ASAPApplications (and derived classes) are in most cases proxies of this service.
118+
* <b>Never forget to launch your application.</b>
119+
*/
114120
@CallSuper
115121
public void startASAPApplication() {
116122
if(!this.initialized) {
@@ -150,6 +156,18 @@ public void startASAPApplication() {
150156
}
151157
}
152158

159+
/**
160+
* ASAP application and service run separately. Nevertheless, ASAP application knows the
161+
* location where each ASAP storage is kept. This method provides an object reference. Handle
162+
* this method with great care. You would work on a storage in parallel with the ASAP service.
163+
* There can be race conditions and most probably synchronization issues. It be also a
164+
* performance booster. You should really know what you are doing.
165+
*
166+
* @param appFormat
167+
* @return
168+
* @throws IOException
169+
* @throws ASAPException
170+
*/
153171
public ASAPStorage getASAPStorage(CharSequence appFormat) throws IOException, ASAPException {
154172
Log.d(this.getLogStart(), "convention: asap storage are in a folder ownerName/formatName");
155173

@@ -162,6 +180,12 @@ public ASAPStorage getASAPStorage(CharSequence appFormat) throws IOException, AS
162180
appFormat.toString());
163181
}
164182

183+
/**
184+
* ASAP engines exchange message during an ASAP session which are already kept in their storage.
185+
* <i>online exchange</i> denotes the feature that message are sent which are produced during
186+
* a running asap session. That's most useful for any kind of chat application.
187+
* @return status of online exchange.
188+
*/
165189
public boolean getASAPOnlineExchange() {
166190
return this.onlineExchange;
167191
}
@@ -173,6 +197,11 @@ protected CharSequence getASAPRootFolder(Activity activity) {
173197
return this.rootFolder;
174198
}
175199

200+
/**
201+
*
202+
* @return root folder of all information stored by the asap service. Handle this information
203+
* with great care.
204+
*/
176205
public CharSequence getASAPRootFolder() {
177206
return Util.getASAPRootDirectory(
178207
this.getActivity(), this.rootFolder, this.getOwnerID()).getAbsolutePath();
@@ -183,16 +212,24 @@ public CharSequence getASAPComponentFolder(CharSequence format) {
183212
}
184213

185214
/**
186-
* could be overwritten
215+
* @return asap owner id - if set
187216
*/
188217
public CharSequence getOwnerID() {
189218
return this.asapOwner;
190219
}
191220

221+
/**
222+
* @return asap owner name - if set
223+
*/
192224
public CharSequence getOwnerName() {
193225
return ASAPEngineFS.ANONYMOUS_OWNER;
194226
}
195227

228+
/**
229+
*
230+
* @return list of supported formats supported by this asap peer / service. You have defined
231+
* those formats during object initialization.
232+
*/
196233
public Collection<CharSequence> getSupportFormats() {
197234
return this.supportedFormats;
198235
}
@@ -205,6 +242,13 @@ public static ASAPApplication getASAPApplication() {
205242
return ASAPApplication.singleton;
206243
}
207244

245+
/**
246+
* Factory method: Setup an asap application. See documentation in the wiki. Don't forget
247+
* to launch you application by calling startApplication afterwards.
248+
* @param supportedFormats
249+
* @param initialActivity
250+
* @return
251+
*/
208252
public static ASAPApplication initializeASAPApplication(
209253
Collection<CharSequence> supportedFormats, Activity initialActivity) {
210254
if(ASAPApplication.singleton == null) {
@@ -217,12 +261,25 @@ public static ASAPApplication initializeASAPApplication(
217261
return ASAPApplication.singleton;
218262
}
219263

264+
/**
265+
* Factory method: Setup an asap application. See documentation in the wiki. Don't forget
266+
* to launch you application by calling startApplication afterwards.
267+
* @param one supported format
268+
* @param initialActivity
269+
* @return
270+
*/
220271
public static ASAPApplication initializeASAPApplication(
221272
CharSequence supportedFormat, Activity initialActivity) {
222273
Collection<CharSequence> formats = new HashSet<>();
223274
return ASAPApplication.initializeASAPApplication(formats, initialActivity);
224275
}
225276

277+
/**
278+
*
279+
* @param appName
280+
* @return root folder of information kept by an asap engine. Better not change those
281+
* information.
282+
*/
226283
public String getApplicationRootFolder(String appName) {
227284
appName = Utils.url2FileName(appName);
228285
String absoluteASAPApplicationRootFolder = this.getASAPRootFolder() + "/" + appName;

0 commit comments

Comments
 (0)