1 package fr.in2p3.jsaga.impl.resource.instance;
2
3 import java.util.Properties;
4
5 import fr.in2p3.jsaga.adaptor.resource.ResourceAdaptor;
6 import fr.in2p3.jsaga.adaptor.resource.compute.ComputeResourceAdaptor;
7 import fr.in2p3.jsaga.impl.resource.description.ComputeDescriptionImpl;
8 import fr.in2p3.jsaga.impl.resource.manager.ResourceManagerImpl;
9
10 import org.ogf.saga.error.AuthenticationFailedException;
11 import org.ogf.saga.error.AuthorizationFailedException;
12 import org.ogf.saga.error.BadParameterException;
13 import org.ogf.saga.error.DoesNotExistException;
14 import org.ogf.saga.error.IncorrectStateException;
15 import org.ogf.saga.error.NoSuccessException;
16 import org.ogf.saga.error.NotImplementedException;
17 import org.ogf.saga.error.PermissionDeniedException;
18 import org.ogf.saga.error.TimeoutException;
19 import org.ogf.saga.resource.Type;
20 import org.ogf.saga.resource.description.ComputeDescription;
21 import org.ogf.saga.resource.instance.Compute;
22 import org.ogf.saga.session.Session;
23
24
25
26
27
28 public class ComputeImpl extends AbstractResourceImpl<Compute,ComputeDescription> implements Compute {
29
30
31
32
33
34
35
36
37
38
39 public ComputeImpl(Session session, ResourceManagerImpl manager, ResourceAdaptor adaptor, ComputeDescription description) throws NotImplementedException, AuthenticationFailedException, AuthorizationFailedException, PermissionDeniedException, TimeoutException, NoSuccessException, IncorrectStateException, DoesNotExistException, BadParameterException {
40 super(Type.COMPUTE, session, manager, adaptor, description);
41 }
42
43
44
45
46
47
48
49 public ComputeImpl(Session session, ResourceManagerImpl manager, ResourceAdaptor adaptor, String id) throws DoesNotExistException, TimeoutException, NoSuccessException, NotImplementedException, BadParameterException {
50 super(Type.COMPUTE, session, manager, adaptor, id);
51 }
52
53 public void release(boolean drain) throws DoesNotExistException, NotImplementedException, NoSuccessException, IncorrectStateException {
54 ((ComputeResourceAdaptor)m_adaptor).release(this.getId(), drain);
55 }
56
57 @Override
58 protected ComputeDescription createDescription(Properties description) {
59 return new ComputeDescriptionImpl(description);
60 }
61 }