View Javadoc

1   /*
2    * Copyright 2010 Fraunhofer Gesellschaft, Munich, Germany,
3    * for its Fraunhofer Institute for Computer Architecture and Software
4    * Technology (FIRST), Berlin, Germany. All rights reserved.
5    * http://www.first.fraunhofer.de/
6    */
7   package net.kwfgrid.gworkflowdl.protocol.calls;
8   
9   import net.kwfgrid.gworkflowdl.protocol.structure.*;
10  
11  import java.io.IOException;
12  
13  import org.xmlpull.v1.XmlSerializer;
14  
15  /***
16     Modification that sets the ID of a token.
17   */
18  public class TokenSetID extends AbstractMethodCall {
19      protected String _ID;
20      protected ProtocolToken _token;
21  
22      public TokenSetID(ProtocolToken token, String ID) {
23  	super(token.getRoot());
24  	_ID = ID;
25  	_token = token;
26      }
27  
28      public void marshal(IMethodCallMarshaller encoder, XmlSerializer serializer) throws IOException {
29  	encoder.marshalTokenSetID(serializer, _token, _ID);
30      }
31  
32      public Object execute() {
33  	_token.__setID(_ID);
34  	setExecuted();
35  	return null;
36      }
37  }