/*
 * @(#)ArtifactManager.java
 *
 * Copyright (C) 2005 Infocity Inc. All Rights Reserved.
 */
package test.info.dragonlady.sso;

import org.opensaml.artifact.ArtifactParseException;
import org.opensaml.artifact.ArtifactParserException;
import org.opensaml.artifact.SAMLArtifactType0001;

/**
 * ArtifactReceiver,Responderクラスのテストケース用アーティファクト管理クラス
 * 
 * @author Hiroshi.Ebata(INFOCITY)
 * @version $Revision: 1.1 $ $Date: 2005/11/23 11:27:10 $
 */
public class ArtifactManager {

	private static final ArtifactManager am = new ArtifactManager();

	private String[] artifact = null;

	/**
	 * コンストラクタ
	 */
	private ArtifactManager() {
	}

	public static ArtifactManager getInstance() {
		return am;
	}

	public void setArtifact(String[] artifact) {
		this.artifact = artifact;
	}

	public String[] getArtifact() {
		return this.artifact;
	}

	public byte[] getHandle(String artifact) throws ArtifactParseException, ArtifactParserException {
		SAMLArtifactType0001 artifact0001 = (SAMLArtifactType0001)SAMLArtifactType0001.TYPE_CODE.getParser().parse(artifact);
		return artifact0001.getAssertionHandle();
	}
}
