@Override public String getResourceDescription() { if (birthday == null) { return null; } return DateTools.formatDateOnly(birthday); }
public EmailRedirection() { uid = SecureRandomTools.randomBase64String(10); }
@Deprecated public void setCommonNames(Set<String> commonNames) { if (CollectionsTools.isNullOrEmpty(this.domainNames)) { this.domainNames = commonNames; } }
@Override public void formatForm(CommonServicesContext servicesCtx, Map<String, String> rawFormValues) { CommonFormatting.trimSpacesAround(rawFormValues, UnixUser.PROPERTY_NAME); CommonFormatting.toLowerCase(rawFormValues, UnixUser.PROPERTY_NAME); // Keep clear password if (!StringTools.safeEquals(rawFormValues.get(UnixUser.PROPERTY_KEEP_CLEAR_PASSWORD), "true")) { rawFormValues.put(UnixUser.PROPERTY_KEEP_CLEAR_PASSWORD, "false"); } }
public void addAssetResource(String destination, String sourceResource) { String content = ResourceTools.getResourceAsString(sourceResource); addAssetContent(destination, content); }
public ResourcesDumpResource(String resourceType, IPResource resource) { this.resourceType = resourceType; this.resourceName = resource.getResourceName(); this.resourceJson = JsonTools.compactPrint(resource); }
@Override public IPResource deepClone() { IPResource cloned = JsonTools.clone(this); cloned.setInternalId(this.internalId); return cloned; }
public void addService(Collection<String> hostnames, HaProxyConfigEndpoint... endpoints) { for (String hostname : hostnames) { CollectionsTools.getOrCreateEmpty(serviceByHostname, hostname, HaProxyConfigPortHttpService.class).addEndpointHostPorts(endpoints); } }
public static long getNextAvailableId() { if (cachedSearchingAvailability == null) { throw new ProblemException("UnixUserAvailableIdHelper has not been initialised"); } Optional<Long> next = cachedSearchingAvailability.getNext(); if (!next.isPresent()) { throw new ProblemException("There is no more unix user id available"); } return next.get(); }
/** * Add tags to check and they must all be present on the item (AND). * * @param tags * the exact names or like with "%" wildcard * @return this */ public IPResourceQuery<T> tagAddAnd(String... tags) { tagsAnd.addAll(Arrays.asList(tags)); AssertTools.assertTrue(tagsOr.isEmpty(), "There can be only tags check as AND or OR, but not both at the same time"); return this; }
@Override public void formatForm(CommonServicesContext servicesCtx, Map<String, String> rawFormValues) { CommonFormatting.trimSpacesAround(rawFormValues, UnixUser.PROPERTY_NAME); CommonFormatting.toLowerCase(rawFormValues, UnixUser.PROPERTY_NAME); // Keep clear password if (!StringTools.safeEquals(rawFormValues.get(UnixUser.PROPERTY_KEEP_CLEAR_PASSWORD), "true")) { rawFormValues.put(UnixUser.PROPERTY_KEEP_CLEAR_PASSWORD, "false"); } }
public IPApplicationDefinitionAssetsBundle addAssetResource(String assetRelativePath, String sourceResource) { String content = ResourceTools.getResourceAsString(sourceResource); return addAssetContent(assetRelativePath, content); }
@JsonIgnore @Override public String getResourceDescription() { return Joiner.on(", ").join( // thumbprint, // DateTools.formatDateOnly(start), // DateTools.formatDateOnly(end) // ); }
public void addService(String hostname, HaProxyConfigEndpoint... endpoints) { CollectionsTools.getOrCreateEmpty(serviceByHostname, hostname, HaProxyConfigPortHttpService.class).addEndpointHostPorts(endpoints); }
public EmailAccount() { uid = SecureRandomTools.randomBase64String(10); }
/** * Add tags to check and at least one must be present on the item (OR). * * @param tags * the exact names or like with "%" wildcard * @return this */ public IPResourceQuery<T> tagAddOr(String... tags) { tagsOr.addAll(Arrays.asList(tags)); AssertTools.assertTrue(tagsAnd.isEmpty(), "There can be only tags check as AND or OR, but not both at the same time"); return this; }
@Override public void updateHandler(CommonServicesContext services, ChangesContext changes, UnixUser previousResource, UnixUser newResource) { // Unique user name if (!StringTools.safeEquals(previousResource.getName(), newResource.getName())) { checkUniqueName(services, newResource.getName()); } common(services, changes, newResource); }
@JsonIgnore @Override public String getResourceDescription() { return Joiner.on(", ").join( // thumbprint, // DateTools.formatDateOnly(start), // DateTools.formatDateOnly(end) // ); }
@Override public void updateHandler(CommonServicesContext services, ChangesContext changes, UnixUser previousResource, UnixUser newResource) { // Unique user name if (!StringTools.safeEquals(previousResource.getName(), newResource.getName())) { checkUniqueName(services, newResource.getName()); } common(services, changes, newResource); }
@Override public void updateHandler(CommonServicesContext services, ChangesContext changes, Machine previousResource, Machine newResource) { if (!StringTools.safeEquals(previousResource.getName(), newResource.getName())) { removeApplicationFor(services, changes, previousResource.getName()); } commonHandlerExecute(services, changes, newResource); }