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

io.continual.iam.impl.zk.StdZkIamDb Maven / Gradle / Ivy

There is a newer version: 0.3.14
Show newest version
package io.continual.iam.impl.zk;

import org.json.JSONObject;

import io.continual.builder.Builder.BuildFailure;
import io.continual.iam.exceptions.IamSvcException;
import io.continual.iam.impl.common.CommonJsonGroup;
import io.continual.iam.impl.common.CommonJsonIdentity;
import io.continual.services.ServiceContainer;

public class StdZkIamDb extends ZkIamDb
{
	public static class Builder extends ZkIamDb.Builder
	{
		@Override
		public StdZkIamDb build () throws IamSvcException
		{
			return new StdZkIamDb ( this );
		}
	}

	private StdZkIamDb ( Builder builder ) throws IamSvcException
	{
		super ( builder );
	}

	public static StdZkIamDb fromJson ( ServiceContainer sc, JSONObject config ) throws BuildFailure, IamSvcException
	{
		final StdZkIamDb.Builder b = new StdZkIamDb.Builder ();
		ZkIamDb.populateBuilderFrom ( b, sc, config );
		return b.build ();
	}

	@Override
	protected CommonJsonIdentity instantiateIdentity ( String id, JSONObject data )
	{
		return new CommonJsonIdentity ( id, data, this );
	}

	@Override
	protected CommonJsonGroup instantiateGroup ( String id, JSONObject data )
	{
		return new CommonJsonGroup ( id, data, this );
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy