@Override
	public List<ArtiDAO.Data> toArtifact(AuthzTrans trans, Artifacts artifacts) {
		List<ArtiDAO.Data> ladd = new ArrayList<ArtiDAO.Data>();
		for(Artifact arti : artifacts.getArtifact()) {
			ArtiDAO.Data data = new ArtiDAO.Data();
			data.mechid = arti.getMechid();
			data.machine = arti.getMachine();
			data.type(true).addAll(arti.getType());
			data.ca = arti.getCa();
			data.dir = arti.getDir();
			data.os_user = arti.getOsUser();
			// Optional (on way in)
			data.appName = arti.getAppName();
			data.renewDays = arti.getRenewDays();
			data.notify = arti.getNotification();
			
			// Ignored on way in for create/update
			data.sponsor = arti.getSponsor();
			data.expires = null;
			
			// Derive Optional Data from Machine (Domain) if exists
			if(data.machine!=null) {
				if(data.ca==null) {
					if(data.machine.endsWith(".att.com")) {
						data.ca = "aaf"; // default
					}
				}
				if(data.appName==null ) {
					data.appName=AAFCon.reverseDomain(data.machine);
				}
			}

			ladd.add(data);
		}
		return ladd;
	}
@ Override public List < ArtiDAO . Data > toArtifact ( AuthzTrans trans , Artifacts artifacts ) { List < ArtiDAO . Data > ladd = new ArrayList < ArtiDAO . Data > ( ) ; for ( Artifact arti : artifacts . getArtifact ( ) ) { ArtiDAO . Data data = new ArtiDAO . Data ( ) ; data . mechid = arti . getMechid ( ) ; data . machine = arti . getMachine ( ) ; data . type ( true ) . addAll ( arti . getType ( ) ) ; data . ca = arti . getCa ( ) ; data . dir = arti . getDir ( ) ; data . os_user = arti . getOsUser ( ) ; data . appName = arti . getAppName ( ) ; data . renewDays = arti . getRenewDays ( ) ; data . notify = arti . getNotification ( ) ; data . sponsor = arti . getSponsor ( ) ; data . expires = null ; if ( data . machine != null ) { if ( data . ca == null ) { if ( data . machine . endsWith ( ".att.com" ) ) { data . ca = "aaf" ; } } if ( data . appName == null ) { data . appName = AAFCon . reverseDomain ( data . machine ) ; } } ladd . add ( data ) ; } return ladd ; }
/* (non-Javadoc)
@see com.att.authz.cm.mapper.Mapper#toArtifact(com.att.authz.env.AuthzTrans, java.lang.Object)