brooklyn.entity.basic.Entities.sanitize()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中brooklyn.entity.basic.Entities.sanitize()方法的一些代码示例,展示了Entities.sanitize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entities.sanitize()方法的具体详情如下:
包路径:brooklyn.entity.basic.Entities
类名称:Entities
方法名:sanitize

Entities.sanitize介绍

暂无

代码示例

代码示例来源:origin: io.brooklyn/brooklyn-core

@Override
public String toString() {
  return super.toString()+"[own="+Entities.sanitize(ownConfig)+"; inherited="+Entities.sanitize(inheritedConfig)+"]";
}

代码示例来源:origin: io.brooklyn/brooklyn-core

@Override
public String toString() {
  return super.toString()+"[own="+Entities.sanitize(ownConfig)+"]";
}

代码示例来源:origin: io.brooklyn/brooklyn-locations-jclouds

protected static String getDeprecatedProperty(ConfigBag conf, String key) {
  if (conf.containsKey(key)) {
    LOG.warn("Jclouds using deprecated brooklyn-jclouds property "+key+": "+Entities.sanitize(conf.getAllConfig()));
    return (String) conf.getStringKey(key);
  } else {
    return null;
  }
}

代码示例来源:origin: io.brooklyn/brooklyn-core

@Override
public void reconstruct(RebindContext rebindContext, PolicyMemento memento) {
  if (LOG.isTraceEnabled()) LOG.trace("Reconstructing policy {}({}): displayName={}; flags={}; " +
      "customProperties={}",
      new Object[] {memento.getType(), memento.getId(), memento.getDisplayName(),  
      sanitize(memento.getFlags()), sanitize(memento.getCustomFields())});
  // Note that the flags have been set in the constructor
  policy.setName(memento.getDisplayName());
  
  doReconsruct(rebindContext, memento);
}

代码示例来源:origin: io.brooklyn/brooklyn-core

protected PolicyMemento getMementoWithProperties(Map<String,?> props) {
  PolicyMemento memento = MementosGenerators.newPolicyMementoBuilder(policy).customFields(props).build();
  if (LOG.isTraceEnabled()) LOG.trace("Creating memento for policy {}({}): displayName={}; flags={}; " +
      "customProperties={}; ",
      new Object[] {memento.getType(), memento.getId(), memento.getDisplayName(),  
      sanitize(memento.getFlags()), sanitize(memento.getCustomFields())});
  return memento;
}

代码示例来源:origin: io.brooklyn/brooklyn-core

protected EntityMemento getMementoWithProperties(Map<String,?> props) {
  EntityMemento memento = MementosGenerators.newEntityMementoBuilder(entity).customFields(props).build();
  if (LOG.isTraceEnabled()) LOG.trace("Creating memento for entity {}({}): parent={}; children={}; locations={}; "+
      "policies={}; members={}; config={}; attributes={}; entityReferenceConfigs={}; " +
      "entityReferenceAttributes={}; customProperties={}", 
      new Object[] {memento.getType(), memento.getId(), memento.getParent(), memento.getChildren(), 
      memento.getLocations(), memento.getPolicies(), memento.getMembers(), sanitize(memento.getConfig()), 
      sanitize(memento.getAttributes()), memento.getEntityReferenceConfigs(), 
      memento.getEntityReferenceAttributes(), sanitize(memento.getCustomFields())});
  return memento;
}

代码示例来源:origin: io.brooklyn/brooklyn-core

protected LocationMemento getMementoWithProperties(Map<String,?> props) {
  LocationMemento memento = MementosGenerators.newLocationMementoBuilder(location).customFields(props).build();
  if (LOG.isTraceEnabled()) LOG.trace("Creating memento for location {}({}): displayName={}; parent={}; children={}; "+
      "locationConfig={}; locationConfigDescription={}; customProperties={}; ",
      new Object[] {memento.getType(), memento.getId(), memento.getDisplayName(), memento.getParent(), 
      memento.getChildren(), sanitize(memento.getLocationConfig()), memento.getLocationConfigDescription(), 
      sanitize(memento.getCustomFields())});
  return memento;
}

代码示例来源:origin: io.brooklyn/brooklyn-core

protected void startInLocation(final MachineProvisioningLocation<?> location) {
  final Map<String,Object> flags = obtainProvisioningFlags(location);
  if (!(location instanceof LocalhostMachineProvisioningLocation))
    log.info("Starting {}, obtaining a new location instance in {} with ports {}", new Object[] {this, location, flags.get("inboundPorts")});
  setAttribute(PROVISIONING_LOCATION, location);
  MachineLocation machine;
  try {
    machine = Tasks.withBlockingDetails("Provisioning machine in "+location, new Callable<MachineLocation>() {
      public MachineLocation call() throws NoMachinesAvailableException {
        return location.obtain(flags);
      }});
    if (machine == null) throw new NoMachinesAvailableException("Failed to obtain machine in "+location.toString());
  } catch (Exception e) {
    throw Exceptions.propagate(e);
  }
  
  if (log.isDebugEnabled())
    log.debug("While starting {}, obtained new location instance {}", this, 
        (machine instanceof SshMachineLocation ? 
            machine+", details "+((SshMachineLocation)machine).getUser()+":"+Entities.sanitize(((SshMachineLocation)machine).getAllConfig()) 
            : machine));
  if (!(location instanceof LocalhostMachineProvisioningLocation))
    log.info("While starting {}, obtained a new location instance {}, now preparing process there", this, machine);
  
  startInLocation(machine);
}

