@PreAuthorize("hasRole('" + SCIMEntitlement.SCIM_CONF_SET + "')") public void set(final SCIMConf conf) { try { schemaLogic.read(SchemaType.PLAIN, SCIMConf.KEY); } catch (NotFoundException e) { PlainSchemaTO scimConf = new PlainSchemaTO(); scimConf.setKey(SCIMConf.KEY); scimConf.setType(AttrSchemaType.Binary); scimConf.setMimeType(MediaType.APPLICATION_JSON); schemaLogic.create(SchemaType.PLAIN, scimConf); } conf.setGeneralConf(new SCIMGeneralConf()); conf.getGeneralConf().setLastChangeDate(new Date()); configurationLogic.set(new AttrTO.Builder(). schema(SCIMConf.KEY). value(Base64.getEncoder().encodeToString(POJOHelper.serialize(conf).getBytes())). build()); } }