|
|||||||||
| 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<javax.xml.namespace.QName,? extends PropertyDescription> 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 RegistrationPolicypublic void setManager(RegistrationManager manager)
RegistrationPolicy
setManager in interface RegistrationPolicymanager - 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 RegistrationPolicyregistrationPropertyDescriptions - a map of containing the description of expected registrations
public void validateRegistrationDataFor(java.util.Map<javax.xml.namespace.QName,? extends PropertyDescription> registrationProperties,
java.lang.String consumerIdentity)
throws java.lang.IllegalArgumentException,
RegistrationException
validateRegistrationDataFor in interface RegistrationPolicyregistrationProperties - 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 RegistrationPolicyregistrationId - 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 RegistrationPolicyconsumerName - the name of the Consumer being created
null if the
Consumer will not be automatically to a ConsumerGroup at creation
public java.lang.String getConsumerIdFrom(java.lang.String consumerName,
java.util.Map registrationProperties)
throws java.lang.IllegalArgumentException,
InvalidConsumerDataException
getConsumerIdFrom in interface RegistrationPolicyconsumerName - 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 state
public void validateConsumerName(java.lang.String consumerName)
throws java.lang.IllegalArgumentException,
RegistrationException
validateConsumerName in interface RegistrationPolicyconsumerName - 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 service
public void validateConsumerGroupName(java.lang.String groupName)
throws java.lang.IllegalArgumentException,
RegistrationException
validateConsumerGroupName in interface RegistrationPolicygroupName - 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 | ||||||||