代码示例来源:origin: io.brooklyn/brooklyn-software-base

public MachineLocation call() throws Exception {
    final Map<String,Object> flags = obtainProvisioningFlags(location);
    if (!(location instanceof LocalhostMachineProvisioningLocation))
      log.info("Starting {}, obtaining a new location instance in {} with ports {}", new Object[] {entity(), location, flags.get("inboundPorts")});
    entity().setAttribute(SoftwareProcess.PROVISIONING_LOCATION, location);
    MachineLocation machine;
    try {
      machine = Tasks.withBlockingDetails("Provisioning machine in "+location, new Callable<MachineLocation>() {
        public MachineLocation call() throws NoMachinesAvailableException {
          return location.obtain(flags);
        }});
      if (machine == null) throw new NoMachinesAvailableException("Failed to obtain machine in "+location.toString());
    } catch (Exception e) {
      throw Exceptions.propagate(e);
    }
    
    if (log.isDebugEnabled())
      log.debug("While starting {}, obtained new location instance {}", entity(), 
          (machine instanceof SshMachineLocation ? 
              machine+", details "+((SshMachineLocation)machine).getUser()+":"+Entities.sanitize(((SshMachineLocation)machine).getAllConfig(false)) 
              : machine));
    return machine;
  }
}).build());

代码示例来源:origin: io.brooklyn/brooklyn-locations-jclouds

ComputeService result = cachedComputeServices.get(cacheKey);
if (result!=null) {
  LOG.debug("jclouds ComputeService cache hit for compute service, for "+Entities.sanitize(properties));
  return result;
LOG.debug("jclouds ComputeService cache miss for compute service, creating, for "+Entities.sanitize(properties));
  ComputeService result = cachedComputeServices.get(cacheKey);
  if (result != null) {
    LOG.debug("jclouds ComputeService cache recovery for compute service, for "+Entities.sanitize(cacheKey));
  LOG.debug("jclouds ComputeService created "+computeService+", adding to cache, for "+Entities.sanitize(properties));
  cachedComputeServices.put(cacheKey, computeService);

代码示例来源:origin: io.brooklyn/brooklyn-core

"entityReferenceAttributes={}; customProperties={}", 
new Object[] {memento.getType(), memento.getId(), memento.getParent(), memento.getChildren(), 
memento.getLocations(), memento.getPolicies(), memento.getMembers(), sanitize(memento.getConfig()), 
sanitize(memento.getAttributes()), memento.getEntityReferenceConfigs(), 
memento.getEntityReferenceAttributes(), sanitize(memento.getCustomFields())});

代码示例来源:origin: io.brooklyn/brooklyn-core

@Override
public void reconstruct(RebindContext rebindContext, LocationMemento memento) {
  if (LOG.isTraceEnabled()) LOG.trace("Reconstructing location {}({}): displayName={}; parent={}; children={}; " +
      "locationConfig={}; locationConfigDescription={}; customProperties={}",
      new Object[] {memento.getType(), memento.getId(), memento.getDisplayName(), memento.getParent(), 
      memento.getChildren(), sanitize(memento.getLocationConfig()), memento.getLocationConfigDescription(), 
      sanitize(memento.getCustomFields())});
  // Note that the flags have been set in the constructor
  location.setName(memento.getDisplayName());
  location.getConfigBag().putAll(memento.getLocationConfig()).markAll(
      Sets.difference(memento.getLocationConfig().keySet(), memento.getLocationConfigUnused())).
      setDescription(memento.getLocationConfigDescription());
  
  // Do late-binding of config that are references to other locations
  for (String flagName : memento.getLocationConfigReferenceKeys()) {
    Field field = FlagUtils.findFieldForFlag(flagName, location);
    Class<?> fieldType = field.getType();
    Object transformedValue = memento.getLocationConfig().get(flagName);
    Object restoredValue = MementoTransformer.transformIdsToLocations(rebindContext, transformedValue, fieldType, true);
    
    location.getConfigBag().putStringKey(flagName, restoredValue);
    FlagUtils.setFieldFromFlag(location, flagName, restoredValue);
  }
  setParent(rebindContext, memento);
  addChildren(rebindContext, memento);
  
  doReconsruct(rebindContext, memento);
}

代码示例来源:origin: io.brooklyn/brooklyn-locations-jclouds

vmHostname, 
    setup.getDescription(), 
    Entities.sanitize(sshConfig)
});

相关文章