1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_framework.hxx"
26
27 //________________________________
28 // my own includes
29 #include <jobs/joburl.hxx>
30 #include <threadhelp/readguard.hxx>
31 #include <threadhelp/writeguard.hxx>
32 #include <general.h>
33
34 //________________________________
35 // interface includes
36
37 //________________________________
38 // includes of other projects
39 #include <rtl/ustrbuf.hxx>
40 #include <vcl/svapp.hxx>
41
42 //________________________________
43 // namespace
44
45 namespace framework{
46
47 //________________________________
48 // non exported const
49
50 //________________________________
51 // non exported definitions
52
53 //________________________________
54 // declarations
55
56 //________________________________
57 /**
58 @short special ctor
59 @descr It initialize this new instance with a (hopyfully) valid job URL.
60 This URL will be parsed. After that we set our members right,
61 so other interface methods of this class can be used to get
62 all items of this URL. Of course it will be possible to know,
63 if this URL was valid too.
64
65 @param sURL
66 the job URL for parsing
67 */
JobURL(const::rtl::OUString & sURL)68 JobURL::JobURL( /*IN*/ const ::rtl::OUString& sURL )
69 : ThreadHelpBase( &Application::GetSolarMutex() )
70 {
71 #ifdef ENABLE_COMPONENT_SELF_CHECK
72 JobURL::impldbg_checkIt();
73 #endif
74
75 m_eRequest = E_UNKNOWN;
76
77 // syntax: vnd.sun.star.job:{[event=<name>],[alias=<name>],[service=<name>]}
78
79 // check for "vnd.sun.star.job:"
80 if (sURL.matchIgnoreAsciiCaseAsciiL(JOBURL_PROTOCOL_STR,JOBURL_PROTOCOL_LEN,0))
81 {
82 sal_Int32 t = JOBURL_PROTOCOL_LEN;
83 do
84 {
85 // seperate all token of "{[event=<name>],[alias=<name>],[service=<name>]}"
86 ::rtl::OUString sToken = sURL.getToken(0, JOBURL_PART_SEPERATOR, t);
87 ::rtl::OUString sPartValue ;
88 ::rtl::OUString sPartArguments;
89
90 // check for "event="
91 if (
92 (JobURL::implst_split(sToken,JOBURL_EVENT_STR,JOBURL_EVENT_LEN,sPartValue,sPartArguments)) &&
93 (sPartValue.getLength()>0 )
94 )
95 {
96 // set the part value
97 m_sEvent = sPartValue ;
98 m_sEventArgs = sPartArguments;
99 m_eRequest |= E_EVENT ;
100 }
101 else
102 // check for "alias="
103 if (
104 (JobURL::implst_split(sToken,JOBURL_ALIAS_STR,JOBURL_ALIAS_LEN,sPartValue,sPartArguments)) &&
105 (sPartValue.getLength()>0 )
106 )
107 {
108 // set the part value
109 m_sAlias = sPartValue ;
110 m_sAliasArgs = sPartArguments;
111 m_eRequest |= E_ALIAS ;
112 }
113 else
114 // check for "service="
115 if (
116 (JobURL::implst_split(sToken,JOBURL_SERVICE_STR,JOBURL_SERVICE_LEN,sPartValue,sPartArguments)) &&
117 (sPartValue.getLength()>0 )
118 )
119 {
120 // set the part value
121 m_sService = sPartValue ;
122 m_sServiceArgs = sPartArguments;
123 m_eRequest |= E_SERVICE ;
124 }
125 }
126 while(t!=-1);
127 }
128 }
129
130 //________________________________
131 /**
132 @short knows, if this job URL object hold a valid URL inside
133
134 @return <TRUE/> if it represent a valid job URL.
135 */
isValid() const136 sal_Bool JobURL::isValid() const
137 {
138 /* SAFE { */
139 ReadGuard aReadLock(m_aLock);
140 return (m_eRequest!=E_UNKNOWN);
141 }
142
143 //________________________________
144 /**
145 @short get the event item of this job URL
146 @descr Because the three possible parts of such URL (event, alias, service)
147 can't be combined, this method can(!) return a valid value - but it's
148 not a must. Thats why the return value must be used too, to detect a missing
149 event value.
150
151 @param sEvent
152 returns the possible existing event value
153 e.g. "vnd.sun.star.job:event=myEvent" returns "myEvent"
154
155 @return <TRUE/> if an event part of the job URL exist and the out parameter
156 sEvent was filled.
157
158 @attention The out parameter will be reseted everytime. Don't use it if method returns <FALSE/>!
159 */
getEvent(::rtl::OUString & sEvent) const160 sal_Bool JobURL::getEvent( /*OUT*/ ::rtl::OUString& sEvent ) const
161 {
162 /* SAFE { */
163 ReadGuard aReadLock(m_aLock);
164
165 sEvent = ::rtl::OUString();
166 sal_Bool bSet = ((m_eRequest & E_EVENT) == E_EVENT);
167 if (bSet)
168 sEvent = m_sEvent;
169
170 aReadLock.unlock();
171 /* } SAFE */
172
173 return bSet;
174 }
175
176 //________________________________
177 /**
178 @short get the alias item of this job URL
179 @descr Because the three possible parts of such URL (event, alias, service)
180 can't be combined, this method can(!) return a valid value - but it's
181 not a must. Thats why the return value must be used too, to detect a missing
182 alias value.
183
184 @param sAlias
185 returns the possible existing alias value
186 e.g. "vnd.sun.star.job:alias=myAlias" returns "myAlias"
187
188 @return <TRUE/> if an alias part of the job URL exist and the out parameter
189 sAlias was filled.
190
191 @attention The out parameter will be reseted everytime. Don't use it if method returns <FALSE/>!
192 */
getAlias(::rtl::OUString & sAlias) const193 sal_Bool JobURL::getAlias( /*OUT*/ ::rtl::OUString& sAlias ) const
194 {
195 /* SAFE { */
196 ReadGuard aReadLock(m_aLock);
197
198 sAlias = ::rtl::OUString();
199 sal_Bool bSet = ((m_eRequest & E_ALIAS) == E_ALIAS);
200 if (bSet)
201 sAlias = m_sAlias;
202
203 aReadLock.unlock();
204 /* } SAFE */
205
206 return bSet;
207 }
208
209 //________________________________
210 /**
211 @short get the service item of this job URL
212 @descr Because the three possible parts of such URL (event, service, service)
213 can't be combined, this method can(!) return a valid value - but it's
214 not a must. Thats why the return value must be used too, to detect a missing
215 service value.
216
217 @param sAlias
218 returns the possible existing service value
219 e.g. "vnd.sun.star.job:service=com.sun.star.Service" returns "com.sun.star.Service"
220
221 @return <TRUE/> if an service part of the job URL exist and the out parameter
222 sService was filled.
223
224 @attention The out parameter will be reseted everytime. Don't use it if method returns <FALSE/>!
225 */
getService(::rtl::OUString & sService) const226 sal_Bool JobURL::getService( /*OUT*/ ::rtl::OUString& sService ) const
227 {
228 /* SAFE { */
229 ReadGuard aReadLock(m_aLock);
230
231 sService = ::rtl::OUString();
232 sal_Bool bSet = ((m_eRequest & E_SERVICE) == E_SERVICE);
233 if (bSet)
234 sService = m_sService;
235
236 aReadLock.unlock();
237 /* } SAFE */
238
239 return bSet;
240 }
241
242 //________________________________
243 /**
244 @short searches for a special identifier in the given string and split it
245 @descr If the given identifier could be found at the beginning of the given string,
246 this method split it into different parts and return it.
247 Following schema is used: <partidentifier>=<partvalue>[?<partarguments>]
248
249 @param sPart
250 the string, which should be analyzed
251
252 @param pPartIdentifier
253 the part identifier value, which must be found at the beginning of the
254 parameter <var>sPart</var>
255
256 @param nPartLength
257 the length of the ascii value <var>pPartIdentifier</var>
258
259 @param rPartValue
260 returns the part value if <var>sPart</var> was splitted successfully
261
262 @param rPartArguments
263 returns the part arguments if <var>sPart</var> was splitted successfully
264
265 @return <TRUE/> if the identifier could be found and the string was splitted.
266 <FALSE/> otherwhise.
267 */
implst_split(const::rtl::OUString & sPart,const sal_Char * pPartIdentifier,sal_Int32 nPartLength,::rtl::OUString & rPartValue,::rtl::OUString & rPartArguments)268 sal_Bool JobURL::implst_split( /*IN*/ const ::rtl::OUString& sPart ,
269 /*IN*/ const sal_Char* pPartIdentifier ,
270 /*IN*/ sal_Int32 nPartLength ,
271 /*OUT*/ ::rtl::OUString& rPartValue ,
272 /*OUT*/ ::rtl::OUString& rPartArguments )
273 {
274 // first search for the given identifier
275 sal_Bool bPartFound = (sPart.matchIgnoreAsciiCaseAsciiL(pPartIdentifier,nPartLength,0));
276
277 // If it exist - we can split the part and return sal_True.
278 // Otherwhise we do nothing and return sal_False.
279 if (bPartFound)
280 {
281 // But may the part has optional arguments - seperated by a "?".
282 // Do so - we set the return value with the whole part string.
283 // Arguments will be set to an empty string as default.
284 // If we detect the right sign - we split the arguments and overwrite the default.
285 ::rtl::OUString sValueAndArguments = sPart.copy(nPartLength);
286 ::rtl::OUString sValue = sValueAndArguments ;
287 ::rtl::OUString sArguments;
288
289 sal_Int32 nArgStart = sValueAndArguments.indexOf('?',0);
290 if (nArgStart!=-1)
291 {
292 sValue = sValueAndArguments.copy(0,nArgStart);
293 ++nArgStart; // ignore '?'!
294 sArguments = sValueAndArguments.copy(nArgStart);
295 }
296
297 rPartValue = sValue ;
298 rPartArguments = sArguments;
299 }
300
301 return bPartFound;
302 }
303
304 //________________________________
305 /**
306 @short special debug method
307 @descr It's the entry point method to start a self component check for this class.
308 It's used for internal purposes only and never a part of a legal product.
309 Use it for testing and debug only!
310 */
311 #ifdef ENABLE_COMPONENT_SELF_CHECK
312
313 #define LOGFILE_JOBURL "joburl.log"
314
impldbg_checkIt()315 void JobURL::impldbg_checkIt()
316 {
317 // check simple URL's
318 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent" , E_EVENT , "onMyEvent", "" , "" , NULL, NULL, NULL);
319 JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias" , E_ALIAS , "" , "myAlias", "" , NULL, NULL, NULL);
320 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service", E_SERVICE, "" , "" , "css.Service", NULL, NULL, NULL);
321 JobURL::impldbg_checkURL("vnd.sun.star.job:service=;" , E_UNKNOWN, "" , "" , "" , NULL, NULL, NULL);
322
323 // check combinations
324 // Note: No additional spaces or tabs are allowed after a seperator occured.
325 // Tab and spaces before a seperator will be used as value!
326 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;alias=myAlias;service=css.Service" , E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL);
327 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service;alias=myAlias" , E_ALIAS | E_SERVICE , "" , "myAlias", "css.Service" , NULL, NULL, NULL);
328 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service ;alias=myAlias" , E_ALIAS | E_SERVICE , "" , "myAlias", "css.Service ", NULL, NULL, NULL);
329 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service; alias=myAlias" , E_UNKNOWN , "" , "" , "" , NULL, NULL, NULL);
330 JobURL::impldbg_checkURL("vnd.sun.star.job : event=onMyEvent" , E_UNKNOWN , "" , "" , "" , NULL, NULL, NULL);
331 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;event=onMyEvent;service=css.Service", E_UNKNOWN , "" , "" , "" , NULL, NULL, NULL);
332
333 // check upper/lower case
334 // fix parts of the URL are case insensitive (e.g. "vnd.SUN.star.job:eVEnt=")
335 // values are case sensitive (e.g. "myAlias" )
336 JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEvent;aliAs=myAlias;serVice=css.Service", E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL);
337 JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEVENT;aliAs=myALIAS;serVice=css.SERVICE", E_EVENT | E_ALIAS | E_SERVICE , "onMyEVENT", "myALIAS", "css.SERVICE" , NULL, NULL, NULL);
338
339 // check stupid URLs
340 JobURL::impldbg_checkURL("vnd.sun.star.jobs:service=css.Service" , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
341 JobURL::impldbg_checkURL("vnd.sun.star.job service=css.Service" , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
342 JobURL::impldbg_checkURL("vnd.sun.star.job:service;css.Service" , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
343 JobURL::impldbg_checkURL("vnd.sun.star.job:service;" , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
344 JobURL::impldbg_checkURL("vnd.sun.star.job:;alias;service;event=" , E_UNKNOWN, "", "", "", NULL, NULL, NULL);
345 JobURL::impldbg_checkURL("vnd.sun.star.job:alias=a;service=s;event=", E_UNKNOWN, "", "", "", NULL, NULL, NULL);
346
347 // check argument handling
348 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent?eventArg1,eventArg2=3,eventArg4," , E_EVENT , "onMyEvent", "" , "" , "eventArg1,eventArg2=3,eventArg4,", NULL , NULL );
349 JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias?aliasArg1,aliasarg2" , E_EVENT , "" , "myAlias", "" , NULL , "aliasArg1,aliasarg2", NULL );
350 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1" , E_EVENT , "" , "" , "css.myService", NULL , NULL , "serviceArg1" );
351 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1;alias=myAlias?aliasArg=564", E_EVENT | E_ALIAS, "" , "myAlias", "css.myService", NULL , "aliasArg=564" , "serviceArg1" );
352 }
353
354 //________________________________
355 /**
356 @short helper debug method
357 @descr It uses the given parameter to create a new instance of a JobURL.
358 They results will be compared with the exepected ones.
359 The a log will be written, which contains some detailed informations
360 for this sub test.
361
362 @param pURL
363 the job URL, which should be checked
364
365 @param eExpectedPart
366 the expected result
367
368 @param pExpectedEvent
369 the expected event value
370
371 @param pExpectedAlias
372 the expected alias value
373
374 @param pExpectedService
375 the expected service value
376
377 @param pExpectedEventArgs
378 the expected event arguments
379
380 @param pExpectedAliasArgs
381 the expected alias arguments
382
383 @param pExpectedServiceArgs
384 the expected service arguments
385 */
impldbg_checkURL(const sal_Char * pURL,sal_uInt32 eExpectedPart,const sal_Char * pExpectedEvent,const sal_Char * pExpectedAlias,const sal_Char * pExpectedService,const sal_Char * pExpectedEventArgs,const sal_Char * pExpectedAliasArgs,const sal_Char * pExpectedServiceArgs)386 void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL ,
387 /*IN*/ sal_uInt32 eExpectedPart ,
388 /*IN*/ const sal_Char* pExpectedEvent ,
389 /*IN*/ const sal_Char* pExpectedAlias ,
390 /*IN*/ const sal_Char* pExpectedService ,
391 /*IN*/ const sal_Char* pExpectedEventArgs ,
392 /*IN*/ const sal_Char* pExpectedAliasArgs ,
393 /*IN*/ const sal_Char* pExpectedServiceArgs )
394 {
395 ::rtl::OUString sEvent ;
396 ::rtl::OUString sAlias ;
397 ::rtl::OUString sService ;
398 ::rtl::OUString sEventArgs ;
399 ::rtl::OUString sAliasArgs ;
400 ::rtl::OUString sServiceArgs;
401 ::rtl::OUString sURL (::rtl::OUString::createFromAscii(pURL));
402 sal_Bool bOK = sal_True;
403
404 JobURL aURL(sURL);
405
406 // check if URL is invalid
407 if (eExpectedPart==E_UNKNOWN)
408 bOK = !aURL.isValid();
409
410 // check if URL has the expected event part
411 if (
412 (bOK ) &&
413 ((eExpectedPart & E_EVENT) == E_EVENT)
414 )
415 {
416 bOK = (
417 (aURL.isValid() ) &&
418 (aURL.getEvent(sEvent) ) &&
419 (sEvent.getLength()>0 ) &&
420 (sEvent.compareToAscii(pExpectedEvent)==0)
421 );
422
423 if (bOK && pExpectedEventArgs!=NULL)
424 {
425 bOK = (
426 (aURL.getEventArgs(sEventArgs) ) &&
427 (sEventArgs.compareToAscii(pExpectedEventArgs)==0)
428 );
429 };
430 }
431
432 // check if URL has no event part
433 if (
434 (bOK ) &&
435 ((eExpectedPart & E_EVENT) != E_EVENT)
436 )
437 {
438 bOK = (
439 (!aURL.getEvent(sEvent) ) &&
440 (sEvent.getLength()==0 ) &&
441 (!aURL.getEventArgs(sEventArgs)) &&
442 (sEventArgs.getLength()==0 )
443 );
444 }
445
446 // check if URL has the expected alias part
447 if (
448 (bOK ) &&
449 ((eExpectedPart & E_ALIAS) == E_ALIAS)
450 )
451 {
452 bOK = (
453 (aURL.isValid() ) &&
454 (aURL.getAlias(sAlias) ) &&
455 (sAlias.getLength()>0 ) &&
456 (sAlias.compareToAscii(pExpectedAlias)==0)
457 );
458
459 if (bOK && pExpectedAliasArgs!=NULL)
460 {
461 bOK = (
462 (aURL.getAliasArgs(sAliasArgs) ) &&
463 (sAliasArgs.compareToAscii(pExpectedAliasArgs)==0)
464 );
465 };
466 }
467
468 // check if URL has the no alias part
469 if (
470 (bOK ) &&
471 ((eExpectedPart & E_ALIAS) != E_ALIAS)
472 )
473 {
474 bOK = (
475 (!aURL.getAlias(sAlias) ) &&
476 (sAlias.getLength()==0 ) &&
477 (!aURL.getAliasArgs(sAliasArgs)) &&
478 (sAliasArgs.getLength()==0 )
479 );
480 }
481
482 // check if URL has the expected service part
483 if (
484 (bOK ) &&
485 ((eExpectedPart & E_SERVICE) == E_SERVICE)
486 )
487 {
488 bOK = (
489 (aURL.isValid() ) &&
490 (aURL.getService(sService) ) &&
491 (sService.getLength()>0 ) &&
492 (sService.compareToAscii(pExpectedService)==0)
493 );
494
495 if (bOK && pExpectedServiceArgs!=NULL)
496 {
497 bOK = (
498 (aURL.getServiceArgs(sServiceArgs) ) &&
499 (sServiceArgs.compareToAscii(pExpectedServiceArgs)==0)
500 );
501 };
502 }
503
504 // check if URL has the no service part
505 if (
506 (bOK ) &&
507 ((eExpectedPart & E_SERVICE) != E_SERVICE)
508 )
509 {
510 bOK = (
511 (!aURL.getService(sService) ) &&
512 (sService.getLength()==0 ) &&
513 (!aURL.getServiceArgs(sServiceArgs)) &&
514 (sServiceArgs.getLength()==0 )
515 );
516 }
517
518 ::rtl::OUStringBuffer sMsg(256);
519
520 sMsg.appendAscii("\"" );
521 sMsg.append (sURL );
522 sMsg.appendAscii("\" ");
523
524 if (bOK)
525 {
526 sMsg.appendAscii("... OK\n");
527 }
528 else
529 {
530 sMsg.appendAscii("... failed\n");
531 sMsg.appendAscii("expected was: ");
532 if (eExpectedPart==E_UNKNOWN)
533 sMsg.appendAscii("E_UNKNOWN");
534 if ((eExpectedPart & E_EVENT) == E_EVENT)
535 {
536 sMsg.appendAscii("| E_EVENT e=\"");
537 sMsg.appendAscii(pExpectedEvent );
538 sMsg.appendAscii("\"" );
539 }
540 if ((eExpectedPart & E_ALIAS) == E_ALIAS)
541 {
542 sMsg.appendAscii("| E_ALIAS a=\"");
543 sMsg.appendAscii(pExpectedAlias );
544 sMsg.appendAscii("\"" );
545 }
546 if ((eExpectedPart & E_SERVICE) == E_SERVICE)
547 {
548 sMsg.appendAscii("| E_SERVICE s=\"");
549 sMsg.appendAscii(pExpectedService );
550 sMsg.appendAscii("\"" );
551 }
552 sMsg.appendAscii("\tbut it was : " );
553 sMsg.append (aURL.impldbg_toString());
554 sMsg.appendAscii("\n" );
555 }
556
557 WRITE_LOGFILE(LOGFILE_JOBURL, U2B(sMsg.makeStringAndClear()))
558 }
559
560 //________________________________
561 /**
562 @short helper debug method
563 @descr It returns a representation of the internal object state
564 as string notation.
565
566 @returns The formated string representation.
567 */
impldbg_toString() const568 ::rtl::OUString JobURL::impldbg_toString() const
569 {
570 /* SAFE { */
571 ReadGuard aReadLock(m_aLock);
572
573 ::rtl::OUStringBuffer sBuffer(256);
574
575 if (m_eRequest==E_UNKNOWN)
576 sBuffer.appendAscii("E_UNKNOWN");
577 if ((m_eRequest & E_EVENT) == E_EVENT)
578 sBuffer.appendAscii("| E_EVENT");
579 if ((m_eRequest & E_ALIAS) == E_ALIAS)
580 sBuffer.appendAscii("| E_ALIAS");
581 if ((m_eRequest & E_SERVICE) == E_SERVICE)
582 sBuffer.appendAscii("| E_SERVICE");
583 sBuffer.appendAscii("{ e=\"" );
584 sBuffer.append (m_sEvent );
585 sBuffer.appendAscii("\" - a=\"");
586 sBuffer.append (m_sAlias );
587 sBuffer.appendAscii("\" - s=\"");
588 sBuffer.append (m_sService );
589 sBuffer.appendAscii("\" }" );
590
591 aReadLock.unlock();
592 /* } SAFE */
593
594 return sBuffer.makeStringAndClear();
595 }
596
597 //________________________________
598
getServiceArgs(::rtl::OUString & sServiceArgs) const599 sal_Bool JobURL::getServiceArgs( /*OUT*/ ::rtl::OUString& sServiceArgs ) const
600 {
601 /* SAFE { */
602 ReadGuard aReadLock(m_aLock);
603
604 sServiceArgs = ::rtl::OUString();
605 sal_Bool bSet = ((m_eRequest & E_SERVICE) == E_SERVICE);
606 if (bSet)
607 sServiceArgs = m_sServiceArgs;
608
609 aReadLock.unlock();
610 /* } SAFE */
611
612 return bSet;
613 }
614
615 //________________________________
616
getEventArgs(::rtl::OUString & sEventArgs) const617 sal_Bool JobURL::getEventArgs( /*OUT*/ ::rtl::OUString& sEventArgs ) const
618 {
619 /* SAFE { */
620 ReadGuard aReadLock(m_aLock);
621
622 sEventArgs = ::rtl::OUString();
623 sal_Bool bSet = ((m_eRequest & E_EVENT) == E_EVENT);
624 if (bSet)
625 sEventArgs = m_sEventArgs;
626
627 aReadLock.unlock();
628 /* } SAFE */
629
630 return bSet;
631 }
632
633 //________________________________
634
getAliasArgs(::rtl::OUString & sAliasArgs) const635 sal_Bool JobURL::getAliasArgs( /*OUT*/ ::rtl::OUString& sAliasArgs ) const
636 {
637 /* SAFE { */
638 ReadGuard aReadLock(m_aLock);
639
640 sAliasArgs = ::rtl::OUString();
641 sal_Bool bSet = ((m_eRequest & E_ALIAS) == E_ALIAS);
642 if (bSet)
643 sAliasArgs = m_sAliasArgs;
644
645 aReadLock.unlock();
646 /* } SAFE */
647
648 return bSet;
649 }
650
651 #endif // ENABLE_COMPONENT_SELF_CHECK
652
653 } // namespace framework
654