11package net .sharksystem .asap .android ;
22
33import android .app .Activity ;
4- import android .content .Context ;
54import android .content .Intent ;
65
6+ import net .sharksystem .asap .ASAPEngine ;
77import net .sharksystem .asap .ASAPException ;
8+ import net .sharksystem .asap .MultiASAPEngineFS ;
89import net .sharksystem .asap .android .service .ASAPService ;
910
1011public class ASAPServiceCreationIntent extends Intent {
1112
1213 private final CharSequence owner ;
1314 private final CharSequence rootFolder ;
1415 private final boolean onlineExchange ;
16+ private final long maxExecutionTime ;
1517
1618 public ASAPServiceCreationIntent (Activity activity , CharSequence owner , CharSequence rootFolder ,
17- boolean onlineExchange ) throws ASAPException {
19+ boolean onlineExchange )
20+ throws ASAPException {
21+
22+ this (activity , owner , rootFolder , onlineExchange ,
23+ MultiASAPEngineFS .DEFAULT_MAX_PROCESSING_TIME );
24+ }
25+
26+ public ASAPServiceCreationIntent (Activity activity , CharSequence owner , CharSequence rootFolder ,
27+ boolean onlineExchange , long maxExecutionTime )
28+ throws ASAPException {
1829
1930 super (activity , ASAPService .class );
2031
@@ -24,10 +35,12 @@ public ASAPServiceCreationIntent(Activity activity, CharSequence owner, CharSequ
2435 this .putExtra (ASAP .USER , owner );
2536 this .putExtra (ASAP .FOLDER , rootFolder );
2637 this .putExtra (ASAP .ONLINE_EXCHANGE , onlineExchange );
38+ this .putExtra (ASAP .MAX_EXECUTION_TIME , maxExecutionTime );
2739
2840 this .owner = owner ;
2941 this .rootFolder = rootFolder ;
3042 this .onlineExchange = onlineExchange ;
43+ this .maxExecutionTime = maxExecutionTime ;
3144 }
3245
3346 public ASAPServiceCreationIntent (Intent intent ) {
@@ -38,6 +51,8 @@ public ASAPServiceCreationIntent(Intent intent) {
3851 this .rootFolder = intent .getStringExtra (ASAP .FOLDER );
3952 this .onlineExchange = intent .getBooleanExtra (ASAP .ONLINE_EXCHANGE ,
4053 ASAP .ONLINE_EXCHANGE_DEFAULT );
54+ this .maxExecutionTime = intent .getLongExtra (ASAP .MAX_EXECUTION_TIME ,
55+ MultiASAPEngineFS .DEFAULT_MAX_PROCESSING_TIME );
4156
4257 }
4358
@@ -52,4 +67,24 @@ public CharSequence getRootFolder() {
5267 public boolean isOnlineExchange () {
5368 return this .onlineExchange ;
5469 }
70+
71+ public long getMaxExecutionTime () {
72+ return this .maxExecutionTime ;
73+ }
74+
75+ public String toString () {
76+ StringBuilder sb = new StringBuilder ();
77+
78+ sb .append ("owner: " );
79+ sb .append (this .owner );
80+ sb .append (" | folder: " );
81+ sb .append (this .rootFolder );
82+ sb .append (" | onlineExchange: " );
83+ sb .append (this .onlineExchange );
84+ sb .append (" | maxExecutionTime: " );
85+ sb .append (this .maxExecutionTime );
86+
87+ return sb .toString ();
88+ }
89+
5590}
0 commit comments