/** * Get instance level preferences */ public Map<String, String> getProperties() { return getConfigProperties(new InstanceId("")); }
@Override public String getEntityName() { return getInstance(); }
@SuppressWarnings("unused") public static InstanceId fromIdParts(Iterable<String> idString) { Iterator<String> iterator = idString.iterator(); return new InstanceId(nextAndEnd(iterator, "instance")); }
/** * Delete instance level preferences */ public void deleteProperties() { deleteConfig(new InstanceId("")); }
@SuppressWarnings("unused") public static InstanceId fromIdParts(Iterable<String> idString) { Iterator<String> iterator = idString.iterator(); return new InstanceId(nextAndEnd(iterator, "instance")); }
@Override public String getEntityName() { return getInstance(); }
/** * Get instance level resolved preferences */ public Map<String, String> getResolvedProperties() { return getConfigResolvedProperties(new InstanceId("")); }
@Override public void ensureExists(InstanceId instanceId) throws NotFoundException { if (!instanceName.equals(instanceId.getInstance())) { throw new NotFoundException(instanceId); } } }
/** * Set instance level preferences */ public void setProperties(Map<String, String> propMap) throws NotFoundException, ProfileConflictException, BadRequestException { setConfig(new InstanceId(""), propMap); }
@Override public void ensureExists(InstanceId instanceId) throws NotFoundException { if (!instanceName.equals(instanceId.getInstance())) { throw new NotFoundException(instanceId); } } }
/** * Delete instance level preferences */ public void deleteProperties() { deleteConfig(new InstanceId("")); }
/** * Get instance level preferences */ public Map<String, String> getProperties() { return getConfigProperties(new InstanceId("")); }
/** * Get instance level resolved preferences */ public Map<String, String> getResolvedProperties() { return getConfigResolvedProperties(new InstanceId("")); }
/** * Set instance level preferences */ public void setProperties(Map<String, String> propMap) throws NotFoundException, ProfileConflictException, BadRequestException { setConfig(new InstanceId(""), propMap); }
InstanceId instanceId = new InstanceId("");
InstanceId instanceId = new InstanceId("");
/** * Get the resolved preferences for the entity id, the preferences are resolved from instance -> namespace -> app * -> program level * * @param entityId the entity id to get the preferences from * @return the map which contains the preferences */ public Map<String, String> getResolvedPreferences(EntityId entityId) { // if it is instance level get the properties and return if (entityId.getEntityType().equals(EntityType.INSTANCE)) { return getPreferences(entityId); } Map<String, String> properties = new HashMap<>(); // if the entity id has a parent id, get the preference from its parent if (entityId instanceof ParentedId) { properties.putAll(getResolvedPreferences(((ParentedId) entityId).getParent())); } else if (entityId.getEntityType() == EntityType.NAMESPACE) { // otherwise it is a namespace id, which we want to look at the instance level properties.putAll(getResolvedPreferences(new InstanceId(""))); } // put the current level property properties.putAll(getPreferences(entityId)); return properties; }
/** * Get the resolved preferences for the entity id, the preferences are resolved from instance -> namespace -> app * -> program level * * @param entityId the entity id to get the preferences from * @return the map which contains the preferences */ public Map<String, String> getResolvedPreferences(EntityId entityId) { // if it is instance level get the properties and return if (entityId.getEntityType().equals(EntityType.INSTANCE)) { return getPreferences(entityId); } Map<String, String> properties = new HashMap<>(); // if the entity id has a parent id, get the preference from its parent if (entityId instanceof ParentedId) { properties.putAll(getResolvedPreferences(((ParentedId) entityId).getParent())); } else if (entityId.getEntityType() == EntityType.NAMESPACE) { // otherwise it is a namespace id, which we want to look at the instance level properties.putAll(getResolvedPreferences(new InstanceId(""))); } // put the current level property properties.putAll(getPreferences(entityId)); return properties; }
String user = System.getProperty("user.name"); SecurityRequestContext.setUserId(user); InstanceId instance = new InstanceId(cConf.get(Constants.INSTANCE_NAME)); Principal principal = new Principal(user, Principal.PrincipalType.USER); authorizerInstantiator.get().grant(Authorizable.fromEntityId(instance), principal,
String user = System.getProperty("user.name"); SecurityRequestContext.setUserId(user); InstanceId instance = new InstanceId(cConf.get(Constants.INSTANCE_NAME)); Principal principal = new Principal(user, Principal.PrincipalType.USER); authorizerInstantiator.get().grant(Authorizable.fromEntityId(instance), principal,