001// license-header java merge-point
002//
003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
004//
005package org.andromda.cartridges.webservice.metafacades;
006
007import java.util.Collection;
008import org.andromda.core.common.Introspector;
009import org.andromda.core.metafacade.MetafacadeBase;
010import org.andromda.core.metafacade.MetafacadeFactory;
011import org.andromda.core.metafacade.ModelValidationMessage;
012import org.andromda.metafacades.uml.ClassifierFacade;
013import org.andromda.metafacades.uml.ConstraintFacade;
014import org.andromda.metafacades.uml.DependencyFacade;
015import org.andromda.metafacades.uml.Destination;
016import org.andromda.metafacades.uml.ModelElementFacade;
017import org.andromda.metafacades.uml.ModelFacade;
018import org.andromda.metafacades.uml.OperationFacade;
019import org.andromda.metafacades.uml.PackageFacade;
020import org.andromda.metafacades.uml.ParameterFacade;
021import org.andromda.metafacades.uml.Role;
022import org.andromda.metafacades.uml.Service;
023import org.andromda.metafacades.uml.ServiceOperation;
024import org.andromda.metafacades.uml.StateMachineFacade;
025import org.andromda.metafacades.uml.StereotypeFacade;
026import org.andromda.metafacades.uml.TaggedValueFacade;
027import org.andromda.metafacades.uml.TemplateParameterFacade;
028import org.andromda.metafacades.uml.TypeMappings;
029import org.andromda.translation.ocl.validation.OCLExpressions;
030import org.andromda.translation.ocl.validation.OCLIntrospector;
031import org.andromda.translation.ocl.validation.OCLResultEnsurer;
032import org.apache.log4j.Logger;
033
034/**
035 * Represents an operation on a web service.
036 * MetafacadeLogic for WebServiceOperation
037 *
038 * @see WebServiceOperation
039 */
040public abstract class WebServiceOperationLogic
041    extends MetafacadeBase
042    implements WebServiceOperation
043{
044    /**
045     * The underlying UML object
046     * @see Object
047     */
048    protected Object metaObject;
049
050    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
051     * @param metaObjectIn
052     * @param context
053     */
054    protected WebServiceOperationLogic(Object metaObjectIn, String context)
055    {
056        super(metaObjectIn, getContext(context));
057        this.superServiceOperation =
058           (ServiceOperation)
059            MetafacadeFactory.getInstance().createFacadeImpl(
060                    "org.andromda.metafacades.uml.ServiceOperation",
061                    metaObjectIn,
062                    getContext(context));
063        this.metaObject = metaObjectIn;
064    }
065
066    /**
067     * The logger instance.
068     */
069    private static final Logger logger = Logger.getLogger(WebServiceOperationLogic.class);
070
071    /**
072     * Gets the context for this metafacade logic instance.
073     * @param context String. Set to WebServiceOperation if null
074     * @return context String
075     */
076    private static String getContext(String context)
077    {
078        if (context == null)
079        {
080            context = "org.andromda.cartridges.webservice.metafacades.WebServiceOperation";
081        }
082        return context;
083    }
084
085    private ServiceOperation superServiceOperation;
086    private boolean superServiceOperationInitialized = false;
087
088    /**
089     * Gets the ServiceOperation parent instance.
090     * @return this.superServiceOperation ServiceOperation
091     */
092    private ServiceOperation getSuperServiceOperation()
093    {
094        if (!this.superServiceOperationInitialized)
095        {
096            ((MetafacadeBase)this.superServiceOperation).setMetafacadeContext(this.getMetafacadeContext());
097            this.superServiceOperationInitialized = true;
098        }
099        return this.superServiceOperation;
100    }
101
102    /** Reset context only for non-root metafacades
103     * @param context
104     * @see MetafacadeBase#resetMetafacadeContext(String context)
105     */
106    @Override
107    public void resetMetafacadeContext(String context)
108    {
109        if (!this.contextRoot) // reset context only for non-root metafacades
110        {
111            context = getContext(context);  // to have same value as in original constructor call
112            setMetafacadeContext (context);
113            if (this.superServiceOperationInitialized)
114            {
115                ((MetafacadeBase)this.superServiceOperation).resetMetafacadeContext(context);
116            }
117        }
118    }
119
120    /**
121     * @return boolean true always
122     * @see WebServiceOperation
123     */
124    public boolean isWebServiceOperationMetaType()
125    {
126        return true;
127    }
128
129    // --------------- attributes ---------------------
130
131   /**
132    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#isExposed()
133    * @return boolean
134    */
135    protected abstract boolean handleIsExposed();
136
137    private boolean __exposed1a;
138    private boolean __exposed1aSet = false;
139
140    /**
141     * Returns true/false depending on whether or not this web service operation is exposed.
142     * @return (boolean)handleIsExposed()
143     */
144    public final boolean isExposed()
145    {
146        boolean exposed1a = this.__exposed1a;
147        if (!this.__exposed1aSet)
148        {
149            // exposed has no pre constraints
150            exposed1a = handleIsExposed();
151            // exposed has no post constraints
152            this.__exposed1a = exposed1a;
153            if (isMetafacadePropertyCachingEnabled())
154            {
155                this.__exposed1aSet = true;
156            }
157        }
158        return exposed1a;
159    }
160
161   /**
162    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestImplementationName()
163    * @return String
164    */
165    protected abstract String handleGetTestImplementationName();
166
167    private String __testImplementationName2a;
168    private boolean __testImplementationName2aSet = false;
169
170    /**
171     * The name of the the operation used within the test implementation.
172     * @return (String)handleGetTestImplementationName()
173     */
174    public final String getTestImplementationName()
175    {
176        String testImplementationName2a = this.__testImplementationName2a;
177        if (!this.__testImplementationName2aSet)
178        {
179            // testImplementationName has no pre constraints
180            testImplementationName2a = handleGetTestImplementationName();
181            // testImplementationName has no post constraints
182            this.__testImplementationName2a = testImplementationName2a;
183            if (isMetafacadePropertyCachingEnabled())
184            {
185                this.__testImplementationName2aSet = true;
186            }
187        }
188        return testImplementationName2a;
189    }
190
191   /**
192    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestImplementationCall()
193    * @return String
194    */
195    protected abstract String handleGetTestImplementationCall();
196
197    private String __testImplementationCall3a;
198    private boolean __testImplementationCall3aSet = false;
199
200    /**
201     * The method call for the test implementation operation.
202     * @return (String)handleGetTestImplementationCall()
203     */
204    public final String getTestImplementationCall()
205    {
206        String testImplementationCall3a = this.__testImplementationCall3a;
207        if (!this.__testImplementationCall3aSet)
208        {
209            // testImplementationCall has no pre constraints
210            testImplementationCall3a = handleGetTestImplementationCall();
211            // testImplementationCall has no post constraints
212            this.__testImplementationCall3a = testImplementationCall3a;
213            if (isMetafacadePropertyCachingEnabled())
214            {
215                this.__testImplementationCall3aSet = true;
216            }
217        }
218        return testImplementationCall3a;
219    }
220
221   /**
222    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestImplementationSignature()
223    * @return String
224    */
225    protected abstract String handleGetTestImplementationSignature();
226
227    private String __testImplementationSignature4a;
228    private boolean __testImplementationSignature4aSet = false;
229
230    /**
231     * The signature for the test implementation operation.
232     * @return (String)handleGetTestImplementationSignature()
233     */
234    public final String getTestImplementationSignature()
235    {
236        String testImplementationSignature4a = this.__testImplementationSignature4a;
237        if (!this.__testImplementationSignature4aSet)
238        {
239            // testImplementationSignature has no pre constraints
240            testImplementationSignature4a = handleGetTestImplementationSignature();
241            // testImplementationSignature has no post constraints
242            this.__testImplementationSignature4a = testImplementationSignature4a;
243            if (isMetafacadePropertyCachingEnabled())
244            {
245                this.__testImplementationSignature4aSet = true;
246            }
247        }
248        return testImplementationSignature4a;
249    }
250
251   /**
252    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestName()
253    * @return String
254    */
255    protected abstract String handleGetTestName();
256
257    private String __testName5a;
258    private boolean __testName5aSet = false;
259
260    /**
261     * The name for the test that tests this operation.
262     * @return (String)handleGetTestName()
263     */
264    public final String getTestName()
265    {
266        String testName5a = this.__testName5a;
267        if (!this.__testName5aSet)
268        {
269            // testName has no pre constraints
270            testName5a = handleGetTestName();
271            // testName has no post constraints
272            this.__testName5a = testName5a;
273            if (isMetafacadePropertyCachingEnabled())
274            {
275                this.__testName5aSet = true;
276            }
277        }
278        return testName5a;
279    }
280
281   /**
282    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestCall()
283    * @return String
284    */
285    protected abstract String handleGetTestCall();
286
287    private String __testCall6a;
288    private boolean __testCall6aSet = false;
289
290    /**
291     * The call for the test that tests this operation.
292     * @return (String)handleGetTestCall()
293     */
294    public final String getTestCall()
295    {
296        String testCall6a = this.__testCall6a;
297        if (!this.__testCall6aSet)
298        {
299            // testCall has no pre constraints
300            testCall6a = handleGetTestCall();
301            // testCall has no post constraints
302            this.__testCall6a = testCall6a;
303            if (isMetafacadePropertyCachingEnabled())
304            {
305                this.__testCall6aSet = true;
306            }
307        }
308        return testCall6a;
309    }
310
311   /**
312    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestSignature()
313    * @return String
314    */
315    protected abstract String handleGetTestSignature();
316
317    private String __testSignature7a;
318    private boolean __testSignature7aSet = false;
319
320    /**
321     * The signature for the test that tests this operation.
322     * @return (String)handleGetTestSignature()
323     */
324    public final String getTestSignature()
325    {
326        String testSignature7a = this.__testSignature7a;
327        if (!this.__testSignature7aSet)
328        {
329            // testSignature has no pre constraints
330            testSignature7a = handleGetTestSignature();
331            // testSignature has no post constraints
332            this.__testSignature7a = testSignature7a;
333            if (isMetafacadePropertyCachingEnabled())
334            {
335                this.__testSignature7aSet = true;
336            }
337        }
338        return testSignature7a;
339    }
340
341   /**
342    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getParameterStyle()
343    * @return String
344    */
345    protected abstract String handleGetParameterStyle();
346
347    private String __parameterStyle8a;
348    private boolean __parameterStyle8aSet = false;
349
350    /**
351     * WebService parameter style: bare or wrapped
352     * @return (String)handleGetParameterStyle()
353     */
354    public final String getParameterStyle()
355    {
356        String parameterStyle8a = this.__parameterStyle8a;
357        if (!this.__parameterStyle8aSet)
358        {
359            // parameterStyle has no pre constraints
360            parameterStyle8a = handleGetParameterStyle();
361            // parameterStyle has no post constraints
362            this.__parameterStyle8a = parameterStyle8a;
363            if (isMetafacadePropertyCachingEnabled())
364            {
365                this.__parameterStyle8aSet = true;
366            }
367        }
368        return parameterStyle8a;
369    }
370
371   /**
372    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestPath()
373    * @return String
374    */
375    protected abstract String handleGetRestPath();
376
377    private String __restPath9a;
378    private boolean __restPath9aSet = false;
379
380    /**
381     * The URL path for the REST webservice. If unspecified, the lowercase
382     * /operation/parametername/{parametername}/ is used.
383     * @return (String)handleGetRestPath()
384     */
385    public final String getRestPath()
386    {
387        String restPath9a = this.__restPath9a;
388        if (!this.__restPath9aSet)
389        {
390            // restPath has no pre constraints
391            restPath9a = handleGetRestPath();
392            // restPath has no post constraints
393            this.__restPath9a = restPath9a;
394            if (isMetafacadePropertyCachingEnabled())
395            {
396                this.__restPath9aSet = true;
397            }
398        }
399        return restPath9a;
400    }
401
402   /**
403    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestRequestType()
404    * @return String
405    */
406    protected abstract String handleGetRestRequestType();
407
408    private String __restRequestType10a;
409    private boolean __restRequestType10aSet = false;
410
411    /**
412     * HTML request type for this REST service (GET, PUT, POST, QUERY, DELETE), used for method
413     * annotations.
414     * @return (String)handleGetRestRequestType()
415     */
416    public final String getRestRequestType()
417    {
418        String restRequestType10a = this.__restRequestType10a;
419        if (!this.__restRequestType10aSet)
420        {
421            // restRequestType has no pre constraints
422            restRequestType10a = handleGetRestRequestType();
423            // restRequestType has no post constraints
424            this.__restRequestType10a = restRequestType10a;
425            if (isMetafacadePropertyCachingEnabled())
426            {
427                this.__restRequestType10aSet = true;
428            }
429        }
430        return restRequestType10a;
431    }
432
433   /**
434    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestCacheType()
435    * @return String
436    */
437    protected abstract String handleGetRestCacheType();
438
439    private String __restCacheType11a;
440    private boolean __restCacheType11aSet = false;
441
442    /**
443     * TODO: Model Documentation for
444     * org.andromda.cartridges.webservice.metafacades.WebServiceOperation.restCacheType
445     * @return (String)handleGetRestCacheType()
446     */
447    public final String getRestCacheType()
448    {
449        String restCacheType11a = this.__restCacheType11a;
450        if (!this.__restCacheType11aSet)
451        {
452            // restCacheType has no pre constraints
453            restCacheType11a = handleGetRestCacheType();
454            // restCacheType has no post constraints
455            this.__restCacheType11a = restCacheType11a;
456            if (isMetafacadePropertyCachingEnabled())
457            {
458                this.__restCacheType11aSet = true;
459            }
460        }
461        return restCacheType11a;
462    }
463
464   /**
465    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#isRestEncoded()
466    * @return boolean
467    */
468    protected abstract boolean handleIsRestEncoded();
469
470    private boolean __restEncoded12a;
471    private boolean __restEncoded12aSet = false;
472
473    /**
474     * @Encoded T/F. default=false.
475     * @return (boolean)handleIsRestEncoded()
476     */
477    public final boolean isRestEncoded()
478    {
479        boolean restEncoded12a = this.__restEncoded12a;
480        if (!this.__restEncoded12aSet)
481        {
482            // restEncoded has no pre constraints
483            restEncoded12a = handleIsRestEncoded();
484            // restEncoded has no post constraints
485            this.__restEncoded12a = restEncoded12a;
486            if (isMetafacadePropertyCachingEnabled())
487            {
488                this.__restEncoded12aSet = true;
489            }
490        }
491        return restEncoded12a;
492    }
493
494   /**
495    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestConsumes()
496    * @return String
497    */
498    protected abstract String handleGetRestConsumes();
499
500    private String __restConsumes13a;
501    private boolean __restConsumes13aSet = false;
502
503    /**
504     * @Consumes(media type) annotation. i.e. json, atom, plain/text, xml.
505     * @return (String)handleGetRestConsumes()
506     */
507    public final String getRestConsumes()
508    {
509        String restConsumes13a = this.__restConsumes13a;
510        if (!this.__restConsumes13aSet)
511        {
512            // restConsumes has no pre constraints
513            restConsumes13a = handleGetRestConsumes();
514            // restConsumes has no post constraints
515            this.__restConsumes13a = restConsumes13a;
516            if (isMetafacadePropertyCachingEnabled())
517            {
518                this.__restConsumes13aSet = true;
519            }
520        }
521        return restConsumes13a;
522    }
523
524   /**
525    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestProduces()
526    * @return String
527    */
528    protected abstract String handleGetRestProduces();
529
530    private String __restProduces14a;
531    private boolean __restProduces14aSet = false;
532
533    /**
534     * @Produces(media type) annotation. i.e. json, atom, plain/text, xml.
535     * @return (String)handleGetRestProduces()
536     */
537    public final String getRestProduces()
538    {
539        String restProduces14a = this.__restProduces14a;
540        if (!this.__restProduces14aSet)
541        {
542            // restProduces has no pre constraints
543            restProduces14a = handleGetRestProduces();
544            // restProduces has no post constraints
545            this.__restProduces14a = restProduces14a;
546            if (isMetafacadePropertyCachingEnabled())
547            {
548                this.__restProduces14aSet = true;
549            }
550        }
551        return restProduces14a;
552    }
553
554   /**
555    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestProvider()
556    * @return String
557    */
558    protected abstract String handleGetRestProvider();
559
560    private String __restProvider15a;
561    private boolean __restProvider15aSet = false;
562
563    /**
564     * Customized REST @Provider annotation, must be implemented in the  generated class.
565     * @return (String)handleGetRestProvider()
566     */
567    public final String getRestProvider()
568    {
569        String restProvider15a = this.__restProvider15a;
570        if (!this.__restProvider15aSet)
571        {
572            // restProvider has no pre constraints
573            restProvider15a = handleGetRestProvider();
574            // restProvider has no post constraints
575            this.__restProvider15a = restProvider15a;
576            if (isMetafacadePropertyCachingEnabled())
577            {
578                this.__restProvider15aSet = true;
579            }
580        }
581        return restProvider15a;
582    }
583
584   /**
585    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestPartType()
586    * @return String
587    */
588    protected abstract String handleGetRestPartType();
589
590    private String __restPartType16a;
591    private boolean __restPartType16aSet = false;
592
593    /**
594     * Multipart/xml type for this returned part.
595     * @return (String)handleGetRestPartType()
596     */
597    public final String getRestPartType()
598    {
599        String restPartType16a = this.__restPartType16a;
600        if (!this.__restPartType16aSet)
601        {
602            // restPartType has no pre constraints
603            restPartType16a = handleGetRestPartType();
604            // restPartType has no post constraints
605            this.__restPartType16a = restPartType16a;
606            if (isMetafacadePropertyCachingEnabled())
607            {
608                this.__restPartType16aSet = true;
609            }
610        }
611        return restPartType16a;
612    }
613
614   /**
615    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestSuspend()
616    * @return int
617    */
618    protected abstract int handleGetRestSuspend();
619
620    private int __restSuspend17a;
621    private boolean __restSuspend17aSet = false;
622
623    /**
624     * Asynchronous service implementation, suspend execution for X ms. Adds @Suspend annotation to
625     * the operation. default=synchronous (suspend=0=wait forever).
626     * @return (int)handleGetRestSuspend()
627     */
628    public final int getRestSuspend()
629    {
630        int restSuspend17a = this.__restSuspend17a;
631        if (!this.__restSuspend17aSet)
632        {
633            // restSuspend has no pre constraints
634            restSuspend17a = handleGetRestSuspend();
635            // restSuspend has no post constraints
636            this.__restSuspend17a = restSuspend17a;
637            if (isMetafacadePropertyCachingEnabled())
638            {
639                this.__restSuspend17aSet = true;
640            }
641        }
642        return restSuspend17a;
643    }
644
645   /**
646    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRolesAllowed()
647    * @return String
648    */
649    protected abstract String handleGetRolesAllowed();
650
651    private String __rolesAllowed18a;
652    private boolean __rolesAllowed18aSet = false;
653
654    /**
655     * REST security roles allowed. default=All.
656     * @return (String)handleGetRolesAllowed()
657     */
658    public final String getRolesAllowed()
659    {
660        String rolesAllowed18a = this.__rolesAllowed18a;
661        if (!this.__rolesAllowed18aSet)
662        {
663            // rolesAllowed has no pre constraints
664            rolesAllowed18a = handleGetRolesAllowed();
665            // rolesAllowed has no post constraints
666            this.__rolesAllowed18a = rolesAllowed18a;
667            if (isMetafacadePropertyCachingEnabled())
668            {
669                this.__rolesAllowed18aSet = true;
670            }
671        }
672        return rolesAllowed18a;
673    }
674
675   /**
676    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#isRestAtom()
677    * @return boolean
678    */
679    protected abstract boolean handleIsRestAtom();
680
681    private boolean __restAtom19a;
682    private boolean __restAtom19aSet = false;
683
684    /**
685     * If this REST service provides application/atom, or any service operations provide
686     * application/atom
687     * @return (boolean)handleIsRestAtom()
688     */
689    public final boolean isRestAtom()
690    {
691        boolean restAtom19a = this.__restAtom19a;
692        if (!this.__restAtom19aSet)
693        {
694            // restAtom has no pre constraints
695            restAtom19a = handleIsRestAtom();
696            // restAtom has no post constraints
697            this.__restAtom19a = restAtom19a;
698            if (isMetafacadePropertyCachingEnabled())
699            {
700                this.__restAtom19aSet = true;
701            }
702        }
703        return restAtom19a;
704    }
705
706   /**
707    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#isRest()
708    * @return boolean
709    */
710    protected abstract boolean handleIsRest();
711
712    private boolean __rest20a;
713    private boolean __rest20aSet = false;
714
715    /**
716     * Is this operation a JAX-RS REST operation? JAX-WS and JAX-RS can be mixed in the same service
717     * class. If false, all rest attributes and methods are ignored.
718     * @return (boolean)handleIsRest()
719     */
720    public final boolean isRest()
721    {
722        boolean rest20a = this.__rest20a;
723        if (!this.__rest20aSet)
724        {
725            // rest has no pre constraints
726            rest20a = handleIsRest();
727            // rest has no post constraints
728            this.__rest20a = rest20a;
729            if (isMetafacadePropertyCachingEnabled())
730            {
731                this.__rest20aSet = true;
732            }
733        }
734        return rest20a;
735    }
736
737   /**
738    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getRestTestPath()
739    * @return String
740    */
741    protected abstract String handleGetRestTestPath();
742
743    private String __restTestPath21a;
744    private boolean __restTestPath21aSet = false;
745
746    /**
747     * The URL path to test the REST webservice. Substitutes test values for {parametername} parts
748     * of the service URL.
749     * @return (String)handleGetRestTestPath()
750     */
751    public final String getRestTestPath()
752    {
753        String restTestPath21a = this.__restTestPath21a;
754        if (!this.__restTestPath21aSet)
755        {
756            // restTestPath has no pre constraints
757            restTestPath21a = handleGetRestTestPath();
758            // restTestPath has no post constraints
759            this.__restTestPath21a = restTestPath21a;
760            if (isMetafacadePropertyCachingEnabled())
761            {
762                this.__restTestPath21aSet = true;
763            }
764        }
765        return restTestPath21a;
766    }
767
768   /**
769    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getOperationName()
770    * @return String
771    */
772    protected abstract String handleGetOperationName();
773
774    private String __operationName22a;
775    private boolean __operationName22aSet = false;
776
777    /**
778     * Returns the customized operation name. Defaults to operation.name, can be overridden with
779     * WebServiceOperation stereotype operationName attribute. Prevents duplicate operation names in
780     * wsdl for overloaded operations.
781     * @return (String)handleGetOperationName()
782     */
783    public final String getOperationName()
784    {
785        String operationName22a = this.__operationName22a;
786        if (!this.__operationName22aSet)
787        {
788            // operationName has no pre constraints
789            operationName22a = handleGetOperationName();
790            // operationName has no post constraints
791            this.__operationName22a = operationName22a;
792            if (isMetafacadePropertyCachingEnabled())
793            {
794                this.__operationName22aSet = true;
795            }
796        }
797        return operationName22a;
798    }
799
800   /**
801    * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#isWebFaultOnAllExceptions()
802    * @return boolean
803    */
804    protected abstract boolean handleIsWebFaultOnAllExceptions();
805
806    private boolean __webFaultOnAllExceptions23a;
807    private boolean __webFaultOnAllExceptions23aSet = false;
808
809    /**
810     * Checks is each service exception reference is some Exception type and has stereotype
811     * WebFault, if CXF.
812     * @return (boolean)handleIsWebFaultOnAllExceptions()
813     */
814    public final boolean isWebFaultOnAllExceptions()
815    {
816        boolean webFaultOnAllExceptions23a = this.__webFaultOnAllExceptions23a;
817        if (!this.__webFaultOnAllExceptions23aSet)
818        {
819            // webFaultOnAllExceptions has no pre constraints
820            webFaultOnAllExceptions23a = handleIsWebFaultOnAllExceptions();
821            // webFaultOnAllExceptions has no post constraints
822            this.__webFaultOnAllExceptions23a = webFaultOnAllExceptions23a;
823            if (isMetafacadePropertyCachingEnabled())
824            {
825                this.__webFaultOnAllExceptions23aSet = true;
826            }
827        }
828        return webFaultOnAllExceptions23a;
829    }
830
831    // ------------- associations ------------------
832
833    /**
834     * Represents an operation on a web service.
835     * @return (WebServicePackage)handleGetWebServicePackage()
836     */
837    public final WebServicePackage getWebServicePackage()
838    {
839        WebServicePackage getWebServicePackage1r = null;
840        // allowedOperations has no pre constraints
841        Object result = handleGetWebServicePackage();
842        MetafacadeBase shieldedResult = this.shieldedElement(result);
843        try
844        {
845            getWebServicePackage1r = (WebServicePackage)shieldedResult;
846        }
847        catch (ClassCastException ex)
848        {
849            // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
850            WebServiceOperationLogic.logger.warn("incorrect metafacade cast for WebServiceOperationLogic.getWebServicePackage WebServicePackage " + result + ": " + shieldedResult);
851        }
852        // allowedOperations has no post constraints
853        return getWebServicePackage1r;
854    }
855
856    /**
857     * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
858     * @return Object
859     */
860    protected abstract Object handleGetWebServicePackage();
861
862    /**
863     * @return true
864     * @see ServiceOperation
865     */
866    public boolean isServiceOperationMetaType()
867    {
868        return true;
869    }
870
871    /**
872     * @return true
873     * @see OperationFacade
874     */
875    public boolean isOperationFacadeMetaType()
876    {
877        return true;
878    }
879
880    /**
881     * @return true
882     * @see ModelElementFacade
883     */
884    public boolean isModelElementFacadeMetaType()
885    {
886        return true;
887    }
888
889    // ----------- delegates to ServiceOperation ------------
890    /**
891     * Copies all tagged values from the given ModelElementFacade to this model element facade.
892     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
893     */
894    public void copyTaggedValues(ModelElementFacade element)
895    {
896        this.getSuperServiceOperation().copyTaggedValues(element);
897    }
898
899    /**
900     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
901     * one found will be returned.
902     * @see ModelElementFacade#findTaggedValue(String tagName)
903     */
904    public Object findTaggedValue(String tagName)
905    {
906        return this.getSuperServiceOperation().findTaggedValue(tagName);
907    }
908
909    /**
910     * Returns all the values for the tagged value with the specified name. The returned collection
911     * will contains only String instances, or will be empty. Never null.
912     * @see ModelElementFacade#findTaggedValues(String tagName)
913     */
914    public Collection<Object> findTaggedValues(String tagName)
915    {
916        return this.getSuperServiceOperation().findTaggedValues(tagName);
917    }
918
919    /**
920     * Returns the fully qualified name of the model element. The fully qualified name includes
921     * complete package qualified name of the underlying model element. The templates parameter will
922     * be replaced by the correct one given the binding relation of the parameter to this element.
923     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
924     */
925    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
926    {
927        return this.getSuperServiceOperation().getBindedFullyQualifiedName(bindedElement);
928    }
929
930    /**
931     * Gets all constraints belonging to the model element.
932     * @see ModelElementFacade#getConstraints()
933     */
934    public Collection<ConstraintFacade> getConstraints()
935    {
936        return this.getSuperServiceOperation().getConstraints();
937    }
938
939    /**
940     * Returns the constraints of the argument kind that have been placed onto this model. Typical
941     * kinds are "inv", "pre" and "post". Other kinds are possible.
942     * @see ModelElementFacade#getConstraints(String kind)
943     */
944    public Collection<ConstraintFacade> getConstraints(String kind)
945    {
946        return this.getSuperServiceOperation().getConstraints(kind);
947    }
948
949    /**
950     * Gets the documentation for the model element, The indent argument is prefixed to each line.
951     * By default this method wraps lines after 64 characters.
952     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
953     * @see ModelElementFacade#getDocumentation(String indent)
954     */
955    public String getDocumentation(String indent)
956    {
957        return this.getSuperServiceOperation().getDocumentation(indent);
958    }
959
960    /**
961     * This method returns the documentation for this model element, with the lines wrapped after
962     * the specified number of characters, values of less than 1 will indicate no line wrapping is
963     * required. By default paragraphs are returned as HTML.
964     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
965     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
966     */
967    public String getDocumentation(String indent, int lineLength)
968    {
969        return this.getSuperServiceOperation().getDocumentation(indent, lineLength);
970    }
971
972    /**
973     * This method returns the documentation for this model element, with the lines wrapped after
974     * the specified number of characters, values of less than 1 will indicate no line wrapping is
975     * required. HTML style determines if HTML Escaping is applied.
976     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
977     */
978    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
979    {
980        return this.getSuperServiceOperation().getDocumentation(indent, lineLength, htmlStyle);
981    }
982
983    /**
984     * The fully qualified name of this model element.
985     * @see ModelElementFacade#getFullyQualifiedName()
986     */
987    public String getFullyQualifiedName()
988    {
989        return this.getSuperServiceOperation().getFullyQualifiedName();
990    }
991
992    /**
993     * Returns the fully qualified name of the model element. The fully qualified name includes
994     * complete package qualified name of the underlying model element.  If modelName is true, then
995     * the original name of the model element (the name contained within the model) will be the name
996     * returned, otherwise a name from a language mapping will be returned.
997     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
998     */
999    public String getFullyQualifiedName(boolean modelName)
1000    {
1001        return this.getSuperServiceOperation().getFullyQualifiedName(modelName);
1002    }
1003
1004    /**
1005     * Returns the fully qualified name as a path, the returned value always starts with out a slash
1006     * '/'.
1007     * @see ModelElementFacade#getFullyQualifiedNamePath()
1008     */
1009    public String getFullyQualifiedNamePath()
1010    {
1011        return this.getSuperServiceOperation().getFullyQualifiedNamePath();
1012    }
1013
1014    /**
1015     * Gets the unique identifier of the underlying model element.
1016     * @see ModelElementFacade#getId()
1017     */
1018    public String getId()
1019    {
1020        return this.getSuperServiceOperation().getId();
1021    }
1022
1023    /**
1024     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
1025     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
1026     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
1027     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
1028     * JDK5 compiler level.
1029     * @see ModelElementFacade#getKeywords()
1030     */
1031    public Collection<String> getKeywords()
1032    {
1033        return this.getSuperServiceOperation().getKeywords();
1034    }
1035
1036    /**
1037     * UML2: Retrieves a localized label for this named element.
1038     * @see ModelElementFacade#getLabel()
1039     */
1040    public String getLabel()
1041    {
1042        return this.getSuperServiceOperation().getLabel();
1043    }
1044
1045    /**
1046     * The language mappings that have been set for this model element.
1047     * @see ModelElementFacade#getLanguageMappings()
1048     */
1049    public TypeMappings getLanguageMappings()
1050    {
1051        return this.getSuperServiceOperation().getLanguageMappings();
1052    }
1053
1054    /**
1055     * Return the model containing this model element (multiple models may be loaded and processed
1056     * at the same time).
1057     * @see ModelElementFacade#getModel()
1058     */
1059    public ModelFacade getModel()
1060    {
1061        return this.getSuperServiceOperation().getModel();
1062    }
1063
1064    /**
1065     * The name of the model element.
1066     * @see ModelElementFacade#getName()
1067     */
1068    public String getName()
1069    {
1070        return this.getSuperServiceOperation().getName();
1071    }
1072
1073    /**
1074     * Gets the package to which this model element belongs.
1075     * @see ModelElementFacade#getPackage()
1076     */
1077    public ModelElementFacade getPackage()
1078    {
1079        return this.getSuperServiceOperation().getPackage();
1080    }
1081
1082    /**
1083     * The name of this model element's package.
1084     * @see ModelElementFacade#getPackageName()
1085     */
1086    public String getPackageName()
1087    {
1088        return this.getSuperServiceOperation().getPackageName();
1089    }
1090
1091    /**
1092     * Gets the package name (optionally providing the ability to retrieve the model name and not
1093     * the mapped name).
1094     * @see ModelElementFacade#getPackageName(boolean modelName)
1095     */
1096    public String getPackageName(boolean modelName)
1097    {
1098        return this.getSuperServiceOperation().getPackageName(modelName);
1099    }
1100
1101    /**
1102     * Returns the package as a path, the returned value always starts with out a slash '/'.
1103     * @see ModelElementFacade#getPackagePath()
1104     */
1105    public String getPackagePath()
1106    {
1107        return this.getSuperServiceOperation().getPackagePath();
1108    }
1109
1110    /**
1111     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1112     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1113     * the names of the containing namespaces starting at the root of the hierarchy and ending with
1114     * the name of the NamedElement itself.
1115     * @see ModelElementFacade#getQualifiedName()
1116     */
1117    public String getQualifiedName()
1118    {
1119        return this.getSuperServiceOperation().getQualifiedName();
1120    }
1121
1122    /**
1123     * Gets the root package for the model element.
1124     * @see ModelElementFacade#getRootPackage()
1125     */
1126    public PackageFacade getRootPackage()
1127    {
1128        return this.getSuperServiceOperation().getRootPackage();
1129    }
1130
1131    /**
1132     * Gets the dependencies for which this model element is the source.
1133     * @see ModelElementFacade#getSourceDependencies()
1134     */
1135    public Collection<DependencyFacade> getSourceDependencies()
1136    {
1137        return this.getSuperServiceOperation().getSourceDependencies();
1138    }
1139
1140    /**
1141     * If this model element is the context of an activity graph, this represents that activity
1142     * graph.
1143     * @see ModelElementFacade#getStateMachineContext()
1144     */
1145    public StateMachineFacade getStateMachineContext()
1146    {
1147        return this.getSuperServiceOperation().getStateMachineContext();
1148    }
1149
1150    /**
1151     * The collection of ALL stereotype names for this model element.
1152     * @see ModelElementFacade#getStereotypeNames()
1153     */
1154    public Collection<String> getStereotypeNames()
1155    {
1156        return this.getSuperServiceOperation().getStereotypeNames();
1157    }
1158
1159    /**
1160     * Gets all stereotypes for this model element.
1161     * @see ModelElementFacade#getStereotypes()
1162     */
1163    public Collection<StereotypeFacade> getStereotypes()
1164    {
1165        return this.getSuperServiceOperation().getStereotypes();
1166    }
1167
1168    /**
1169     * Return the TaggedValues associated with this model element, under all stereotypes.
1170     * @see ModelElementFacade#getTaggedValues()
1171     */
1172    public Collection<TaggedValueFacade> getTaggedValues()
1173    {
1174        return this.getSuperServiceOperation().getTaggedValues();
1175    }
1176
1177    /**
1178     * Gets the dependencies for which this model element is the target.
1179     * @see ModelElementFacade#getTargetDependencies()
1180     */
1181    public Collection<DependencyFacade> getTargetDependencies()
1182    {
1183        return this.getSuperServiceOperation().getTargetDependencies();
1184    }
1185
1186    /**
1187     * Get the template parameter for this model element having the parameterName
1188     * @see ModelElementFacade#getTemplateParameter(String parameterName)
1189     */
1190    public Object getTemplateParameter(String parameterName)
1191    {
1192        return this.getSuperServiceOperation().getTemplateParameter(parameterName);
1193    }
1194
1195    /**
1196     * Get the template parameters for this model element
1197     * @see ModelElementFacade#getTemplateParameters()
1198     */
1199    public Collection<TemplateParameterFacade> getTemplateParameters()
1200    {
1201        return this.getSuperServiceOperation().getTemplateParameters();
1202    }
1203
1204    /**
1205     * The visibility (i.e. public, private, protected or package) of the model element, will
1206     * attempt a lookup for these values in the language mappings (if any).
1207     * @see ModelElementFacade#getVisibility()
1208     */
1209    public String getVisibility()
1210    {
1211        return this.getSuperServiceOperation().getVisibility();
1212    }
1213
1214    /**
1215     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1216     * is taken into account when searching for the stereotype), false otherwise.
1217     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1218     */
1219    public boolean hasExactStereotype(String stereotypeName)
1220    {
1221        return this.getSuperServiceOperation().hasExactStereotype(stereotypeName);
1222    }
1223
1224    /**
1225     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1226     * pipe, semicolon, or << >>
1227     * @see ModelElementFacade#hasKeyword(String keywordName)
1228     */
1229    public boolean hasKeyword(String keywordName)
1230    {
1231        return this.getSuperServiceOperation().hasKeyword(keywordName);
1232    }
1233
1234    /**
1235     * Returns true if the model element has the specified stereotype.  If the stereotype itself
1236     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1237     * one of the stereotype's ancestors has a matching name this method will return true, false
1238     * otherwise.
1239     * For example, if we have a certain stereotype called <<exception>> and a model element has a
1240     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1241     * method with 'stereotypeName' defined as 'exception' the method would return true since
1242     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
1243     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1244     * @see ModelElementFacade#hasStereotype(String stereotypeName)
1245     */
1246    public boolean hasStereotype(String stereotypeName)
1247    {
1248        return this.getSuperServiceOperation().hasStereotype(stereotypeName);
1249    }
1250
1251    /**
1252     * True if there are target dependencies from this element that are instances of BindingFacade.
1253     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1254     * @see ModelElementFacade#isBindingDependenciesPresent()
1255     */
1256    public boolean isBindingDependenciesPresent()
1257    {
1258        return this.getSuperServiceOperation().isBindingDependenciesPresent();
1259    }
1260
1261    /**
1262     * Indicates if any constraints are present on this model element.
1263     * @see ModelElementFacade#isConstraintsPresent()
1264     */
1265    public boolean isConstraintsPresent()
1266    {
1267        return this.getSuperServiceOperation().isConstraintsPresent();
1268    }
1269
1270    /**
1271     * Indicates if any documentation is present on this model element.
1272     * @see ModelElementFacade#isDocumentationPresent()
1273     */
1274    public boolean isDocumentationPresent()
1275    {
1276        return this.getSuperServiceOperation().isDocumentationPresent();
1277    }
1278
1279    /**
1280     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1281     * @see ModelElementFacade#isReservedWord()
1282     */
1283    public boolean isReservedWord()
1284    {
1285        return this.getSuperServiceOperation().isReservedWord();
1286    }
1287
1288    /**
1289     * True is there are template parameters on this model element. For UML2, applies to Class,
1290     * Operation, Property, and Parameter.
1291     * @see ModelElementFacade#isTemplateParametersPresent()
1292     */
1293    public boolean isTemplateParametersPresent()
1294    {
1295        return this.getSuperServiceOperation().isTemplateParametersPresent();
1296    }
1297
1298    /**
1299     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1300     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1301     * Enumerations and Interfaces, optionally applies on other model elements.
1302     * @see ModelElementFacade#isValidIdentifierName()
1303     */
1304    public boolean isValidIdentifierName()
1305    {
1306        return this.getSuperServiceOperation().isValidIdentifierName();
1307    }
1308
1309    /**
1310     * Searches for the constraint with the specified 'name' on this model element, and if found
1311     * translates it using the specified 'translation' from a translation library discovered by the
1312     * framework.
1313     * @see ModelElementFacade#translateConstraint(String name, String translation)
1314     */
1315    public String translateConstraint(String name, String translation)
1316    {
1317        return this.getSuperServiceOperation().translateConstraint(name, translation);
1318    }
1319
1320    /**
1321     * Translates all constraints belonging to this model element with the given 'translation'.
1322     * @see ModelElementFacade#translateConstraints(String translation)
1323     */
1324    public String[] translateConstraints(String translation)
1325    {
1326        return this.getSuperServiceOperation().translateConstraints(translation);
1327    }
1328
1329    /**
1330     * Translates the constraints of the specified 'kind' belonging to this model element.
1331     * @see ModelElementFacade#translateConstraints(String kind, String translation)
1332     */
1333    public String[] translateConstraints(String kind, String translation)
1334    {
1335        return this.getSuperServiceOperation().translateConstraints(kind, translation);
1336    }
1337
1338    /**
1339     * Finds the parameter on this operation having the given name, if no parameter is found, null
1340     * is returned instead.
1341     * @see OperationFacade#findParameter(String name)
1342     */
1343    public ParameterFacade findParameter(String name)
1344    {
1345        return this.getSuperServiceOperation().findParameter(name);
1346    }
1347
1348    /**
1349     * Searches the given feature for the specified tag.
1350     * If the follow boolean is set to true then the search will continue from the class operation
1351     * to the class itself and then up the class hierarchy.
1352     * @see OperationFacade#findTaggedValue(String name, boolean follow)
1353     */
1354    public Object findTaggedValue(String name, boolean follow)
1355    {
1356        return this.getSuperServiceOperation().findTaggedValue(name, follow);
1357    }
1358
1359    /**
1360     * A comma separated list of all argument names.
1361     * @see OperationFacade#getArgumentNames()
1362     */
1363    public String getArgumentNames()
1364    {
1365        return this.getSuperServiceOperation().getArgumentNames();
1366    }
1367
1368    /**
1369     * A comma separated list of all types of each argument, in order.
1370     * @see OperationFacade#getArgumentTypeNames()
1371     */
1372    public String getArgumentTypeNames()
1373    {
1374        return this.getSuperServiceOperation().getArgumentTypeNames();
1375    }
1376
1377    /**
1378     * Specification of an argument used to pass information into or out of an invocation of a
1379     * behavioral
1380     * feature. Parameters are allowed to be treated as connectable elements. Parameters have
1381     * support for
1382     * streaming, exceptions, and parameter sets.
1383     * @see OperationFacade#getArguments()
1384     */
1385    public Collection<ParameterFacade> getArguments()
1386    {
1387        return this.getSuperServiceOperation().getArguments();
1388    }
1389
1390    /**
1391     * Constructs the operation call with the operation name
1392     * @see OperationFacade#getCall()
1393     */
1394    public String getCall()
1395    {
1396        return this.getSuperServiceOperation().getCall();
1397    }
1398
1399    /**
1400     * Returns the concurrency modifier for this operation (i.e. concurrent, guarded or sequential)
1401     * of the model element, will attempt a lookup for these values in the language mappings (if
1402     * any).
1403     * @see OperationFacade#getConcurrency()
1404     */
1405    public String getConcurrency()
1406    {
1407        return this.getSuperServiceOperation().getConcurrency();
1408    }
1409
1410    /**
1411     * A comma separated list containing all exceptions that this operation throws.  Exceptions are
1412     * determined through dependencies that have the target element stereotyped as <<Exception>>.
1413     * @see OperationFacade#getExceptionList()
1414     */
1415    public String getExceptionList()
1416    {
1417        return this.getSuperServiceOperation().getExceptionList();
1418    }
1419
1420    /**
1421     * Returns a comma separated list of exceptions appended to the comma separated list of fully
1422     * qualified 'initialException' classes passed in to this method.
1423     * @see OperationFacade#getExceptionList(String initialExceptions)
1424     */
1425    public String getExceptionList(String initialExceptions)
1426    {
1427        return this.getSuperServiceOperation().getExceptionList(initialExceptions);
1428    }
1429
1430    /**
1431     * A collection of all exceptions thrown by this operation.
1432     * @see OperationFacade#getExceptions()
1433     */
1434    public Collection<ModelElementFacade> getExceptions()
1435    {
1436        return this.getSuperServiceOperation().getExceptions();
1437    }
1438
1439    /**
1440     * Return Type with multiplicity taken into account. UML14 does not allow multiplicity *.
1441     * @see OperationFacade#getGetterSetterReturnTypeName()
1442     */
1443    public String getGetterSetterReturnTypeName()
1444    {
1445        return this.getSuperServiceOperation().getGetterSetterReturnTypeName();
1446    }
1447
1448    /**
1449     * the lower value for the multiplicity
1450     * -only applicable for UML2
1451     * @see OperationFacade#getLower()
1452     */
1453    public int getLower()
1454    {
1455        return this.getSuperServiceOperation().getLower();
1456    }
1457
1458    /**
1459     * Returns the operation method body determined from UML sequence diagrams or other UML sources.
1460     * @see OperationFacade#getMethodBody()
1461     */
1462    public String getMethodBody()
1463    {
1464        return this.getSuperServiceOperation().getMethodBody();
1465    }
1466
1467    /**
1468     * The operation this operation overrides, null if this operation is not overriding.
1469     * @see OperationFacade#getOverriddenOperation()
1470     */
1471    public OperationFacade getOverriddenOperation()
1472    {
1473        return this.getSuperServiceOperation().getOverriddenOperation();
1474    }
1475
1476    /**
1477     * Gets the owner of this operation
1478     * @see OperationFacade#getOwner()
1479     */
1480    public ClassifierFacade getOwner()
1481    {
1482        return this.getSuperServiceOperation().getOwner();
1483    }
1484
1485    /**
1486     * Return all parameters for the operation, including the return parameter.
1487     * @see OperationFacade#getParameters()
1488     */
1489    public Collection<ParameterFacade> getParameters()
1490    {
1491        return this.getSuperServiceOperation().getParameters();
1492    }
1493
1494    /**
1495     * The name of the operation that handles postcondition constraints.
1496     * @see OperationFacade#getPostconditionName()
1497     */
1498    public String getPostconditionName()
1499    {
1500        return this.getSuperServiceOperation().getPostconditionName();
1501    }
1502
1503    /**
1504     * The postcondition constraints belonging to this operation.
1505     * @see OperationFacade#getPostconditions()
1506     */
1507    public Collection<ConstraintFacade> getPostconditions()
1508    {
1509        return this.getSuperServiceOperation().getPostconditions();
1510    }
1511
1512    /**
1513     * The call to the precondition operation.
1514     * @see OperationFacade#getPreconditionCall()
1515     */
1516    public String getPreconditionCall()
1517    {
1518        return this.getSuperServiceOperation().getPreconditionCall();
1519    }
1520
1521    /**
1522     * The name of the operation that handles precondition constraints.
1523     * @see OperationFacade#getPreconditionName()
1524     */
1525    public String getPreconditionName()
1526    {
1527        return this.getSuperServiceOperation().getPreconditionName();
1528    }
1529
1530    /**
1531     * The signature of the precondition operation.
1532     * @see OperationFacade#getPreconditionSignature()
1533     */
1534    public String getPreconditionSignature()
1535    {
1536        return this.getSuperServiceOperation().getPreconditionSignature();
1537    }
1538
1539    /**
1540     * The precondition constraints belonging to this operation.
1541     * @see OperationFacade#getPreconditions()
1542     */
1543    public Collection<ConstraintFacade> getPreconditions()
1544    {
1545        return this.getSuperServiceOperation().getPreconditions();
1546    }
1547
1548    /**
1549     * (UML2 Only). Get the actual return parameter (which may have stereotypes etc).
1550     * @see OperationFacade#getReturnParameter()
1551     */
1552    public ParameterFacade getReturnParameter()
1553    {
1554        return this.getSuperServiceOperation().getReturnParameter();
1555    }
1556
1557    /**
1558     * The operation return type parameter.
1559     * @see OperationFacade#getReturnType()
1560     */
1561    public ClassifierFacade getReturnType()
1562    {
1563        return this.getSuperServiceOperation().getReturnType();
1564    }
1565
1566    /**
1567     * Return the operation signature, including public/protested abstract returnType name plus
1568     * argument type and name
1569     * @see OperationFacade#getSignature()
1570     */
1571    public String getSignature()
1572    {
1573        return this.getSuperServiceOperation().getSignature();
1574    }
1575
1576    /**
1577     * Returns the signature of the operation and optionally appends the argument names (if
1578     * withArgumentNames is true), otherwise returns the signature with just the types alone in the
1579     * signature.
1580     * @see OperationFacade#getSignature(boolean withArgumentNames)
1581     */
1582    public String getSignature(boolean withArgumentNames)
1583    {
1584        return this.getSuperServiceOperation().getSignature(withArgumentNames);
1585    }
1586
1587    /**
1588     * Returns the signature of the operation and optionally appends the given 'argumentModifier' to
1589     * each argument.
1590     * @see OperationFacade#getSignature(String argumentModifier)
1591     */
1592    public String getSignature(String argumentModifier)
1593    {
1594        return this.getSuperServiceOperation().getSignature(argumentModifier);
1595    }
1596
1597    /**
1598     * A comma-separated parameter list  (type and name of each parameter) of an operation.
1599     * @see OperationFacade#getTypedArgumentList()
1600     */
1601    public String getTypedArgumentList()
1602    {
1603        return this.getSuperServiceOperation().getTypedArgumentList();
1604    }
1605
1606    /**
1607     * A comma-separated parameter list  (type and name of each parameter) of an operation with an
1608     * optional modifier (i.e final) before each parameter.
1609     * @see OperationFacade#getTypedArgumentList(String modifier)
1610     */
1611    public String getTypedArgumentList(String modifier)
1612    {
1613        return this.getSuperServiceOperation().getTypedArgumentList(modifier);
1614    }
1615
1616    /**
1617     * the upper value for the multiplicity (will be -1 for *)
1618     * - only applicable for UML2
1619     * @see OperationFacade#getUpper()
1620     */
1621    public int getUpper()
1622    {
1623        return this.getSuperServiceOperation().getUpper();
1624    }
1625
1626    /**
1627     * True is the operation is abstract.
1628     * @see OperationFacade#isAbstract()
1629     */
1630    public boolean isAbstract()
1631    {
1632        return this.getSuperServiceOperation().isAbstract();
1633    }
1634
1635    /**
1636     * True if the operation has (i.e. throws any exceptions) false otherwise.
1637     * @see OperationFacade#isExceptionsPresent()
1638     */
1639    public boolean isExceptionsPresent()
1640    {
1641        return this.getSuperServiceOperation().isExceptionsPresent();
1642    }
1643
1644    /**
1645     * IsLeaf property in the operation. If true, operation is final, cannot be extended or
1646     * implemented by a descendant. Default=false.
1647     * @see OperationFacade#isLeaf()
1648     */
1649    public boolean isLeaf()
1650    {
1651        return this.getSuperServiceOperation().isLeaf();
1652    }
1653
1654    /**
1655     * UML2 only. If the return type parameter multiplicity>1 OR the operation multiplicity>1.
1656     * Default=false.
1657     * @see OperationFacade#isMany()
1658     */
1659    public boolean isMany()
1660    {
1661        return this.getSuperServiceOperation().isMany();
1662    }
1663
1664    /**
1665     * UML2 only: If isMany (Collection type returned), is the type unique within the collection. 
1666     * Unique+Ordered determines CollectionType implementation of return result. Default=false.
1667     * @see OperationFacade#isOrdered()
1668     */
1669    public boolean isOrdered()
1670    {
1671        return this.getSuperServiceOperation().isOrdered();
1672    }
1673
1674    /**
1675     * True if this operation overrides an operation defined in an ancestor class. An operation
1676     * overrides when the names of the operations as well as the types of the arguments are equal.
1677     * The return type may be different and is, as well as any exceptions, ignored.
1678     * @see OperationFacade#isOverriding()
1679     */
1680    public boolean isOverriding()
1681    {
1682        return this.getSuperServiceOperation().isOverriding();
1683    }
1684
1685    /**
1686     * Whether any postcondition constraints are present on this operation.
1687     * @see OperationFacade#isPostconditionsPresent()
1688     */
1689    public boolean isPostconditionsPresent()
1690    {
1691        return this.getSuperServiceOperation().isPostconditionsPresent();
1692    }
1693
1694    /**
1695     * Whether any precondition constraints are present on this operation.
1696     * @see OperationFacade#isPreconditionsPresent()
1697     */
1698    public boolean isPreconditionsPresent()
1699    {
1700        return this.getSuperServiceOperation().isPreconditionsPresent();
1701    }
1702
1703    /**
1704     * Indicates whether or not this operation is a query operation.
1705     * @see OperationFacade#isQuery()
1706     */
1707    public boolean isQuery()
1708    {
1709        return this.getSuperServiceOperation().isQuery();
1710    }
1711
1712    /**
1713     * True/false depending on whether or not the operation has a return type or not (i.e. a return
1714     * type of something other than void).
1715     * @see OperationFacade#isReturnTypePresent()
1716     */
1717    public boolean isReturnTypePresent()
1718    {
1719        return this.getSuperServiceOperation().isReturnTypePresent();
1720    }
1721
1722    /**
1723     * True is the operation is static (only a single instance can be instantiated).
1724     * @see OperationFacade#isStatic()
1725     */
1726    public boolean isStatic()
1727    {
1728        return this.getSuperServiceOperation().isStatic();
1729    }
1730
1731    /**
1732     * UML2 only: for Collection return type, is the type unique within the collection.
1733     * Unique+Ordered determines the returned CollectionType. Default=false.
1734     * @see OperationFacade#isUnique()
1735     */
1736    public boolean isUnique()
1737    {
1738        return this.getSuperServiceOperation().isUnique();
1739    }
1740
1741    /**
1742     * The destination for any incoming messages.
1743     * @see ServiceOperation#getIncomingDestination()
1744     */
1745    public Destination getIncomingDestination()
1746    {
1747        return this.getSuperServiceOperation().getIncomingDestination();
1748    }
1749
1750    /**
1751     * The destination for any outgoing messages.
1752     * @see ServiceOperation#getOutgoingDestination()
1753     */
1754    public Destination getOutgoingDestination()
1755    {
1756        return this.getSuperServiceOperation().getOutgoingDestination();
1757    }
1758
1759    /**
1760     * The users of the service operation, these are the actor's that can access this operation.
1761     * @see ServiceOperation#getRoles()
1762     */
1763    public Collection<Role> getRoles()
1764    {
1765        return this.getSuperServiceOperation().getRoles();
1766    }
1767
1768    /**
1769     * The service which owns the service operation.
1770     * @see ServiceOperation#getService()
1771     */
1772    public Service getService()
1773    {
1774        return this.getSuperServiceOperation().getService();
1775    }
1776
1777    /**
1778     * Whether or not this operation represents an "incoming" message operation (i.e. it receives
1779     * messages from Queues or Topics).
1780     * @see ServiceOperation#isIncomingMessageOperation()
1781     */
1782    public boolean isIncomingMessageOperation()
1783    {
1784        return this.getSuperServiceOperation().isIncomingMessageOperation();
1785    }
1786
1787    /**
1788     * Whether or not this is operation accepts incoming or outgoing messages.
1789     * @see ServiceOperation#isMessageOperation()
1790     */
1791    public boolean isMessageOperation()
1792    {
1793        return this.getSuperServiceOperation().isMessageOperation();
1794    }
1795
1796    /**
1797     * Whether or not this service operation represents an "outgoing" messaging operation (i.e. it
1798     * sends messages to Queues or Topics).
1799     * @see ServiceOperation#isOutgoingMessageOperation()
1800     */
1801    public boolean isOutgoingMessageOperation()
1802    {
1803        return this.getSuperServiceOperation().isOutgoingMessageOperation();
1804    }
1805
1806    /**
1807     * @see MetafacadeBase#initialize()
1808     */
1809    @Override
1810    public void initialize()
1811    {
1812        this.getSuperServiceOperation().initialize();
1813    }
1814
1815    /**
1816     * @return Object getSuperServiceOperation().getValidationOwner()
1817     * @see MetafacadeBase#getValidationOwner()
1818     */
1819    @Override
1820    public Object getValidationOwner()
1821    {
1822        Object owner = this.getSuperServiceOperation().getValidationOwner();
1823        return owner;
1824    }
1825
1826    /**
1827     * @return String getSuperServiceOperation().getValidationName()
1828     * @see MetafacadeBase#getValidationName()
1829     */
1830    @Override
1831    public String getValidationName()
1832    {
1833        String name = this.getSuperServiceOperation().getValidationName();
1834        return name;
1835    }
1836
1837    /**
1838     * <p><b>Constraint:</b> org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation return type can not be a collection type</p>
1839     * <p><b>Error:</b> A web service operation's return type can NOT be a collection type, you'll need to model an array instead.</p>
1840     * <p><b>OCL:</b> context WebServiceOperation inv: exposed implies returnType.collectionType = false</p>
1841     * <p><b>Constraint:</b> org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation exception must be a web fault</p>
1842     * <p><b>Error:</b> Each web service operation exception must have the web fault stereotype.</p>
1843     * <p><b>OCL:</b> context WebServiceOperation inv: exposed implies webFaultOnAllExceptions = true</p>
1844     * @param validationMessages Collection<ModelValidationMessage>
1845     * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1846     */
1847    @Override
1848    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1849    {
1850        this.getSuperServiceOperation().validateInvariants(validationMessages);
1851        try
1852        {
1853            final Object contextElement = this.THIS();
1854            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"exposed"))).booleanValue()?OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"returnType.collectionType"),false):true));
1855            if (!constraintValid)
1856            {
1857                validationMessages.add(
1858                    new ModelValidationMessage(
1859                        (MetafacadeBase)contextElement ,
1860                        "org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation return type can not be a collection type",
1861                        "A web service operation's return type can NOT be a collection type, you'll need to model an array instead."));
1862            }
1863        }
1864        catch (Throwable th)
1865        {
1866            Throwable cause = th.getCause();
1867            int depth = 0; // Some throwables have infinite recursion
1868            while (cause != null && depth < 7)
1869            {
1870                th = cause;
1871                depth++;
1872            }
1873            logger.error("Error validating constraint 'org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation return type can not be a collection type' ON "
1874                + this.THIS().toString() + ": " + th.getMessage(), th);
1875        }
1876        try
1877        {
1878            final Object contextElement = this.THIS();
1879            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"exposed"))).booleanValue()?OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"webFaultOnAllExceptions"),true):true));
1880            if (!constraintValid)
1881            {
1882                validationMessages.add(
1883                    new ModelValidationMessage(
1884                        (MetafacadeBase)contextElement ,
1885                        "org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation exception must be a web fault",
1886                        "Each web service operation exception must have the web fault stereotype."));
1887            }
1888        }
1889        catch (Throwable th)
1890        {
1891            Throwable cause = th.getCause();
1892            int depth = 0; // Some throwables have infinite recursion
1893            while (cause != null && depth < 7)
1894            {
1895                th = cause;
1896                depth++;
1897            }
1898            logger.error("Error validating constraint 'org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation exception must be a web fault' ON "
1899                + this.THIS().toString() + ": " + th.getMessage(), th);
1900        }
1901    }
1902
1903    /**
1904     * The property that stores the name of the metafacade.
1905     */
1906    private static final String NAME_PROPERTY = "name";
1907    private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1908
1909    /**
1910     * @see Object#toString()
1911     */
1912    @Override
1913    public String toString()
1914    {
1915        final StringBuilder toString = new StringBuilder(this.getClass().getName());
1916        toString.append("[");
1917        try
1918        {
1919            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1920        }
1921        catch (final Throwable tryAgain)
1922        {
1923            try
1924            {
1925                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1926            }
1927            catch (final Throwable ignore)
1928            {
1929                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1930            }
1931        }
1932        toString.append("]");
1933        return toString.toString();
1934    }
1935}