View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   
6   package com.hack23.cia.model.application.impl.admin;
7   
8   import java.util.Date;
9   
10  import javax.persistence.DiscriminatorValue;
11  import javax.persistence.Entity;
12  import javax.persistence.EnumType;
13  import javax.persistence.Enumerated;
14  
15  import org.hibernate.annotations.Cache;
16  import org.hibernate.annotations.CacheConcurrencyStrategy;
17  
18  import com.hack23.cia.model.application.impl.common.UserSession;
19  
20  /***
21   * The Class AgencyActionEvent.
22   */
23  @Entity
24  @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
25  @DiscriminatorValue("AgencyActionEvent")
26  public class AgencyActionEvent extends AbstractAgencyActionEvent {
27  
28      /***
29       * The Enum Operation.
30       */
31      public enum Operation {
32  
33          /*** The Add language. */
34          AddLanguage,
35  
36          /*** The Add portal. */
37          AddPortal,
38  
39          /*** The Configure agency. */
40          ConfigureAgency,
41  
42          /*** The Update agency. */
43          UpdateAgency;
44      }
45  
46      /*** The Constant serialVersionUID. */
47      private static final long serialVersionUID = 1L;
48  
49      /*** The operation. */
50      private Operation operation;
51  
52      /***
53       * Instantiates a new agency action event.
54       */
55      public AgencyActionEvent() {
56      }
57  
58      /***
59       * Instantiates a new agency action event.
60       *
61       * @param createdDate the created date
62       * @param userSession the user session
63       * @param operation the operation
64       * @param agencyId the agency id
65       */
66      public AgencyActionEvent(final Date createdDate,
67              final UserSession userSession, final Operation operation,
68              final Long agencyId) {
69          super(createdDate, userSession, agencyId);
70          this.operation = operation;
71      }
72  
73      /***
74       * Gets the operation.
75       *
76       * @return the operation
77       */
78      @Enumerated(EnumType.STRING)
79      public Operation getOperation() {
80          return operation;
81      }
82  
83      /***
84       * Sets the operation.
85       *
86       * @param operation the new operation
87       */
88      public void setOperation(final Operation operation) {
89          this.operation = operation;
90      }
91  }