use of org.gluu.oxtrust.service.scim2.schema.strategy.serializers.SchemaTypeFidoDeviceSerializer in project oxTrust by GluuFederation.
the class FidoDeviceCoreLoadingStrategy method load.
@Override
public SchemaType load(AppConfiguration appConfiguration, SchemaType schemaType) throws Exception {
log.info(" load() ");
Meta meta = new Meta();
meta.setLocation(appConfiguration.getBaseEndpoint() + "/scim/v2/Schemas/" + schemaType.getId());
meta.setResourceType("Schema");
schemaType.setMeta(meta);
// Use serializer to walk the class structure
ObjectMapper mapper = new ObjectMapper();
mapper.disable(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS);
SimpleModule userCoreLoadingStrategyModule = new SimpleModule("FidoDeviceCoreLoadingStrategyModule", new Version(1, 0, 0, ""));
SchemaTypeFidoDeviceSerializer serializer = new SchemaTypeFidoDeviceSerializer();
serializer.setSchemaType(schemaType);
userCoreLoadingStrategyModule.addSerializer(FidoDevice.class, serializer);
mapper.registerModule(userCoreLoadingStrategyModule);
mapper.writeValueAsString(createDummyFidoDevice());
return serializer.getSchemaType();
}
Aggregations