001
014
015 package com.liferay.portal.kernel.exception;
016
017
021 public class RequiredGroupException extends PortalException {
022
023 @Deprecated
024 public static final int CURRENT_GROUP = 3;
025
026 @Deprecated
027 public static final int PARENT_GROUP = 2;
028
029 @Deprecated
030 public static final int SYSTEM_GROUP = 1;
031
032
035 @Deprecated
036 public int getType() {
037 return _type;
038 }
039
040 public static class MustNotDeleteCurrentGroup
041 extends RequiredGroupException {
042
043 public MustNotDeleteCurrentGroup(long groupId) {
044 super(
045 String.format(
046 "Site %s cannot be deleted because it is currently being " +
047 "accessed",
048 groupId),
049 CURRENT_GROUP);
050
051 this.groupId = groupId;
052 }
053
054 public long groupId;
055
056 }
057
058 public static class MustNotDeleteGroupThatHasChild
059 extends RequiredGroupException {
060
061 public MustNotDeleteGroupThatHasChild(long groupId) {
062 super(
063 String.format(
064 "Site %s cannot be deleted because it has child sites",
065 groupId),
066 PARENT_GROUP);
067
068 this.groupId = groupId;
069 }
070
071 public long groupId;
072
073 }
074
075 public static class MustNotDeleteSystemGroup
076 extends RequiredGroupException {
077
078 public MustNotDeleteSystemGroup(long groupId) {
079 super(
080 String.format(
081 "Site %s cannot be deleted because it is a system " +
082 "required site",
083 groupId),
084 SYSTEM_GROUP);
085
086 this.groupId = groupId;
087 }
088
089 public long groupId;
090
091 }
092
093 private RequiredGroupException(String message, int type) {
094 super(message);
095
096 _type = type;
097 }
098
099 private final int _type;
100
101 }