001/**
002 * Copyright 2016 Tampere University of Technology, Pori Department
003 * 
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 *   http://www.apache.org/licenses/LICENSE-2.0
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package service.tut.pori.apilta.alerts.datatypes;
017
018import java.util.List;
019import java.util.Set;
020
021import javax.xml.bind.annotation.XmlAccessType;
022import javax.xml.bind.annotation.XmlAccessorType;
023import javax.xml.bind.annotation.XmlElement;
024import javax.xml.bind.annotation.XmlElementWrapper;
025import javax.xml.bind.annotation.XmlRootElement;
026
027import service.tut.pori.apilta.alerts.datatypes.AlertUserIdentity.UserPermission;
028
029
030/**
031 * permission group for an alert
032 * 
033 */
034@XmlRootElement(name=Definitions.ELEMENT_ALERT_GROUP)
035@XmlAccessorType(XmlAccessType.NONE)
036public class AlertGroup {
037  @XmlElement(name=Definitions.ELEMENT_ALERT_GROUP_ID)
038  private Long _alertGroupId = null;
039  @XmlElement(name=Definitions.ELEMENT_DESCRIPTION)
040  private String _description = null;
041  @XmlElement(name=Definitions.ELEMENT_NAME)
042  private String _name = null;
043  @XmlElementWrapper(name=Definitions.ELEMENT_PERMISSION_LIST)
044  @XmlElement(name=Definitions.ELEMENT_PERMISSION)
045  private Set<UserPermission> _permissions = null; // global permissions
046  @XmlElementWrapper(name=core.tut.pori.users.Definitions.ELEMENT_USER_IDENTITY_LIST)
047  @XmlElement(name=core.tut.pori.users.Definitions.ELEMENT_USER_IDENTITY)
048  private List<AlertUserIdentity> _users = null;
049  
050    /**
051   * @return the alertGroupId
052   * @see #setAlertGroupId(Long)
053   */
054  public Long getAlertGroupId() {
055    return _alertGroupId;
056  }
057
058  /**
059   * @param alertGroupId the alertGroupId to set
060   * @see #getAlertGroupId()
061   */
062  public void setAlertGroupId(Long alertGroupId) {
063    _alertGroupId = alertGroupId;
064  }
065
066  /**
067   * @return the description
068   * @see #setDescription(String)
069   */
070  public String getDescription() {
071    return _description;
072  }
073  
074  /**
075   * @param description the description to set
076   * @see #getDescription()
077   */
078  public void setDescription(String description) {
079    _description = description;
080  }
081  
082  /**
083   * @return the name
084   * @see #setName(String)
085   */
086  public String getName() {
087    return _name;
088  }
089  
090  /**
091   * @param name the name to set
092   * @see #getName()
093   */
094  public void setName(String name) {
095    _name = name;
096  }
097  
098  /**
099   * @return the permissions
100   * @see #setPermissions(Set)
101   */
102  public Set<UserPermission> getPermissions() {
103    return _permissions;
104  }
105  
106  /**
107   * @param permissions the permissions to set
108   * @see #getPermissions()
109   */
110  public void setPermissions(Set<UserPermission> permissions) {
111    _permissions = permissions;
112  }
113  
114  /**
115   * @return the users
116   * @see #setUsers(List)
117   */
118  public List<AlertUserIdentity> getUsers() {
119    return _users;
120  }
121  
122  /**
123   * @param users the users to set
124   * @see #getUsers()
125   */
126  public void setUsers(List<AlertUserIdentity> users) {
127    _users = users;
128  }
129}