01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.management.relation;
23:
24: import java.io.Serializable;
25:
26: import java.util.List;
27:
28: /**
29: * This interface is implemented by a class that represents a relation.<p>
30: *
31: * The class {@link RelationTypeSupport} is available to help
32: * implement this interface.<p>
33: *
34: * A relation type has a name and a list of role info objects for the
35: * relation.<p>
36: *
37: * A relation type has to registered in the relation service. This is done
38: * either by using createRelationType() to get a RelationTypeSupport
39: * object kepy in the relation service, or by using addRelationType()
40: * to add an external relation type to the relation service.
41: *
42: * @author <a href="mailto:Adrian.Brock@HappeningTimes.com">Adrian Brock</a>.
43: * @version $Revision: 57200 $
44: *
45: */
46: public interface RelationType extends Serializable {
47: // Constants ---------------------------------------------------
48:
49: // Public ------------------------------------------------------
50:
51: /**
52: * Retrieves the name of this relation type.
53: *
54: * @return the name.
55: */
56: public String getRelationTypeName();
57:
58: /**
59: * Retrieves the list of role definitions in this relation type.<p>
60: *
61: * The return value is a list of RoleInfo objects. The list must be
62: * an ArrayList.
63: *
64: * @return the list of Role Infos.
65: */
66: public List getRoleInfos();
67:
68: /**
69: * Retrieves the role info for a role name.<p>
70: *
71: * @return the role info or null.
72: * @exception IllegalArgumentException for a null role info name.
73: * @exception RoleInfoNotFoundException for no role info with the
74: * passed name in the relation type.
75: */
76: public RoleInfo getRoleInfo(String roleInfoName)
77: throws IllegalArgumentException, RoleInfoNotFoundException;
78: }
|