Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 72c90c33dd27033973972a437752267a7b943ef8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*******************************************************************************
 * Copyright (c) 2013 Atos
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Arthur Daussy - initial implementation
 *******************************************************************************/
package org.eclipse.papyrus.team.collaborative.strategy;

import java.util.Collection;
import java.util.Set;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.team.collaborative.IExtendedURI;


/**
 * The Interface ILockingStrategy.
 * A locking strategy is used to build a set of business object using the defined strategy
 */
public interface ILockingStrategy {

	/**
	 * Get the business object define by this strategy
	 * 
	 * @param eOjbect
	 *        the e ojbect
	 * @return the object to lock
	 */
	Set<IExtendedURI> getBusinessObject(Collection<EObject> eOjbect);

	/**
	 * Return true if this strategy apply on the selected objects
	 * 
	 * @param target
	 *        the target
	 * @return true, if successful
	 */
	public boolean applyOn(Collection<EObject> target);

	/**
	 * The Class Descriptor.
	 */
	public class Descriptor {

		/** The strategy. */
		private ILockingStrategy strategy;

		/** The name. */
		private String name;


		/**
		 * Gets the strategy.
		 * 
		 * @return the strategy
		 */
		public ILockingStrategy getStrategy() {
			return strategy;
		}


		/**
		 * Gets the name.
		 * 
		 * @return the name
		 */
		public String getName() {
			return name;
		}


		/**
		 * Instantiates a new descriptor.
		 * 
		 * @param strategy
		 *        the strategy
		 * @param name
		 *        the name
		 */
		public Descriptor(ILockingStrategy strategy, String name) {
			super();
			this.strategy = strategy;
			this.name = name;
		}





	}

}

Back to the top