com.atlassian.crowd.integration.atlassianuser
Class UserConfigurationPersisterImpl

java.lang.Object
  extended by com.atlassian.crowd.integration.atlassianuser.UserConfigurationPersisterImpl
All Implemented Interfaces:
UserConfigurationPersister

public class UserConfigurationPersisterImpl
extends java.lang.Object
implements UserConfigurationPersister


Constructor Summary
UserConfigurationPersisterImpl(java.io.File configurationDirectory)
           
 
Method Summary
 void detectPersistedConfigurationType()
          Detects the persisted configuration type.
 java.io.InputStream getConfigurationStream()
          Returns the active configuration.
 UserConfigurationType getConfigurationType()
          Returns the current configuration type
 boolean isCustomConfigurationAvailable()
          Returns true if a custom Atlassian User configuration file is available.
 void updateConfiguration(UserConfigurationType configurationType)
          Updates configuration to the given configuration type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserConfigurationPersisterImpl

public UserConfigurationPersisterImpl(java.io.File configurationDirectory)
                               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getConfigurationStream

public java.io.InputStream getConfigurationStream()
                                           throws java.io.IOException
Description copied from interface: UserConfigurationPersister
Returns the active configuration.

Specified by:
getConfigurationStream in interface UserConfigurationPersister
Returns:
active configuration
Throws:
java.io.IOException - if the file cannot be read

updateConfiguration

public void updateConfiguration(UserConfigurationType configurationType)
                         throws java.io.IOException
Description copied from interface: UserConfigurationPersister
Updates configuration to the given configuration type.

Specified by:
updateConfiguration in interface UserConfigurationPersister
Parameters:
configurationType - new configuration type
Throws:
java.io.IOException - If the configuration could not be updated

getConfigurationType

public UserConfigurationType getConfigurationType()
Description copied from interface: UserConfigurationPersister
Returns the current configuration type

Specified by:
getConfigurationType in interface UserConfigurationPersister
Returns:
current configuration type

isCustomConfigurationAvailable

public boolean isCustomConfigurationAvailable()
Description copied from interface: UserConfigurationPersister
Returns true if a custom Atlassian User configuration file is available.

Specified by:
isCustomConfigurationAvailable in interface UserConfigurationPersister
Returns:
true if the current configuration is UserConfigurationType.CUSTOM or if a backup is available

detectPersistedConfigurationType

public void detectPersistedConfigurationType()
                                      throws java.io.IOException
Description copied from interface: UserConfigurationPersister
Detects the persisted configuration type.

Should be called when it is likely that atlassian-user.xml has been modified.

Specified by:
detectPersistedConfigurationType in interface UserConfigurationPersister
Throws:
java.io.IOException - if the persistent configuration could not be read


Copyright © 2011 Atlassian. All Rights Reserved.