01: /******************************************************************************
02: * JBoss, a division of Red Hat *
03: * Copyright 2006, Red Hat Middleware, LLC, and individual *
04: * contributors as indicated by the @authors tag. See the *
05: * copyright.txt in the distribution for a full listing of *
06: * individual contributors. *
07: * *
08: * This is free software; you can redistribute it and/or modify it *
09: * under the terms of the GNU Lesser General Public License as *
10: * published by the Free Software Foundation; either version 2.1 of *
11: * the License, or (at your option) any later version. *
12: * *
13: * This software is distributed in the hope that it will be useful, *
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16: * Lesser General Public License for more details. *
17: * *
18: * You should have received a copy of the GNU Lesser General Public *
19: * License along with this software; if not, write to the Free *
20: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
21: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
22: ******************************************************************************/package org.jboss.portal.registration;
23:
24: import java.util.Collection;
25:
26: /**
27: * An entity that groups several registrations under the same scope, for exemple a Consumer entity could be related to
28: * several registrations for the same consumer with different capabilities.
29: *
30: * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
31: * @author @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
32: * @version $Revision:5641 $
33: * @since 2.6
34: */
35: public interface Consumer {
36:
37: /**
38: * Return the consumer name.
39: *
40: * @return the consumer name
41: */
42: String getName();
43:
44: /**
45: * Return the registration status of the consumer entity.
46: *
47: * @return the registration stats.
48: */
49: RegistrationStatus getStatus();
50:
51: /**
52: * Set the registration status of the consumer entity.
53: *
54: * @param status the registration status
55: */
56: void setStatus(RegistrationStatus status);
57:
58: /**
59: * Return all the registrations for the specified consumer.
60: *
61: * @return the consumer registrations
62: * @throws RegistrationException
63: */
64: Collection getRegistrations() throws RegistrationException;
65:
66: /**
67: * Returns the group that this consumer belongs to.
68: *
69: * @return the consumer group
70: */
71: ConsumerGroup getGroup();
72:
73: /**
74: * Retrieves this Consumer's identity, which uniquely identifies the Consumer since the name cannot be relied on. It
75: * is up to the {@link RegistrationPolicy} to determine what the Consumer's identity is. Note also that this is
76: * different from the Consumer's database identifier.
77: *
78: * @return this Consumer's identity.
79: */
80: String getId();
81:
82: ConsumerCapabilities getCapabilities();
83:
84: void setCapabilities(ConsumerCapabilities capabilities);
85:
86: void setGroup(ConsumerGroup group) throws RegistrationException,
87: DuplicateRegistrationException;
88:
89: String getConsumerAgent();
90:
91: void setConsumerAgent(String consumerAgent)
92: throws IllegalArgumentException, IllegalStateException;
93: }
|