View Javadoc

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   * *** Centre de Calcul de l'IN2P3 - Lyon (France) ***
26   * ***             http://cc.in2p3.fr/             ***
27   * ***************************************************/
28  public class ComputeImpl extends AbstractResourceImpl<Compute,ComputeDescription> implements Compute {
29      /** constructor for resource acquisition 
30       * @throws DoesNotExistException 
31       * @throws IncorrectStateException 
32       * @throws NoSuccessException 
33       * @throws TimeoutException 
34       * @throws PermissionDeniedException 
35       * @throws AuthorizationFailedException 
36       * @throws AuthenticationFailedException 
37       * @throws NotImplementedException 
38       * @throws BadParameterException */
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      /** constructor for reconnecting to resource already acquired 
44       * @throws DoesNotExistException 
45       * @throws NoSuccessException 
46       * @throws TimeoutException 
47       * @throws NotImplementedException 
48       * @throws BadParameterException */
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  }