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