001
014
015 package com.liferay.portal.model.impl;
016
017 import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.kernel.json.JSON;
020 import com.liferay.portal.kernel.util.GetterUtil;
021 import com.liferay.portal.kernel.util.ProxyUtil;
022 import com.liferay.portal.kernel.util.StringBundler;
023 import com.liferay.portal.kernel.util.StringPool;
024 import com.liferay.portal.model.CacheModel;
025 import com.liferay.portal.model.PasswordPolicy;
026 import com.liferay.portal.model.PasswordPolicyModel;
027 import com.liferay.portal.model.PasswordPolicySoap;
028 import com.liferay.portal.service.ServiceContext;
029 import com.liferay.portal.util.PortalUtil;
030
031 import com.liferay.portlet.expando.model.ExpandoBridge;
032 import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
033
034 import java.io.Serializable;
035
036 import java.sql.Types;
037
038 import java.util.ArrayList;
039 import java.util.Date;
040 import java.util.HashMap;
041 import java.util.List;
042 import java.util.Map;
043
044
057 @JSON(strict = true)
058 public class PasswordPolicyModelImpl extends BaseModelImpl<PasswordPolicy>
059 implements PasswordPolicyModel {
060
065 public static final String TABLE_NAME = "PasswordPolicy";
066 public static final Object[][] TABLE_COLUMNS = {
067 { "uuid_", Types.VARCHAR },
068 { "passwordPolicyId", Types.BIGINT },
069 { "companyId", Types.BIGINT },
070 { "userId", Types.BIGINT },
071 { "userName", Types.VARCHAR },
072 { "createDate", Types.TIMESTAMP },
073 { "modifiedDate", Types.TIMESTAMP },
074 { "defaultPolicy", Types.BOOLEAN },
075 { "name", Types.VARCHAR },
076 { "description", Types.VARCHAR },
077 { "changeable", Types.BOOLEAN },
078 { "changeRequired", Types.BOOLEAN },
079 { "minAge", Types.BIGINT },
080 { "checkSyntax", Types.BOOLEAN },
081 { "allowDictionaryWords", Types.BOOLEAN },
082 { "minAlphanumeric", Types.INTEGER },
083 { "minLength", Types.INTEGER },
084 { "minLowerCase", Types.INTEGER },
085 { "minNumbers", Types.INTEGER },
086 { "minSymbols", Types.INTEGER },
087 { "minUpperCase", Types.INTEGER },
088 { "regex", Types.VARCHAR },
089 { "history", Types.BOOLEAN },
090 { "historyCount", Types.INTEGER },
091 { "expireable", Types.BOOLEAN },
092 { "maxAge", Types.BIGINT },
093 { "warningTime", Types.BIGINT },
094 { "graceLimit", Types.INTEGER },
095 { "lockout", Types.BOOLEAN },
096 { "maxFailure", Types.INTEGER },
097 { "lockoutDuration", Types.BIGINT },
098 { "requireUnlock", Types.BOOLEAN },
099 { "resetFailureCount", Types.BIGINT },
100 { "resetTicketMaxAge", Types.BIGINT }
101 };
102 public static final String TABLE_SQL_CREATE = "create table PasswordPolicy (uuid_ VARCHAR(75) null,passwordPolicyId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,defaultPolicy BOOLEAN,name VARCHAR(75) null,description STRING null,changeable BOOLEAN,changeRequired BOOLEAN,minAge LONG,checkSyntax BOOLEAN,allowDictionaryWords BOOLEAN,minAlphanumeric INTEGER,minLength INTEGER,minLowerCase INTEGER,minNumbers INTEGER,minSymbols INTEGER,minUpperCase INTEGER,regex VARCHAR(75) null,history BOOLEAN,historyCount INTEGER,expireable BOOLEAN,maxAge LONG,warningTime LONG,graceLimit INTEGER,lockout BOOLEAN,maxFailure INTEGER,lockoutDuration LONG,requireUnlock BOOLEAN,resetFailureCount LONG,resetTicketMaxAge LONG)";
103 public static final String TABLE_SQL_DROP = "drop table PasswordPolicy";
104 public static final String ORDER_BY_JPQL = " ORDER BY passwordPolicy.passwordPolicyId ASC";
105 public static final String ORDER_BY_SQL = " ORDER BY PasswordPolicy.passwordPolicyId ASC";
106 public static final String DATA_SOURCE = "liferayDataSource";
107 public static final String SESSION_FACTORY = "liferaySessionFactory";
108 public static final String TX_MANAGER = "liferayTransactionManager";
109 public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
110 "value.object.entity.cache.enabled.com.liferay.portal.model.PasswordPolicy"),
111 true);
112 public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
113 "value.object.finder.cache.enabled.com.liferay.portal.model.PasswordPolicy"),
114 true);
115 public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
116 "value.object.column.bitmask.enabled.com.liferay.portal.model.PasswordPolicy"),
117 true);
118 public static long COMPANYID_COLUMN_BITMASK = 1L;
119 public static long DEFAULTPOLICY_COLUMN_BITMASK = 2L;
120 public static long NAME_COLUMN_BITMASK = 4L;
121 public static long UUID_COLUMN_BITMASK = 8L;
122 public static long PASSWORDPOLICYID_COLUMN_BITMASK = 16L;
123
124
130 public static PasswordPolicy toModel(PasswordPolicySoap soapModel) {
131 if (soapModel == null) {
132 return null;
133 }
134
135 PasswordPolicy model = new PasswordPolicyImpl();
136
137 model.setUuid(soapModel.getUuid());
138 model.setPasswordPolicyId(soapModel.getPasswordPolicyId());
139 model.setCompanyId(soapModel.getCompanyId());
140 model.setUserId(soapModel.getUserId());
141 model.setUserName(soapModel.getUserName());
142 model.setCreateDate(soapModel.getCreateDate());
143 model.setModifiedDate(soapModel.getModifiedDate());
144 model.setDefaultPolicy(soapModel.getDefaultPolicy());
145 model.setName(soapModel.getName());
146 model.setDescription(soapModel.getDescription());
147 model.setChangeable(soapModel.getChangeable());
148 model.setChangeRequired(soapModel.getChangeRequired());
149 model.setMinAge(soapModel.getMinAge());
150 model.setCheckSyntax(soapModel.getCheckSyntax());
151 model.setAllowDictionaryWords(soapModel.getAllowDictionaryWords());
152 model.setMinAlphanumeric(soapModel.getMinAlphanumeric());
153 model.setMinLength(soapModel.getMinLength());
154 model.setMinLowerCase(soapModel.getMinLowerCase());
155 model.setMinNumbers(soapModel.getMinNumbers());
156 model.setMinSymbols(soapModel.getMinSymbols());
157 model.setMinUpperCase(soapModel.getMinUpperCase());
158 model.setRegex(soapModel.getRegex());
159 model.setHistory(soapModel.getHistory());
160 model.setHistoryCount(soapModel.getHistoryCount());
161 model.setExpireable(soapModel.getExpireable());
162 model.setMaxAge(soapModel.getMaxAge());
163 model.setWarningTime(soapModel.getWarningTime());
164 model.setGraceLimit(soapModel.getGraceLimit());
165 model.setLockout(soapModel.getLockout());
166 model.setMaxFailure(soapModel.getMaxFailure());
167 model.setLockoutDuration(soapModel.getLockoutDuration());
168 model.setRequireUnlock(soapModel.getRequireUnlock());
169 model.setResetFailureCount(soapModel.getResetFailureCount());
170 model.setResetTicketMaxAge(soapModel.getResetTicketMaxAge());
171
172 return model;
173 }
174
175
181 public static List<PasswordPolicy> toModels(PasswordPolicySoap[] soapModels) {
182 if (soapModels == null) {
183 return null;
184 }
185
186 List<PasswordPolicy> models = new ArrayList<PasswordPolicy>(soapModels.length);
187
188 for (PasswordPolicySoap soapModel : soapModels) {
189 models.add(toModel(soapModel));
190 }
191
192 return models;
193 }
194
195 public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
196 "lock.expiration.time.com.liferay.portal.model.PasswordPolicy"));
197
198 public PasswordPolicyModelImpl() {
199 }
200
201 public long getPrimaryKey() {
202 return _passwordPolicyId;
203 }
204
205 public void setPrimaryKey(long primaryKey) {
206 setPasswordPolicyId(primaryKey);
207 }
208
209 public Serializable getPrimaryKeyObj() {
210 return _passwordPolicyId;
211 }
212
213 public void setPrimaryKeyObj(Serializable primaryKeyObj) {
214 setPrimaryKey(((Long)primaryKeyObj).longValue());
215 }
216
217 public Class<?> getModelClass() {
218 return PasswordPolicy.class;
219 }
220
221 public String getModelClassName() {
222 return PasswordPolicy.class.getName();
223 }
224
225 @Override
226 public Map<String, Object> getModelAttributes() {
227 Map<String, Object> attributes = new HashMap<String, Object>();
228
229 attributes.put("uuid", getUuid());
230 attributes.put("passwordPolicyId", getPasswordPolicyId());
231 attributes.put("companyId", getCompanyId());
232 attributes.put("userId", getUserId());
233 attributes.put("userName", getUserName());
234 attributes.put("createDate", getCreateDate());
235 attributes.put("modifiedDate", getModifiedDate());
236 attributes.put("defaultPolicy", getDefaultPolicy());
237 attributes.put("name", getName());
238 attributes.put("description", getDescription());
239 attributes.put("changeable", getChangeable());
240 attributes.put("changeRequired", getChangeRequired());
241 attributes.put("minAge", getMinAge());
242 attributes.put("checkSyntax", getCheckSyntax());
243 attributes.put("allowDictionaryWords", getAllowDictionaryWords());
244 attributes.put("minAlphanumeric", getMinAlphanumeric());
245 attributes.put("minLength", getMinLength());
246 attributes.put("minLowerCase", getMinLowerCase());
247 attributes.put("minNumbers", getMinNumbers());
248 attributes.put("minSymbols", getMinSymbols());
249 attributes.put("minUpperCase", getMinUpperCase());
250 attributes.put("regex", getRegex());
251 attributes.put("history", getHistory());
252 attributes.put("historyCount", getHistoryCount());
253 attributes.put("expireable", getExpireable());
254 attributes.put("maxAge", getMaxAge());
255 attributes.put("warningTime", getWarningTime());
256 attributes.put("graceLimit", getGraceLimit());
257 attributes.put("lockout", getLockout());
258 attributes.put("maxFailure", getMaxFailure());
259 attributes.put("lockoutDuration", getLockoutDuration());
260 attributes.put("requireUnlock", getRequireUnlock());
261 attributes.put("resetFailureCount", getResetFailureCount());
262 attributes.put("resetTicketMaxAge", getResetTicketMaxAge());
263
264 return attributes;
265 }
266
267 @Override
268 public void setModelAttributes(Map<String, Object> attributes) {
269 String uuid = (String)attributes.get("uuid");
270
271 if (uuid != null) {
272 setUuid(uuid);
273 }
274
275 Long passwordPolicyId = (Long)attributes.get("passwordPolicyId");
276
277 if (passwordPolicyId != null) {
278 setPasswordPolicyId(passwordPolicyId);
279 }
280
281 Long companyId = (Long)attributes.get("companyId");
282
283 if (companyId != null) {
284 setCompanyId(companyId);
285 }
286
287 Long userId = (Long)attributes.get("userId");
288
289 if (userId != null) {
290 setUserId(userId);
291 }
292
293 String userName = (String)attributes.get("userName");
294
295 if (userName != null) {
296 setUserName(userName);
297 }
298
299 Date createDate = (Date)attributes.get("createDate");
300
301 if (createDate != null) {
302 setCreateDate(createDate);
303 }
304
305 Date modifiedDate = (Date)attributes.get("modifiedDate");
306
307 if (modifiedDate != null) {
308 setModifiedDate(modifiedDate);
309 }
310
311 Boolean defaultPolicy = (Boolean)attributes.get("defaultPolicy");
312
313 if (defaultPolicy != null) {
314 setDefaultPolicy(defaultPolicy);
315 }
316
317 String name = (String)attributes.get("name");
318
319 if (name != null) {
320 setName(name);
321 }
322
323 String description = (String)attributes.get("description");
324
325 if (description != null) {
326 setDescription(description);
327 }
328
329 Boolean changeable = (Boolean)attributes.get("changeable");
330
331 if (changeable != null) {
332 setChangeable(changeable);
333 }
334
335 Boolean changeRequired = (Boolean)attributes.get("changeRequired");
336
337 if (changeRequired != null) {
338 setChangeRequired(changeRequired);
339 }
340
341 Long minAge = (Long)attributes.get("minAge");
342
343 if (minAge != null) {
344 setMinAge(minAge);
345 }
346
347 Boolean checkSyntax = (Boolean)attributes.get("checkSyntax");
348
349 if (checkSyntax != null) {
350 setCheckSyntax(checkSyntax);
351 }
352
353 Boolean allowDictionaryWords = (Boolean)attributes.get(
354 "allowDictionaryWords");
355
356 if (allowDictionaryWords != null) {
357 setAllowDictionaryWords(allowDictionaryWords);
358 }
359
360 Integer minAlphanumeric = (Integer)attributes.get("minAlphanumeric");
361
362 if (minAlphanumeric != null) {
363 setMinAlphanumeric(minAlphanumeric);
364 }
365
366 Integer minLength = (Integer)attributes.get("minLength");
367
368 if (minLength != null) {
369 setMinLength(minLength);
370 }
371
372 Integer minLowerCase = (Integer)attributes.get("minLowerCase");
373
374 if (minLowerCase != null) {
375 setMinLowerCase(minLowerCase);
376 }
377
378 Integer minNumbers = (Integer)attributes.get("minNumbers");
379
380 if (minNumbers != null) {
381 setMinNumbers(minNumbers);
382 }
383
384 Integer minSymbols = (Integer)attributes.get("minSymbols");
385
386 if (minSymbols != null) {
387 setMinSymbols(minSymbols);
388 }
389
390 Integer minUpperCase = (Integer)attributes.get("minUpperCase");
391
392 if (minUpperCase != null) {
393 setMinUpperCase(minUpperCase);
394 }
395
396 String regex = (String)attributes.get("regex");
397
398 if (regex != null) {
399 setRegex(regex);
400 }
401
402 Boolean history = (Boolean)attributes.get("history");
403
404 if (history != null) {
405 setHistory(history);
406 }
407
408 Integer historyCount = (Integer)attributes.get("historyCount");
409
410 if (historyCount != null) {
411 setHistoryCount(historyCount);
412 }
413
414 Boolean expireable = (Boolean)attributes.get("expireable");
415
416 if (expireable != null) {
417 setExpireable(expireable);
418 }
419
420 Long maxAge = (Long)attributes.get("maxAge");
421
422 if (maxAge != null) {
423 setMaxAge(maxAge);
424 }
425
426 Long warningTime = (Long)attributes.get("warningTime");
427
428 if (warningTime != null) {
429 setWarningTime(warningTime);
430 }
431
432 Integer graceLimit = (Integer)attributes.get("graceLimit");
433
434 if (graceLimit != null) {
435 setGraceLimit(graceLimit);
436 }
437
438 Boolean lockout = (Boolean)attributes.get("lockout");
439
440 if (lockout != null) {
441 setLockout(lockout);
442 }
443
444 Integer maxFailure = (Integer)attributes.get("maxFailure");
445
446 if (maxFailure != null) {
447 setMaxFailure(maxFailure);
448 }
449
450 Long lockoutDuration = (Long)attributes.get("lockoutDuration");
451
452 if (lockoutDuration != null) {
453 setLockoutDuration(lockoutDuration);
454 }
455
456 Boolean requireUnlock = (Boolean)attributes.get("requireUnlock");
457
458 if (requireUnlock != null) {
459 setRequireUnlock(requireUnlock);
460 }
461
462 Long resetFailureCount = (Long)attributes.get("resetFailureCount");
463
464 if (resetFailureCount != null) {
465 setResetFailureCount(resetFailureCount);
466 }
467
468 Long resetTicketMaxAge = (Long)attributes.get("resetTicketMaxAge");
469
470 if (resetTicketMaxAge != null) {
471 setResetTicketMaxAge(resetTicketMaxAge);
472 }
473 }
474
475 @JSON
476 public String getUuid() {
477 if (_uuid == null) {
478 return StringPool.BLANK;
479 }
480 else {
481 return _uuid;
482 }
483 }
484
485 public void setUuid(String uuid) {
486 if (_originalUuid == null) {
487 _originalUuid = _uuid;
488 }
489
490 _uuid = uuid;
491 }
492
493 public String getOriginalUuid() {
494 return GetterUtil.getString(_originalUuid);
495 }
496
497 @JSON
498 public long getPasswordPolicyId() {
499 return _passwordPolicyId;
500 }
501
502 public void setPasswordPolicyId(long passwordPolicyId) {
503 _passwordPolicyId = passwordPolicyId;
504 }
505
506 @JSON
507 public long getCompanyId() {
508 return _companyId;
509 }
510
511 public void setCompanyId(long companyId) {
512 _columnBitmask |= COMPANYID_COLUMN_BITMASK;
513
514 if (!_setOriginalCompanyId) {
515 _setOriginalCompanyId = true;
516
517 _originalCompanyId = _companyId;
518 }
519
520 _companyId = companyId;
521 }
522
523 public long getOriginalCompanyId() {
524 return _originalCompanyId;
525 }
526
527 @JSON
528 public long getUserId() {
529 return _userId;
530 }
531
532 public void setUserId(long userId) {
533 _userId = userId;
534 }
535
536 public String getUserUuid() throws SystemException {
537 return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
538 }
539
540 public void setUserUuid(String userUuid) {
541 _userUuid = userUuid;
542 }
543
544 @JSON
545 public String getUserName() {
546 if (_userName == null) {
547 return StringPool.BLANK;
548 }
549 else {
550 return _userName;
551 }
552 }
553
554 public void setUserName(String userName) {
555 _userName = userName;
556 }
557
558 @JSON
559 public Date getCreateDate() {
560 return _createDate;
561 }
562
563 public void setCreateDate(Date createDate) {
564 _createDate = createDate;
565 }
566
567 @JSON
568 public Date getModifiedDate() {
569 return _modifiedDate;
570 }
571
572 public void setModifiedDate(Date modifiedDate) {
573 _modifiedDate = modifiedDate;
574 }
575
576 @JSON
577 public boolean getDefaultPolicy() {
578 return _defaultPolicy;
579 }
580
581 public boolean isDefaultPolicy() {
582 return _defaultPolicy;
583 }
584
585 public void setDefaultPolicy(boolean defaultPolicy) {
586 _columnBitmask |= DEFAULTPOLICY_COLUMN_BITMASK;
587
588 if (!_setOriginalDefaultPolicy) {
589 _setOriginalDefaultPolicy = true;
590
591 _originalDefaultPolicy = _defaultPolicy;
592 }
593
594 _defaultPolicy = defaultPolicy;
595 }
596
597 public boolean getOriginalDefaultPolicy() {
598 return _originalDefaultPolicy;
599 }
600
601 @JSON
602 public String getName() {
603 if (_name == null) {
604 return StringPool.BLANK;
605 }
606 else {
607 return _name;
608 }
609 }
610
611 public void setName(String name) {
612 _columnBitmask |= NAME_COLUMN_BITMASK;
613
614 if (_originalName == null) {
615 _originalName = _name;
616 }
617
618 _name = name;
619 }
620
621 public String getOriginalName() {
622 return GetterUtil.getString(_originalName);
623 }
624
625 @JSON
626 public String getDescription() {
627 if (_description == null) {
628 return StringPool.BLANK;
629 }
630 else {
631 return _description;
632 }
633 }
634
635 public void setDescription(String description) {
636 _description = description;
637 }
638
639 @JSON
640 public boolean getChangeable() {
641 return _changeable;
642 }
643
644 public boolean isChangeable() {
645 return _changeable;
646 }
647
648 public void setChangeable(boolean changeable) {
649 _changeable = changeable;
650 }
651
652 @JSON
653 public boolean getChangeRequired() {
654 return _changeRequired;
655 }
656
657 public boolean isChangeRequired() {
658 return _changeRequired;
659 }
660
661 public void setChangeRequired(boolean changeRequired) {
662 _changeRequired = changeRequired;
663 }
664
665 @JSON
666 public long getMinAge() {
667 return _minAge;
668 }
669
670 public void setMinAge(long minAge) {
671 _minAge = minAge;
672 }
673
674 @JSON
675 public boolean getCheckSyntax() {
676 return _checkSyntax;
677 }
678
679 public boolean isCheckSyntax() {
680 return _checkSyntax;
681 }
682
683 public void setCheckSyntax(boolean checkSyntax) {
684 _checkSyntax = checkSyntax;
685 }
686
687 @JSON
688 public boolean getAllowDictionaryWords() {
689 return _allowDictionaryWords;
690 }
691
692 public boolean isAllowDictionaryWords() {
693 return _allowDictionaryWords;
694 }
695
696 public void setAllowDictionaryWords(boolean allowDictionaryWords) {
697 _allowDictionaryWords = allowDictionaryWords;
698 }
699
700 @JSON
701 public int getMinAlphanumeric() {
702 return _minAlphanumeric;
703 }
704
705 public void setMinAlphanumeric(int minAlphanumeric) {
706 _minAlphanumeric = minAlphanumeric;
707 }
708
709 @JSON
710 public int getMinLength() {
711 return _minLength;
712 }
713
714 public void setMinLength(int minLength) {
715 _minLength = minLength;
716 }
717
718 @JSON
719 public int getMinLowerCase() {
720 return _minLowerCase;
721 }
722
723 public void setMinLowerCase(int minLowerCase) {
724 _minLowerCase = minLowerCase;
725 }
726
727 @JSON
728 public int getMinNumbers() {
729 return _minNumbers;
730 }
731
732 public void setMinNumbers(int minNumbers) {
733 _minNumbers = minNumbers;
734 }
735
736 @JSON
737 public int getMinSymbols() {
738 return _minSymbols;
739 }
740
741 public void setMinSymbols(int minSymbols) {
742 _minSymbols = minSymbols;
743 }
744
745 @JSON
746 public int getMinUpperCase() {
747 return _minUpperCase;
748 }
749
750 public void setMinUpperCase(int minUpperCase) {
751 _minUpperCase = minUpperCase;
752 }
753
754 @JSON
755 public String getRegex() {
756 if (_regex == null) {
757 return StringPool.BLANK;
758 }
759 else {
760 return _regex;
761 }
762 }
763
764 public void setRegex(String regex) {
765 _regex = regex;
766 }
767
768 @JSON
769 public boolean getHistory() {
770 return _history;
771 }
772
773 public boolean isHistory() {
774 return _history;
775 }
776
777 public void setHistory(boolean history) {
778 _history = history;
779 }
780
781 @JSON
782 public int getHistoryCount() {
783 return _historyCount;
784 }
785
786 public void setHistoryCount(int historyCount) {
787 _historyCount = historyCount;
788 }
789
790 @JSON
791 public boolean getExpireable() {
792 return _expireable;
793 }
794
795 public boolean isExpireable() {
796 return _expireable;
797 }
798
799 public void setExpireable(boolean expireable) {
800 _expireable = expireable;
801 }
802
803 @JSON
804 public long getMaxAge() {
805 return _maxAge;
806 }
807
808 public void setMaxAge(long maxAge) {
809 _maxAge = maxAge;
810 }
811
812 @JSON
813 public long getWarningTime() {
814 return _warningTime;
815 }
816
817 public void setWarningTime(long warningTime) {
818 _warningTime = warningTime;
819 }
820
821 @JSON
822 public int getGraceLimit() {
823 return _graceLimit;
824 }
825
826 public void setGraceLimit(int graceLimit) {
827 _graceLimit = graceLimit;
828 }
829
830 @JSON
831 public boolean getLockout() {
832 return _lockout;
833 }
834
835 public boolean isLockout() {
836 return _lockout;
837 }
838
839 public void setLockout(boolean lockout) {
840 _lockout = lockout;
841 }
842
843 @JSON
844 public int getMaxFailure() {
845 return _maxFailure;
846 }
847
848 public void setMaxFailure(int maxFailure) {
849 _maxFailure = maxFailure;
850 }
851
852 @JSON
853 public long getLockoutDuration() {
854 return _lockoutDuration;
855 }
856
857 public void setLockoutDuration(long lockoutDuration) {
858 _lockoutDuration = lockoutDuration;
859 }
860
861 @JSON
862 public boolean getRequireUnlock() {
863 return _requireUnlock;
864 }
865
866 public boolean isRequireUnlock() {
867 return _requireUnlock;
868 }
869
870 public void setRequireUnlock(boolean requireUnlock) {
871 _requireUnlock = requireUnlock;
872 }
873
874 @JSON
875 public long getResetFailureCount() {
876 return _resetFailureCount;
877 }
878
879 public void setResetFailureCount(long resetFailureCount) {
880 _resetFailureCount = resetFailureCount;
881 }
882
883 @JSON
884 public long getResetTicketMaxAge() {
885 return _resetTicketMaxAge;
886 }
887
888 public void setResetTicketMaxAge(long resetTicketMaxAge) {
889 _resetTicketMaxAge = resetTicketMaxAge;
890 }
891
892 public long getColumnBitmask() {
893 return _columnBitmask;
894 }
895
896 @Override
897 public ExpandoBridge getExpandoBridge() {
898 return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
899 PasswordPolicy.class.getName(), getPrimaryKey());
900 }
901
902 @Override
903 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
904 ExpandoBridge expandoBridge = getExpandoBridge();
905
906 expandoBridge.setAttributes(serviceContext);
907 }
908
909 @Override
910 public PasswordPolicy toEscapedModel() {
911 if (_escapedModel == null) {
912 _escapedModel = (PasswordPolicy)ProxyUtil.newProxyInstance(_classLoader,
913 _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
914 }
915
916 return _escapedModel;
917 }
918
919 @Override
920 public Object clone() {
921 PasswordPolicyImpl passwordPolicyImpl = new PasswordPolicyImpl();
922
923 passwordPolicyImpl.setUuid(getUuid());
924 passwordPolicyImpl.setPasswordPolicyId(getPasswordPolicyId());
925 passwordPolicyImpl.setCompanyId(getCompanyId());
926 passwordPolicyImpl.setUserId(getUserId());
927 passwordPolicyImpl.setUserName(getUserName());
928 passwordPolicyImpl.setCreateDate(getCreateDate());
929 passwordPolicyImpl.setModifiedDate(getModifiedDate());
930 passwordPolicyImpl.setDefaultPolicy(getDefaultPolicy());
931 passwordPolicyImpl.setName(getName());
932 passwordPolicyImpl.setDescription(getDescription());
933 passwordPolicyImpl.setChangeable(getChangeable());
934 passwordPolicyImpl.setChangeRequired(getChangeRequired());
935 passwordPolicyImpl.setMinAge(getMinAge());
936 passwordPolicyImpl.setCheckSyntax(getCheckSyntax());
937 passwordPolicyImpl.setAllowDictionaryWords(getAllowDictionaryWords());
938 passwordPolicyImpl.setMinAlphanumeric(getMinAlphanumeric());
939 passwordPolicyImpl.setMinLength(getMinLength());
940 passwordPolicyImpl.setMinLowerCase(getMinLowerCase());
941 passwordPolicyImpl.setMinNumbers(getMinNumbers());
942 passwordPolicyImpl.setMinSymbols(getMinSymbols());
943 passwordPolicyImpl.setMinUpperCase(getMinUpperCase());
944 passwordPolicyImpl.setRegex(getRegex());
945 passwordPolicyImpl.setHistory(getHistory());
946 passwordPolicyImpl.setHistoryCount(getHistoryCount());
947 passwordPolicyImpl.setExpireable(getExpireable());
948 passwordPolicyImpl.setMaxAge(getMaxAge());
949 passwordPolicyImpl.setWarningTime(getWarningTime());
950 passwordPolicyImpl.setGraceLimit(getGraceLimit());
951 passwordPolicyImpl.setLockout(getLockout());
952 passwordPolicyImpl.setMaxFailure(getMaxFailure());
953 passwordPolicyImpl.setLockoutDuration(getLockoutDuration());
954 passwordPolicyImpl.setRequireUnlock(getRequireUnlock());
955 passwordPolicyImpl.setResetFailureCount(getResetFailureCount());
956 passwordPolicyImpl.setResetTicketMaxAge(getResetTicketMaxAge());
957
958 passwordPolicyImpl.resetOriginalValues();
959
960 return passwordPolicyImpl;
961 }
962
963 public int compareTo(PasswordPolicy passwordPolicy) {
964 long primaryKey = passwordPolicy.getPrimaryKey();
965
966 if (getPrimaryKey() < primaryKey) {
967 return -1;
968 }
969 else if (getPrimaryKey() > primaryKey) {
970 return 1;
971 }
972 else {
973 return 0;
974 }
975 }
976
977 @Override
978 public boolean equals(Object obj) {
979 if (obj == null) {
980 return false;
981 }
982
983 PasswordPolicy passwordPolicy = null;
984
985 try {
986 passwordPolicy = (PasswordPolicy)obj;
987 }
988 catch (ClassCastException cce) {
989 return false;
990 }
991
992 long primaryKey = passwordPolicy.getPrimaryKey();
993
994 if (getPrimaryKey() == primaryKey) {
995 return true;
996 }
997 else {
998 return false;
999 }
1000 }
1001
1002 @Override
1003 public int hashCode() {
1004 return (int)getPrimaryKey();
1005 }
1006
1007 @Override
1008 public void resetOriginalValues() {
1009 PasswordPolicyModelImpl passwordPolicyModelImpl = this;
1010
1011 passwordPolicyModelImpl._originalUuid = passwordPolicyModelImpl._uuid;
1012
1013 passwordPolicyModelImpl._originalCompanyId = passwordPolicyModelImpl._companyId;
1014
1015 passwordPolicyModelImpl._setOriginalCompanyId = false;
1016
1017 passwordPolicyModelImpl._originalDefaultPolicy = passwordPolicyModelImpl._defaultPolicy;
1018
1019 passwordPolicyModelImpl._setOriginalDefaultPolicy = false;
1020
1021 passwordPolicyModelImpl._originalName = passwordPolicyModelImpl._name;
1022
1023 passwordPolicyModelImpl._columnBitmask = 0;
1024 }
1025
1026 @Override
1027 public CacheModel<PasswordPolicy> toCacheModel() {
1028 PasswordPolicyCacheModel passwordPolicyCacheModel = new PasswordPolicyCacheModel();
1029
1030 passwordPolicyCacheModel.uuid = getUuid();
1031
1032 String uuid = passwordPolicyCacheModel.uuid;
1033
1034 if ((uuid != null) && (uuid.length() == 0)) {
1035 passwordPolicyCacheModel.uuid = null;
1036 }
1037
1038 passwordPolicyCacheModel.passwordPolicyId = getPasswordPolicyId();
1039
1040 passwordPolicyCacheModel.companyId = getCompanyId();
1041
1042 passwordPolicyCacheModel.userId = getUserId();
1043
1044 passwordPolicyCacheModel.userName = getUserName();
1045
1046 String userName = passwordPolicyCacheModel.userName;
1047
1048 if ((userName != null) && (userName.length() == 0)) {
1049 passwordPolicyCacheModel.userName = null;
1050 }
1051
1052 Date createDate = getCreateDate();
1053
1054 if (createDate != null) {
1055 passwordPolicyCacheModel.createDate = createDate.getTime();
1056 }
1057 else {
1058 passwordPolicyCacheModel.createDate = Long.MIN_VALUE;
1059 }
1060
1061 Date modifiedDate = getModifiedDate();
1062
1063 if (modifiedDate != null) {
1064 passwordPolicyCacheModel.modifiedDate = modifiedDate.getTime();
1065 }
1066 else {
1067 passwordPolicyCacheModel.modifiedDate = Long.MIN_VALUE;
1068 }
1069
1070 passwordPolicyCacheModel.defaultPolicy = getDefaultPolicy();
1071
1072 passwordPolicyCacheModel.name = getName();
1073
1074 String name = passwordPolicyCacheModel.name;
1075
1076 if ((name != null) && (name.length() == 0)) {
1077 passwordPolicyCacheModel.name = null;
1078 }
1079
1080 passwordPolicyCacheModel.description = getDescription();
1081
1082 String description = passwordPolicyCacheModel.description;
1083
1084 if ((description != null) && (description.length() == 0)) {
1085 passwordPolicyCacheModel.description = null;
1086 }
1087
1088 passwordPolicyCacheModel.changeable = getChangeable();
1089
1090 passwordPolicyCacheModel.changeRequired = getChangeRequired();
1091
1092 passwordPolicyCacheModel.minAge = getMinAge();
1093
1094 passwordPolicyCacheModel.checkSyntax = getCheckSyntax();
1095
1096 passwordPolicyCacheModel.allowDictionaryWords = getAllowDictionaryWords();
1097
1098 passwordPolicyCacheModel.minAlphanumeric = getMinAlphanumeric();
1099
1100 passwordPolicyCacheModel.minLength = getMinLength();
1101
1102 passwordPolicyCacheModel.minLowerCase = getMinLowerCase();
1103
1104 passwordPolicyCacheModel.minNumbers = getMinNumbers();
1105
1106 passwordPolicyCacheModel.minSymbols = getMinSymbols();
1107
1108 passwordPolicyCacheModel.minUpperCase = getMinUpperCase();
1109
1110 passwordPolicyCacheModel.regex = getRegex();
1111
1112 String regex = passwordPolicyCacheModel.regex;
1113
1114 if ((regex != null) && (regex.length() == 0)) {
1115 passwordPolicyCacheModel.regex = null;
1116 }
1117
1118 passwordPolicyCacheModel.history = getHistory();
1119
1120 passwordPolicyCacheModel.historyCount = getHistoryCount();
1121
1122 passwordPolicyCacheModel.expireable = getExpireable();
1123
1124 passwordPolicyCacheModel.maxAge = getMaxAge();
1125
1126 passwordPolicyCacheModel.warningTime = getWarningTime();
1127
1128 passwordPolicyCacheModel.graceLimit = getGraceLimit();
1129
1130 passwordPolicyCacheModel.lockout = getLockout();
1131
1132 passwordPolicyCacheModel.maxFailure = getMaxFailure();
1133
1134 passwordPolicyCacheModel.lockoutDuration = getLockoutDuration();
1135
1136 passwordPolicyCacheModel.requireUnlock = getRequireUnlock();
1137
1138 passwordPolicyCacheModel.resetFailureCount = getResetFailureCount();
1139
1140 passwordPolicyCacheModel.resetTicketMaxAge = getResetTicketMaxAge();
1141
1142 return passwordPolicyCacheModel;
1143 }
1144
1145 @Override
1146 public String toString() {
1147 StringBundler sb = new StringBundler(69);
1148
1149 sb.append("{uuid=");
1150 sb.append(getUuid());
1151 sb.append(", passwordPolicyId=");
1152 sb.append(getPasswordPolicyId());
1153 sb.append(", companyId=");
1154 sb.append(getCompanyId());
1155 sb.append(", userId=");
1156 sb.append(getUserId());
1157 sb.append(", userName=");
1158 sb.append(getUserName());
1159 sb.append(", createDate=");
1160 sb.append(getCreateDate());
1161 sb.append(", modifiedDate=");
1162 sb.append(getModifiedDate());
1163 sb.append(", defaultPolicy=");
1164 sb.append(getDefaultPolicy());
1165 sb.append(", name=");
1166 sb.append(getName());
1167 sb.append(", description=");
1168 sb.append(getDescription());
1169 sb.append(", changeable=");
1170 sb.append(getChangeable());
1171 sb.append(", changeRequired=");
1172 sb.append(getChangeRequired());
1173 sb.append(", minAge=");
1174 sb.append(getMinAge());
1175 sb.append(", checkSyntax=");
1176 sb.append(getCheckSyntax());
1177 sb.append(", allowDictionaryWords=");
1178 sb.append(getAllowDictionaryWords());
1179 sb.append(", minAlphanumeric=");
1180 sb.append(getMinAlphanumeric());
1181 sb.append(", minLength=");
1182 sb.append(getMinLength());
1183 sb.append(", minLowerCase=");
1184 sb.append(getMinLowerCase());
1185 sb.append(", minNumbers=");
1186 sb.append(getMinNumbers());
1187 sb.append(", minSymbols=");
1188 sb.append(getMinSymbols());
1189 sb.append(", minUpperCase=");
1190 sb.append(getMinUpperCase());
1191 sb.append(", regex=");
1192 sb.append(getRegex());
1193 sb.append(", history=");
1194 sb.append(getHistory());
1195 sb.append(", historyCount=");
1196 sb.append(getHistoryCount());
1197 sb.append(", expireable=");
1198 sb.append(getExpireable());
1199 sb.append(", maxAge=");
1200 sb.append(getMaxAge());
1201 sb.append(", warningTime=");
1202 sb.append(getWarningTime());
1203 sb.append(", graceLimit=");
1204 sb.append(getGraceLimit());
1205 sb.append(", lockout=");
1206 sb.append(getLockout());
1207 sb.append(", maxFailure=");
1208 sb.append(getMaxFailure());
1209 sb.append(", lockoutDuration=");
1210 sb.append(getLockoutDuration());
1211 sb.append(", requireUnlock=");
1212 sb.append(getRequireUnlock());
1213 sb.append(", resetFailureCount=");
1214 sb.append(getResetFailureCount());
1215 sb.append(", resetTicketMaxAge=");
1216 sb.append(getResetTicketMaxAge());
1217 sb.append("}");
1218
1219 return sb.toString();
1220 }
1221
1222 public String toXmlString() {
1223 StringBundler sb = new StringBundler(106);
1224
1225 sb.append("<model><model-name>");
1226 sb.append("com.liferay.portal.model.PasswordPolicy");
1227 sb.append("</model-name>");
1228
1229 sb.append(
1230 "<column><column-name>uuid</column-name><column-value><![CDATA[");
1231 sb.append(getUuid());
1232 sb.append("]]></column-value></column>");
1233 sb.append(
1234 "<column><column-name>passwordPolicyId</column-name><column-value><![CDATA[");
1235 sb.append(getPasswordPolicyId());
1236 sb.append("]]></column-value></column>");
1237 sb.append(
1238 "<column><column-name>companyId</column-name><column-value><![CDATA[");
1239 sb.append(getCompanyId());
1240 sb.append("]]></column-value></column>");
1241 sb.append(
1242 "<column><column-name>userId</column-name><column-value><![CDATA[");
1243 sb.append(getUserId());
1244 sb.append("]]></column-value></column>");
1245 sb.append(
1246 "<column><column-name>userName</column-name><column-value><![CDATA[");
1247 sb.append(getUserName());
1248 sb.append("]]></column-value></column>");
1249 sb.append(
1250 "<column><column-name>createDate</column-name><column-value><![CDATA[");
1251 sb.append(getCreateDate());
1252 sb.append("]]></column-value></column>");
1253 sb.append(
1254 "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
1255 sb.append(getModifiedDate());
1256 sb.append("]]></column-value></column>");
1257 sb.append(
1258 "<column><column-name>defaultPolicy</column-name><column-value><![CDATA[");
1259 sb.append(getDefaultPolicy());
1260 sb.append("]]></column-value></column>");
1261 sb.append(
1262 "<column><column-name>name</column-name><column-value><![CDATA[");
1263 sb.append(getName());
1264 sb.append("]]></column-value></column>");
1265 sb.append(
1266 "<column><column-name>description</column-name><column-value><![CDATA[");
1267 sb.append(getDescription());
1268 sb.append("]]></column-value></column>");
1269 sb.append(
1270 "<column><column-name>changeable</column-name><column-value><![CDATA[");
1271 sb.append(getChangeable());
1272 sb.append("]]></column-value></column>");
1273 sb.append(
1274 "<column><column-name>changeRequired</column-name><column-value><![CDATA[");
1275 sb.append(getChangeRequired());
1276 sb.append("]]></column-value></column>");
1277 sb.append(
1278 "<column><column-name>minAge</column-name><column-value><![CDATA[");
1279 sb.append(getMinAge());
1280 sb.append("]]></column-value></column>");
1281 sb.append(
1282 "<column><column-name>checkSyntax</column-name><column-value><![CDATA[");
1283 sb.append(getCheckSyntax());
1284 sb.append("]]></column-value></column>");
1285 sb.append(
1286 "<column><column-name>allowDictionaryWords</column-name><column-value><![CDATA[");
1287 sb.append(getAllowDictionaryWords());
1288 sb.append("]]></column-value></column>");
1289 sb.append(
1290 "<column><column-name>minAlphanumeric</column-name><column-value><![CDATA[");
1291 sb.append(getMinAlphanumeric());
1292 sb.append("]]></column-value></column>");
1293 sb.append(
1294 "<column><column-name>minLength</column-name><column-value><![CDATA[");
1295 sb.append(getMinLength());
1296 sb.append("]]></column-value></column>");
1297 sb.append(
1298 "<column><column-name>minLowerCase</column-name><column-value><![CDATA[");
1299 sb.append(getMinLowerCase());
1300 sb.append("]]></column-value></column>");
1301 sb.append(
1302 "<column><column-name>minNumbers</column-name><column-value><![CDATA[");
1303 sb.append(getMinNumbers());
1304 sb.append("]]></column-value></column>");
1305 sb.append(
1306 "<column><column-name>minSymbols</column-name><column-value><![CDATA[");
1307 sb.append(getMinSymbols());
1308 sb.append("]]></column-value></column>");
1309 sb.append(
1310 "<column><column-name>minUpperCase</column-name><column-value><![CDATA[");
1311 sb.append(getMinUpperCase());
1312 sb.append("]]></column-value></column>");
1313 sb.append(
1314 "<column><column-name>regex</column-name><column-value><![CDATA[");
1315 sb.append(getRegex());
1316 sb.append("]]></column-value></column>");
1317 sb.append(
1318 "<column><column-name>history</column-name><column-value><![CDATA[");
1319 sb.append(getHistory());
1320 sb.append("]]></column-value></column>");
1321 sb.append(
1322 "<column><column-name>historyCount</column-name><column-value><![CDATA[");
1323 sb.append(getHistoryCount());
1324 sb.append("]]></column-value></column>");
1325 sb.append(
1326 "<column><column-name>expireable</column-name><column-value><![CDATA[");
1327 sb.append(getExpireable());
1328 sb.append("]]></column-value></column>");
1329 sb.append(
1330 "<column><column-name>maxAge</column-name><column-value><![CDATA[");
1331 sb.append(getMaxAge());
1332 sb.append("]]></column-value></column>");
1333 sb.append(
1334 "<column><column-name>warningTime</column-name><column-value><![CDATA[");
1335 sb.append(getWarningTime());
1336 sb.append("]]></column-value></column>");
1337 sb.append(
1338 "<column><column-name>graceLimit</column-name><column-value><![CDATA[");
1339 sb.append(getGraceLimit());
1340 sb.append("]]></column-value></column>");
1341 sb.append(
1342 "<column><column-name>lockout</column-name><column-value><![CDATA[");
1343 sb.append(getLockout());
1344 sb.append("]]></column-value></column>");
1345 sb.append(
1346 "<column><column-name>maxFailure</column-name><column-value><![CDATA[");
1347 sb.append(getMaxFailure());
1348 sb.append("]]></column-value></column>");
1349 sb.append(
1350 "<column><column-name>lockoutDuration</column-name><column-value><![CDATA[");
1351 sb.append(getLockoutDuration());
1352 sb.append("]]></column-value></column>");
1353 sb.append(
1354 "<column><column-name>requireUnlock</column-name><column-value><![CDATA[");
1355 sb.append(getRequireUnlock());
1356 sb.append("]]></column-value></column>");
1357 sb.append(
1358 "<column><column-name>resetFailureCount</column-name><column-value><![CDATA[");
1359 sb.append(getResetFailureCount());
1360 sb.append("]]></column-value></column>");
1361 sb.append(
1362 "<column><column-name>resetTicketMaxAge</column-name><column-value><![CDATA[");
1363 sb.append(getResetTicketMaxAge());
1364 sb.append("]]></column-value></column>");
1365
1366 sb.append("</model>");
1367
1368 return sb.toString();
1369 }
1370
1371 private static ClassLoader _classLoader = PasswordPolicy.class.getClassLoader();
1372 private static Class<?>[] _escapedModelInterfaces = new Class[] {
1373 PasswordPolicy.class
1374 };
1375 private String _uuid;
1376 private String _originalUuid;
1377 private long _passwordPolicyId;
1378 private long _companyId;
1379 private long _originalCompanyId;
1380 private boolean _setOriginalCompanyId;
1381 private long _userId;
1382 private String _userUuid;
1383 private String _userName;
1384 private Date _createDate;
1385 private Date _modifiedDate;
1386 private boolean _defaultPolicy;
1387 private boolean _originalDefaultPolicy;
1388 private boolean _setOriginalDefaultPolicy;
1389 private String _name;
1390 private String _originalName;
1391 private String _description;
1392 private boolean _changeable;
1393 private boolean _changeRequired;
1394 private long _minAge;
1395 private boolean _checkSyntax;
1396 private boolean _allowDictionaryWords;
1397 private int _minAlphanumeric;
1398 private int _minLength;
1399 private int _minLowerCase;
1400 private int _minNumbers;
1401 private int _minSymbols;
1402 private int _minUpperCase;
1403 private String _regex;
1404 private boolean _history;
1405 private int _historyCount;
1406 private boolean _expireable;
1407 private long _maxAge;
1408 private long _warningTime;
1409 private int _graceLimit;
1410 private boolean _lockout;
1411 private int _maxFailure;
1412 private long _lockoutDuration;
1413 private boolean _requireUnlock;
1414 private long _resetFailureCount;
1415 private long _resetTicketMaxAge;
1416 private long _columnBitmask;
1417 private PasswordPolicy _escapedModel;
1418 }