| | |
| | | */ |
| | | private static final class Impl<T> implements Condition { |
| | | |
| | | // The property. |
| | | /** The property. */ |
| | | final PropertyDefinition<T> pd; |
| | | |
| | | // The required property value. |
| | | /** The required property value. */ |
| | | final T value; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private Impl(PropertyDefinition<T> pd, T value) |
| | | throws PropertyException { |
| | | this.pd = pd; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | SortedSet<T> values = managedObject.getPropertyValues(pd); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // Not used. |
| | |
| | | |
| | | |
| | | |
| | | // Private implementation of fix() method. |
| | | /** Private implementation of fix() method. */ |
| | | private void setPropertyValue(ManagedObject<?> managedObject) { |
| | | managedObject.setPropertyValue(pd, value); |
| | | } |
| | | |
| | | } |
| | | |
| | | // The strongly typed private implementation. |
| | | /** The strongly typed private implementation. */ |
| | | private Impl<?> impl; |
| | | |
| | | // The property name. |
| | | /** The property name. */ |
| | | private final String propertyName; |
| | | |
| | | // The string representation of the required property value. |
| | | /** The string representation of the required property value. */ |
| | | private final String propertyStringValue; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ManagementContext context, |
| | | ManagedObject<?> managedObject) throws AuthorizationException, |
| | | CommunicationException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean evaluate(ServerManagedObject<?> managedObject) |
| | | throws ConfigException { |
| | | return impl.evaluate(managedObject); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initialize(AbstractManagedObjectDefinition<?, ?> d) |
| | | throws Exception { |
| | | // Decode the property. |
| | |
| | | |
| | | |
| | | |
| | | // Creates the new private implementation. |
| | | /** Creates the new private implementation. */ |
| | | private <T> void buildImpl(PropertyDefinition<T> pd) |
| | | throws PropertyException { |
| | | T value = pd.decodeValue(propertyStringValue); |