View Javadoc

1   package org.lsst.ccs.config;
2   
3   import org.lsst.ccs.bus.Status;
4   
5   /**
6    * A specific status object that advertises a startup code and tells which
7    * data my be required (optionnal).
8    * The key value is the address of the sender which is the temporary name of the startup code
9    * based on MacAddress.
10   * @author bamade
11   */
12  // Date: 26/06/12
13  
14  public class BootStatus  extends Status {
15      private static final long serialVersionUID = 7863579144910513796L;
16      private DeploymentDescriptor optionalDescriptor ;
17      private String requestedSubsystem;
18      private String requestedConfiguration ;
19      private String requestedTag ;
20      /**
21       * used to tell server that this is not a "normal" operation.
22       * The database server may decide not to handle this message and let a dummy test server handle it.
23       */
24      private boolean inTestContext ;
25  
26      public BootStatus() {
27      }
28  
29      public BootStatus(String requestedSubsystem, String requestedConfiguration, String requestedTag) {
30          this.requestedSubsystem = requestedSubsystem;
31          this.requestedConfiguration = requestedConfiguration;
32          this.requestedTag = requestedTag;
33      }
34  
35      public DeploymentDescriptor getOptionalDescriptor() {
36          return optionalDescriptor;
37      }
38  
39      public void setOptionalDescriptor(DeploymentDescriptor optionalDescriptor) {
40          this.optionalDescriptor = optionalDescriptor;
41      }
42  
43      public String getRequestedSubsystem() {
44          return requestedSubsystem;
45      }
46  
47      public void setRequestedSubsystem(String requestedSubsystem) {
48          this.requestedSubsystem = requestedSubsystem;
49      }
50  
51      public String getRequestedConfiguration() {
52          return requestedConfiguration;
53      }
54  
55      public void setRequestedConfiguration(String requestedConfiguration) {
56          this.requestedConfiguration = requestedConfiguration;
57      }
58  
59      public String getRequestedTag() {
60          return requestedTag;
61      }
62  
63      public void setRequestedTag(String requestedTag) {
64          this.requestedTag = requestedTag;
65      }
66  
67      public boolean isInTestContext() {
68          return inTestContext;
69      }
70  
71      public void setInTestContext(boolean inTestContext) {
72          this.inTestContext = inTestContext;
73      }
74  
75      @Override
76      public String getMessageType() {
77          return "lsst.bootStatus";
78      }
79  
80      public String toString() {
81          return super.toString() + String.format("%s_%s_%s", this.requestedSubsystem!= null? requestedSubsystem:"",
82                  this.requestedConfiguration != null? requestedConfiguration : "" ,
83                  this.requestedTag != null? requestedTag : ""
84                  ) ;
85      }
86  }