All Downloads are FREE. Search and download functionalities are using the official Maven repository.

am.ik.home.cloudfoundry.broker.UaaCatalogFactoryBean Maven / Gradle / Ivy

Go to download

Single tenant simple OAuth 2 Server a.k.a. Maki UAA (User Account and Authentication)

The newest version!
package am.ik.home.cloudfoundry.broker;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.servicebroker.model.Catalog;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.databind.ObjectMapper;

@Component
public class UaaCatalogFactoryBean implements FactoryBean {
	@Value("${servicebroker.catalog-json:classpath:catalog.json}")
	Resource catalog;
	@Autowired
	ObjectMapper objectMapper;

	@Override
	public Catalog getObject() throws Exception {
		Catalog catalog = objectMapper.readValue(this.catalog.getInputStream(),
				Catalog.class);
		return catalog;
	}

	@Override
	public Class getObjectType() {
		return Catalog.class;
	}

	@Override
	public boolean isSingleton() {
		return true;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy