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