package com.ericsson.ims.mtas.xdms.cai3g.document;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ericsson.ims.mtas.xdms.cai3g.factory.Cai3gObjectFactory;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Create;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Delete;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Get;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Login;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Logout;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Notify;
import com.ericsson.ims.mtas.xdms.schema.cai3g.ObjectFactory;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Search;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Set;
import com.ericsson.ims.mtas.xdms.schema.cai3g.Subscribe;

public class Cai3gDocument implements ICai3gDocument
{
	public static Logger logger = LoggerFactory.getLogger(Cai3gDocument.class);

	private Cai3gObjectFactory cai3gObjectFactory;

	public Cai3gDocument()
	{
		cai3gObjectFactory = new Cai3gObjectFactory();
	}

	@Override
	public ObjectFactory getFactory()
	{
		return cai3gObjectFactory;
	}

	@Override
	public Create createCreate(String moType)
	{
		Create create = cai3gObjectFactory.createCreate();

		create.setMOType(cai3gObjectFactory.createCreateMOType(moType));

		return create;
	}

	@Override
	public Get createGet(String moType)
	{
		Get get = cai3gObjectFactory.createGet();

		get.setMOType(cai3gObjectFactory.createGetMOType(moType));

		return get;
	}

	@Override
	public Login createLogin(String user, String pwd)
	{
		Login login = cai3gObjectFactory.createLogin();

		login.setUserId(cai3gObjectFactory.createLoginUserId(user));

		login.setPwd(cai3gObjectFactory.createLoginPwd(pwd));

		return login;
	}

	@Override
	public Logout createLoginOut(String id)
	{
		Logout logout = cai3gObjectFactory.createLogout();

		logout.setSessionId(cai3gObjectFactory.createLogoutSessionId(id));

		return logout;
	}

	@Override
	public Set createSet(String moType)
	{
		Set set = cai3gObjectFactory.createSet();

		set.setMOType(cai3gObjectFactory.createSetMOType(moType));

		return set;
	}

	@Override
	public Delete createDelete(String moType)
	{
		Delete delete = cai3gObjectFactory.createDelete();

		delete.setMOType(cai3gObjectFactory.createDeleteMOType(moType));

		return delete;
	}

	@Override
	public Subscribe createSubscribe()
	{
		Subscribe subscribe = cai3gObjectFactory.createSubscribe();

		return subscribe;
	}

	@Override
	public Notify createNotify()
	{
		Notify notify = cai3gObjectFactory.createNotify();

		return notify;
	}

	@Override
	public Search createSearch()
	{
		Search search = cai3gObjectFactory.createSearch();

		return search;
	}
}
