View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.scxml2.system;
18  
19  import java.io.Serializable;
20  
21  /**
22   * Event system variable holding a structure containing the current event's name and any data contained in the event
23   */
24  public class EventVariable implements Serializable {
25  
26      /**
27       * Serial version UID.
28       */
29      private static final long serialVersionUID = 1L;
30  
31      public static final String TYPE_PLATFORM = "platform";
32      public static final String TYPE_INTERNAL = "internal";
33      public static final String TYPE_EXTERNAL = "external";
34  
35      /**
36       * The name of the event.
37       */
38      private final String name;
39  
40      /**
41       * The event type
42       */
43      private final String type;
44  
45      /**
46       * The sendid in case the sending entity has specified a value for this.
47       */
48      private final String sendid;
49  
50      /**
51       * The URI string of the originating entity in an external event.
52       */
53      private final String origin;
54  
55      /**
56       * The type in an external event.
57       */
58      private final String origintype;
59  
60      /**
61       * The invoke id of the invocation that triggered the child process.
62       */
63      private final String invokeid;
64  
65      /**
66       * Whatever data the sending entity chose to include in the event
67       */
68      private final Object data;
69  
70      public EventVariable(final String name, final String type, final String sendid, final String origin, final String origintype, final String invokeid, final Object data) {
71          this.name = name;
72          this.type = type;
73          this.sendid = sendid;
74          this.origin = origin;
75          this.origintype = origintype;
76          this.invokeid = invokeid;
77          this.data = data;
78      }
79  
80      public String getName() {
81          return name;
82      }
83  
84      public String getType() {
85          return type;
86      }
87  
88      public String getSendid() {
89          return sendid;
90      }
91  
92      public String getOrigin() {
93          return origin;
94      }
95  
96      public String getOrigintype() {
97          return origintype;
98      }
99  
100     public String getInvokeid() {
101         return invokeid;
102     }
103 
104     public Object getData() {
105         return data;
106     }
107 }
108