001
014
015 package com.liferay.portal.kernel.exception;
016
017
021 public class GroupParentException extends PortalException {
022
023 @Deprecated
024 public static final int CHILD_DESCENDANT = 3;
025
026 @Deprecated
027 public static final int SELF_DESCENDANT = 1;
028
029 @Deprecated
030 public static final int STAGING_DESCENDANT = 2;
031
032
035 @Deprecated
036 public GroupParentException() {
037 _type = 0;
038 }
039
040
043 @Deprecated
044 public GroupParentException(int type) {
045 _type = type;
046 }
047
048
051 @Deprecated
052 public GroupParentException(String msg) {
053 super(msg);
054
055 _type = 0;
056 }
057
058
061 @Deprecated
062 public GroupParentException(String msg, Throwable cause) {
063 super(msg, cause);
064
065 _type = 0;
066 }
067
068
071 @Deprecated
072 public GroupParentException(Throwable cause) {
073 super(cause);
074
075 _type = 0;
076 }
077
078
081 @Deprecated
082 public int getType() {
083 return _type;
084 }
085
086 public static class MustNotBeOwnParent extends GroupParentException {
087
088 public MustNotBeOwnParent(long groupId) {
089 super(
090 String.format(
091 "Site %s cannot be its own parent site",
092 groupId),
093 SELF_DESCENDANT);
094
095 this.groupId = groupId;
096 }
097
098 public long groupId;
099
100 }
101
102 public static class MustNotHaveChildParent extends GroupParentException {
103
104 public MustNotHaveChildParent(long groupId, long parentGroupId) {
105 super(
106 String.format(
107 "Site %s cannot have a child site %s as its parent site",
108 groupId, parentGroupId),
109 CHILD_DESCENDANT);
110
111 this.groupId = groupId;
112 this.parentGroupId = parentGroupId;
113 }
114
115 public long groupId;
116 public long parentGroupId;
117
118 }
119
120 public static class MustNotHaveStagingParent extends GroupParentException {
121
122 public MustNotHaveStagingParent(long groupId, long parentGroupId) {
123 super(
124 String.format(
125 "Site %s cannot have a staging site %s as its parent site",
126 groupId, parentGroupId),
127 STAGING_DESCENDANT);
128
129 this.groupId = groupId;
130 this.parentGroupId = parentGroupId;
131 }
132
133 public long groupId;
134 public long parentGroupId;
135
136 }
137
138 private GroupParentException(String message, int type) {
139 super(message);
140
141 _type = type;
142 }
143
144 private final int _type;
145
146 }