|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.portal.jems.as.system.AbstractJBossService
org.jboss.portal.registration.policies.DefaultRegistrationPolicy
public class DefaultRegistrationPolicy
Provides a default implementation of RegistrationPolicy which should be enough for most user needs provided the
appropriate RegistrationPropertyValidator
has been configured to validate registration properties.
Field Summary |
---|
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
---|---|
DefaultRegistrationPolicy()
|
Method Summary | |
---|---|
java.lang.String |
createRegistrationHandleFor(java.lang.String registrationId)
Simply returns the given registration id. |
java.lang.String |
getAutomaticGroupNameFor(java.lang.String consumerName)
Doesn't support automatic ConsumerGroups so always return null . |
java.lang.String |
getConsumerIdFrom(java.lang.String consumerName,
java.util.Map registrationProperties)
Simply returns the given consumer name, trusted (!) to be unique. |
RegistrationManager |
getManager()
Retrieves the RegistrationManager with which this RegistrationPolicy is associated. |
RegistrationPropertyValidator |
getValidator()
Retrieves the currently configured RegistrationPropertyValidator. |
void |
setExpectations(java.util.Map<javax.xml.namespace.QName,? extends PropertyDescription> registrationPropertyDescriptions)
Define what the expectations are as far as acceptable registration properties go. |
void |
setManager(RegistrationManager manager)
Associates this RegistrationPolicy with the specified RegistrationManager. |
void |
setValidator(RegistrationPropertyValidator validator)
Instructs this policy to use the specified RegistrationPropertyValidator. |
void |
validateConsumerGroupName(java.lang.String groupName)
Rejects name if a ConsumerGroup with the specified name already exists. |
void |
validateConsumerName(java.lang.String consumerName)
Rejects registration if a Consumer with the specified name already exists. |
void |
validateRegistrationDataFor(java.util.Map registrationProperties,
java.lang.String consumerIdentity)
Only accepts the registration if no registration with identical values exists for the Consumer identified by the specified identify and delegates the validation of properties to the configured RegistrationPropertyValidator. |
Methods inherited from class org.jboss.portal.jems.as.system.AbstractJBossService |
---|
create, destroy, getState, getStateString, start, stop |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
createService, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, startService, stopService |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRegistrationPolicy()
Method Detail |
---|
public RegistrationManager getManager()
RegistrationPolicy
getManager
in interface RegistrationPolicy
public void setManager(RegistrationManager manager)
RegistrationPolicy
setManager
in interface RegistrationPolicy
manager
- the RegistrationManager with which this RegistrationPolicy should be associated.public void setExpectations(java.util.Map<javax.xml.namespace.QName,? extends PropertyDescription> registrationPropertyDescriptions)
RegistrationPolicy
setExpectations
in interface RegistrationPolicy
registrationPropertyDescriptions
- a map of containing the description of expected registrationspublic void validateRegistrationDataFor(java.util.Map registrationProperties, java.lang.String consumerIdentity) throws java.lang.IllegalArgumentException, RegistrationException, DuplicateRegistrationException
validateRegistrationDataFor
in interface RegistrationPolicy
registrationProperties
- a Map containing the registration properties in the form of property name (QName) -
property value (Object) mappingsconsumerIdentity
- the Consumer identity (as returned by RegistrationPolicy.getConsumerIdFrom(String,
java.util.Map)
) for which the registration properties must be ascertained
DuplicateRegistrationException
- if a Consumer with the same identity has already registered with the same
registration properties.
java.lang.IllegalArgumentException
- if any of the registration properties is invalid for the specified Consumer
RegistrationException
- if an exception occured in the registration servicepublic java.lang.String createRegistrationHandleFor(java.lang.String registrationId)
createRegistrationHandleFor
in interface RegistrationPolicy
registrationId
- the database identity of the Registration for which a handle is required.
public java.lang.String getAutomaticGroupNameFor(java.lang.String consumerName)
null
.
getAutomaticGroupNameFor
in interface RegistrationPolicy
consumerName
- the name of the Consumer being created
null
if the
Consumer will not be automatically to a ConsumerGroup at creationpublic java.lang.String getConsumerIdFrom(java.lang.String consumerName, java.util.Map registrationProperties) throws java.lang.IllegalArgumentException, InvalidConsumerDataException
getConsumerIdFrom
in interface RegistrationPolicy
consumerName
- the consumer nameregistrationProperties
- a Map containing the registration properties in the form of property name (QName) -
property value (Object) mappings. Producer implementations might use the
registration properties to provide secure Consumer identity.
java.lang.IllegalArgumentException
- if the specified Consumer name if null
or empty
InvalidConsumerDataException
- if the Policy examines the specified registration properties to determine the
Consumer identity and decides that they are not in a proper statepublic void validateConsumerName(java.lang.String consumerName) throws java.lang.IllegalArgumentException, RegistrationException
validateConsumerName
in interface RegistrationPolicy
consumerName
- the name of the Consumer as passed during the registration process
java.lang.IllegalArgumentException
- if the specified Consumer name if null
or empty
RegistrationException
- if an exception occurred in the Registration servicepublic void validateConsumerGroupName(java.lang.String groupName) throws java.lang.IllegalArgumentException, RegistrationException
validateConsumerGroupName
in interface RegistrationPolicy
groupName
- the name of the ConsumerGroup to be created
java.lang.IllegalArgumentException
- if the specified ConsumerGroup name if null
or empty
RegistrationException
- if an exception occurred in the Registration servicepublic void setValidator(RegistrationPropertyValidator validator)
validator
- public RegistrationPropertyValidator getValidator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |