| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.r2.core.comment.service; |
| 17 | |
|
| 18 | |
import org.kuali.rice.core.api.criteria.QueryByCriteria; |
| 19 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
| 20 | |
import org.kuali.student.r2.common.dto.StatusInfo; |
| 21 | |
import org.kuali.student.r2.common.dto.ValidationResultInfo; |
| 22 | |
import org.kuali.student.r2.common.exceptions.AlreadyExistsException; |
| 23 | |
import org.kuali.student.r2.common.exceptions.DataValidationErrorException; |
| 24 | |
import org.kuali.student.r2.common.exceptions.DoesNotExistException; |
| 25 | |
import org.kuali.student.r2.common.exceptions.InvalidParameterException; |
| 26 | |
import org.kuali.student.r2.common.exceptions.MissingParameterException; |
| 27 | |
import org.kuali.student.r2.common.exceptions.OperationFailedException; |
| 28 | |
import org.kuali.student.r2.common.exceptions.PermissionDeniedException; |
| 29 | |
import org.kuali.student.r2.common.exceptions.ReadOnlyException; |
| 30 | |
import org.kuali.student.r2.common.exceptions.VersionMismatchException; |
| 31 | |
import org.kuali.student.r2.core.comment.dto.CommentInfo; |
| 32 | |
import org.kuali.student.r2.core.comment.dto.TagInfo; |
| 33 | |
|
| 34 | |
import java.util.List; |
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | 0 | public class CommentServiceDecorator implements CommentService { |
| 44 | |
|
| 45 | |
private CommentService nextDecorator; |
| 46 | |
|
| 47 | |
public CommentService getNextDecorator() throws OperationFailedException { |
| 48 | 0 | if (null == nextDecorator) { |
| 49 | 0 | throw new OperationFailedException("Misconfigured application: nextDecorator is null"); |
| 50 | |
} |
| 51 | 0 | return nextDecorator; |
| 52 | |
} |
| 53 | |
|
| 54 | |
public void setNextDecorator(CommentService nextDecorator) { |
| 55 | 0 | this.nextDecorator = nextDecorator; |
| 56 | 0 | } |
| 57 | |
|
| 58 | |
@Override |
| 59 | |
public CommentInfo getComment(String commentId, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 60 | 0 | return getNextDecorator().getComment(commentId, contextInfo); |
| 61 | |
} |
| 62 | |
|
| 63 | |
@Override |
| 64 | |
public List<CommentInfo> getCommentsByReferenceAndType(String referenceId, String referenceTypeKey, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 65 | 0 | return getNextDecorator().getCommentsByReferenceAndType(referenceId, referenceTypeKey, contextInfo); |
| 66 | |
} |
| 67 | |
|
| 68 | |
@Override |
| 69 | |
public List<CommentInfo> getCommentsByIds(List<String> commentIds, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 70 | 0 | return getNextDecorator().getCommentsByIds(commentIds, contextInfo); |
| 71 | |
} |
| 72 | |
|
| 73 | |
@Override |
| 74 | |
public List<String> getCommentIdsByType(String commentTypeKey, ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 75 | 0 | return getNextDecorator().getCommentIdsByType(commentTypeKey, contextInfo); |
| 76 | |
} |
| 77 | |
|
| 78 | |
@Override |
| 79 | |
public List<String> searchForCommentIds(QueryByCriteria criteria, ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 80 | 0 | return getNextDecorator().searchForCommentIds(criteria, contextInfo); |
| 81 | |
} |
| 82 | |
|
| 83 | |
@Override |
| 84 | |
public List<CommentInfo> searchForComments(QueryByCriteria criteria, ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 85 | 0 | return getNextDecorator().searchForComments(criteria, contextInfo); |
| 86 | |
} |
| 87 | |
|
| 88 | |
@Override |
| 89 | |
public CommentInfo createComment(String referenceId, String referenceTypeKey, String commentTypeKey, CommentInfo commentInfo, ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException { |
| 90 | 0 | return getNextDecorator().createComment(referenceId, referenceTypeKey, commentTypeKey, commentInfo, contextInfo); |
| 91 | |
} |
| 92 | |
|
| 93 | |
@Override |
| 94 | |
public CommentInfo updateComment(String commentId, CommentInfo commentInfo, ContextInfo contextInfo) throws DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DoesNotExistException, VersionMismatchException, ReadOnlyException { |
| 95 | 0 | return getNextDecorator().updateComment(commentId, commentInfo, contextInfo); |
| 96 | |
} |
| 97 | |
|
| 98 | |
@Override |
| 99 | |
public StatusInfo deleteComment(String commentId, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 100 | 0 | return getNextDecorator().deleteComment(commentId, contextInfo); |
| 101 | |
} |
| 102 | |
|
| 103 | |
@Override |
| 104 | |
public StatusInfo deleteCommentsByReference(String referenceId, String referenceTypeKey, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 105 | 0 | return getNextDecorator().deleteCommentsByReference(referenceId, referenceTypeKey, contextInfo); |
| 106 | |
} |
| 107 | |
|
| 108 | |
@Override |
| 109 | |
public List<ValidationResultInfo> validateComment(String validationTypeKey, CommentInfo commentInfo, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
| 110 | 0 | return getNextDecorator().validateComment(validationTypeKey, commentInfo, contextInfo); |
| 111 | |
} |
| 112 | |
|
| 113 | |
@Override |
| 114 | |
public List<TagInfo> getTagsByReferenceAndType(String referenceId, String referenceTypeKey, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 115 | 0 | return getNextDecorator().getTagsByReferenceAndType(referenceId, referenceTypeKey, contextInfo); |
| 116 | |
} |
| 117 | |
|
| 118 | |
@Override |
| 119 | |
public TagInfo getTag(String tagId, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 120 | 0 | return getNextDecorator().getTag(tagId, contextInfo); |
| 121 | |
} |
| 122 | |
|
| 123 | |
@Override |
| 124 | |
public List<TagInfo> getTagsByIds(List<String> tagIds, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 125 | 0 | return getNextDecorator().getTagsByIds(tagIds, contextInfo); |
| 126 | |
} |
| 127 | |
|
| 128 | |
@Override |
| 129 | |
public List<String> getTagIdsByType(String tagTypeKey, ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 130 | 0 | return getNextDecorator().getTagIdsByType(tagTypeKey, contextInfo); |
| 131 | |
} |
| 132 | |
|
| 133 | |
@Override |
| 134 | |
public List<String> searchForTagIds(QueryByCriteria criteria, ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 135 | 0 | return getNextDecorator().searchForTagIds(criteria, contextInfo); |
| 136 | |
} |
| 137 | |
|
| 138 | |
@Override |
| 139 | |
public List<TagInfo> searchForTags(QueryByCriteria criteria, ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 140 | 0 | return getNextDecorator().searchForTags(criteria, contextInfo); |
| 141 | |
} |
| 142 | |
|
| 143 | |
@Override |
| 144 | |
public TagInfo createTag(String referenceId, String referenceTypeKey, TagInfo tagInfo, ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, AlreadyExistsException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException { |
| 145 | 0 | return getNextDecorator().createTag(referenceId, referenceTypeKey, tagInfo, contextInfo); |
| 146 | |
} |
| 147 | |
|
| 148 | |
@Override |
| 149 | |
public StatusInfo deleteTagsByReference(String referenceId, String referenceTypeKey, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 150 | 0 | return getNextDecorator().deleteTagsByReference(referenceId, referenceTypeKey, contextInfo); |
| 151 | |
} |
| 152 | |
|
| 153 | |
@Override |
| 154 | |
public StatusInfo deleteTag(String tagId, ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
| 155 | 0 | return getNextDecorator().deleteTag(tagId, contextInfo); |
| 156 | |
} |
| 157 | |
|
| 158 | |
} |