1 /*
2  * Copyright 2002-2011 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package org.springframework.cache.interceptor;
18 
19 /**
20  * Class describing a cache 'evict' operation.
21  *
22  * @author Costin Leau
23  * @since 3.1
24  */
25 public class CacheEvictOperation extends CacheOperation {
26 
27 	private boolean cacheWide = false;
28 	private boolean beforeInvocation = false;
29 
setCacheWide(boolean cacheWide)30 	public void setCacheWide(boolean cacheWide) {
31 		this.cacheWide = cacheWide;
32 	}
33 
isCacheWide()34 	public boolean isCacheWide() {
35 		return this.cacheWide;
36 	}
37 
setBeforeInvocation(boolean beforeInvocation)38 	public void setBeforeInvocation(boolean beforeInvocation) {
39 		this.beforeInvocation = beforeInvocation;
40 	}
41 
isBeforeInvocation()42 	public boolean isBeforeInvocation() {
43 		return this.beforeInvocation;
44 	}
45 
46 	@Override
getOperationDescription()47 	protected StringBuilder getOperationDescription() {
48 		StringBuilder sb = super.getOperationDescription();
49 		sb.append(",");
50 		sb.append(this.cacheWide);
51 		sb.append(",");
52 		sb.append(this.beforeInvocation);
53 		return sb;
54 	}
55 }
56