コード例 #1
0
  public OpenstackSession() {

    // calculate the bitmap
    for (Feature f : Feature.class.getEnumConstants()) {
      if (f.isEnabled()) {
        features = features | f.mask();
      }
    }

    computeConfig = new OpenStackComputeConfig();

    identityConfig = new OpenStackIdentityConfig();

    imageConfig = new OpenStackImageConfig();
  }
コード例 #2
0
 public OpenstackSession disable(Feature feature) {
   features = features & ~feature.mask();
   return this;
 }
コード例 #3
0
 public OpenstackSession enable(Feature feature) {
   features = features | feature.mask();
   return this;
 }
コード例 #4
0
 public OpenstackSession without(Feature... features) {
   for (Feature feature : features) {
     this.features = this.features & ~feature.mask();
   }
   return this;
 }
コード例 #5
0
 public boolean isEnabled(Feature feature) {
   return (features & feature.mask()) == 1;
 }