/************************************************************************** * DomainPath.java * * $Revision: 1.7 $ * $Date: 2005/04/26 06:48:12 $ * * Copyright (C) 2001 CERN - European Organization for Nuclear Research * All rights reserved. **************************************************************************/ package com.c2kernel.lookup; import java.util.Iterator; import com.c2kernel.common.CannotManageException; import com.c2kernel.common.ObjectCannotBeUpdated; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.process.Gateway; /** * @version $Revision: 1.7 $ $Date: 2005/04/26 06:48:12 $ * @author $Author: abranson $ **/ public class RolePath extends DomainPath { /** * */ private boolean hasJobList = false; public RolePath() { super("agent"); } @Override public RolePath getParent() { try { if (mPath.length > 2) return Gateway.getLookup().getRolePath(mPath[mPath.length-2]); } catch (ObjectNotFoundException ex) { } return null; } public RolePath(RolePath parent, String roleName) { super(parent, roleName); } public RolePath(String[] path, boolean jobList) { super(path); hasJobList = jobList; } public RolePath(RolePath parent, String roleName, boolean jobList) { this(parent, roleName); hasJobList = jobList; } /** * @return Returns the hasJobList. */ public boolean hasJobList() { return hasJobList; } /** * @param hasJobList The hasJobList to set. * @throws ObjectCannotBeUpdated * @throws ObjectNotFoundException * @throws CannotManageException */ public void setHasJobList(boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated, CannotManageException { this.hasJobList = hasJobList; } @Override protected void checkType() { mType = CONTEXT; } public Iterator getChildren() { return Gateway.getLookup().getChildren(this); } @Override public String dump() { StringBuffer comp = new StringBuffer("Components: { "); for (String element : mPath) comp.append("'").append(element).append("' "); return "Path - dump(): "+ comp.toString()+ "}\n string="+ toString()+ "\n type="+ mType+ "\n name="+ getName()+ "\n "; } }