private void updateRegistrationInformation(Registration registration, RegistrationData registrationData) throws RegistrationException
{
registration.setStatus(RegistrationStatus.VALID);
Consumer consumer = registration.getConsumer();
consumer.setConsumerAgent(registrationData.getConsumerAgent());
ConsumerCapabilities capabilities = consumer.getCapabilities();
List<String> modeStrings = registrationData.getConsumerModes();
modeStrings = WSRPUtils.replaceByEmptyListIfNeeded(modeStrings);
int modesNb = modeStrings.size();
if (modesNb > 0)
{
List<Mode> modes = new ArrayList<Mode>(modesNb);
for (String modeString : modeStrings)
{
modes.add(WSRPUtils.getJSR168PortletModeFromWSRPName(modeString));
}
capabilities.setSupportedModes(modes);
}
List<String> wsStrings = registrationData.getConsumerWindowStates();
wsStrings = WSRPUtils.replaceByEmptyListIfNeeded(wsStrings);
int wsNb = wsStrings.size();
if (wsNb > 0)
{
List<WindowState> windowStates = new ArrayList<WindowState>(wsNb);
for (String wsString : wsStrings)
{
windowStates.add(WSRPUtils.getJSR168WindowStateFromWSRPName(wsString));
}
capabilities.setSupportedWindowStates(windowStates);
}
capabilities.setSupportedUserScopes(registrationData.getConsumerUserScopes());
capabilities.setSupportsGetMethod(registrationData.isMethodGetSupported());
producer.getRegistrationManager().getPersistenceManager().saveChangesTo(consumer);
}