2 * Copyright (C) 2012-2015 Tobias Brunner
3 * Copyright (C) 2012 Giuliano Grassi
4 * Copyright (C) 2012 Ralf Sager
5 * Hochschule fuer Technik Rapperswil
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 package org
.strongswan
.android
.data
;
21 public class VpnProfile
implements Cloneable
23 /* While storing this as EnumSet would be nicer this simplifies storing it in a database */
24 public static final int SPLIT_TUNNELING_BLOCK_IPV4
= 1;
25 public static final int SPLIT_TUNNELING_BLOCK_IPV6
= 2;
27 private String mName
, mGateway
, mUsername
, mPassword
, mCertificate
, mUserCertificate
;
28 private Integer mMTU
, mPort
, mSplitTunneling
;
29 private VpnType mVpnType
;
30 private long mId
= -1;
37 public void setId(long id
)
42 public String
getName()
47 public void setName(String name
)
52 public String
getGateway()
57 public void setGateway(String gateway
)
59 this.mGateway
= gateway
;
62 public VpnType
getVpnType()
67 public void setVpnType(VpnType type
)
72 public String
getUsername()
77 public void setUsername(String username
)
79 this.mUsername
= username
;
82 public String
getPassword()
87 public void setPassword(String password
)
89 this.mPassword
= password
;
92 public String
getCertificateAlias()
97 public void setCertificateAlias(String alias
)
99 this.mCertificate
= alias
;
102 public String
getUserCertificateAlias()
104 return mUserCertificate
;
107 public void setUserCertificateAlias(String alias
)
109 this.mUserCertificate
= alias
;
112 public Integer
getMTU()
117 public void setMTU(Integer mtu
)
122 public Integer
getPort()
127 public void setPort(Integer port
)
132 public Integer
getSplitTunneling()
134 return mSplitTunneling
;
137 public void setSplitTunneling(Integer splitTunneling
)
139 this.mSplitTunneling
= splitTunneling
;
143 public String
toString()
149 public boolean equals(Object o
)
151 if (o
!= null && o
instanceof VpnProfile
)
153 return this.mId
== ((VpnProfile
)o
).getId();
159 public VpnProfile
clone()
163 return (VpnProfile
)super.clone();
165 catch (CloneNotSupportedException e
)
167 throw new AssertionError();