/*
 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */

package org.xdi.config.oxtrust;

import org.gluu.site.ldap.persistence.annotation.LdapAttribute;
import org.gluu.site.ldap.persistence.annotation.LdapDN;
import org.gluu.site.ldap.persistence.annotation.LdapEntry;
import org.gluu.site.ldap.persistence.annotation.LdapJsonObject;
import org.gluu.site.ldap.persistence.annotation.LdapObjectClass;
import org.xdi.ldap.model.Entry;

/**
 * @author Yuriy Movchan
 * @version 0.9, 05/16/2013
 */
@LdapEntry
@LdapObjectClass(values = {"top", "oxTrustConfiguration"})
public class LdapOxTrustConfiguration extends Entry {

	private static final long serialVersionUID = -15289347651306279L;

	@LdapDN
    private String dn;

	@LdapJsonObject
	@LdapAttribute(name = "oxTrustConfApplication")
    private AppConfiguration application;

	@LdapJsonObject
	@LdapAttribute(name = "oxTrustConfCacheRefresh")
    private CacheRefreshConfiguration cacheRefresh;

    @LdapAttribute(name = "oxRevision")
    private long revision;
    
    @LdapJsonObject //issue 102 - begin  : changed by shekhar
    @LdapAttribute(name = "oxTrustConfImportPerson")
    private ImportPersonConfig importPersonConfig; //issue 102 - end  : changed by shekhar
    
    @LdapAttribute(name = "oxTrustAttributeResolver")
    private String oxTrustAttributeResolver;

	public LdapOxTrustConfiguration() {
	}

	public AppConfiguration getApplication() {
		return application;
	}

	public void setApplication(AppConfiguration application) {
		this.application = application;
	}

	public CacheRefreshConfiguration getCacheRefresh() {
		return cacheRefresh;
	}

	public void setCacheRefresh(CacheRefreshConfiguration cacheRefresh) {
		this.cacheRefresh = cacheRefresh;
	}

	public long getRevision() {
		return revision;
	}

	public void setRevision(long revision) {
		this.revision = revision;
	}

	//issue 102 - begin  : changed by shekhar
	public ImportPersonConfig getImportPersonConfig() {
		return importPersonConfig;
	}

	public void setImportPersonConfig(ImportPersonConfig importPersonConfig) {
		this.importPersonConfig = importPersonConfig;
	}//issue 102 - end  : changed by shekhar
	

	public String getOxTrustAttributeResolver() {
		return oxTrustAttributeResolver;
	}

	public void setOxTrustAttributeResolver(String oxTrustAttributeResolver) {
		this.oxTrustAttributeResolver = oxTrustAttributeResolver;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("LdapOxTrustConfiguration [dn=").append(dn).append(", application=").append(application).append(", cacheRefresh=").append(cacheRefresh)
				.append(", revision=").append(revision).append("]");
		return builder.toString();
	}

}

@@ -1347,24 +1347,28 @@
 e = %22oxTrust
+Conf
 AttributeRes
@@ -1390,32 +1390,25 @@
 vate String 
-oxTrustA
+a
 ttributeReso
@@ -1411,16 +1411,22 @@
 Resolver
+Config
 ;%0A%0A%09publ
@@ -2263,23 +2263,16 @@
 ring get
-OxTrust
 Attribut
@@ -2280,16 +2280,22 @@
 Resolver
+Config
 () %7B%0A%09%09r
@@ -2300,24 +2300,17 @@
 %09return 
-oxTrustA
+a
 ttribute
@@ -2313,24 +2313,30 @@
 buteResolver
+Config
 ;%0A%09%7D%0A%0A%09publi
@@ -2345,23 +2345,16 @@
 void set
-OxTrust
 Attribut
@@ -2366,16 +2366,22 @@
 lver
+Config
 (String 
 oxTr
@@ -2376,24 +2376,17 @@
 (String 
-oxTrustA
+a
 ttribute
@@ -2393,16 +2393,22 @@
 Resolver
+Config
 ) %7B%0A%09%09th
@@ -2410,24 +2410,17 @@
 %0A%09%09this.
-oxTrustA
+a
 ttribute
@@ -2431,19 +2431,18 @@
 lver
- = oxTrustA
+Config = a
 ttri
@@ -2453,16 +2453,22 @@
 Resolver
+Config
 ;%0A%09%7D%0A%0A%09@

Update attribute resolver config variables names to sync with other var names