|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.senn.magic.dctm.DfcProperties
public class DfcProperties
Allows to create a dfc.properties with on the fly values when the application is already
running.
Only one dfc.properties per application should be created!
| Nested Class Summary | |
|---|---|
protected static class |
DfcProperties.DfcPropertiesException
Internal Exception class that extends DfException for when things go
wrong when creating a dfc.properties file. |
| Field Summary | |
|---|---|
protected static boolean |
created
|
protected static String |
DFC_PROPERTIES
name of the dfc.properties file |
protected static String |
GLOBAL_REG_PASS_KEY
key for the global registry password |
protected static String |
GLOBAL_REG_REPO_KEY
key for the global registry repository |
protected static String |
GLOBAL_REG_USER_KEY
key for the global registry user |
protected String |
globalRegistryPassword
|
protected String |
globalRegistryRepository
|
protected String |
globalRegistryUser
|
protected String |
host
|
protected static String |
HOST_KEY
key for the host's name |
protected String |
location
|
protected Map<String,String> |
optionalParams
|
protected int |
port
|
protected static String |
PORT_KEY
key for the host's port |
| Constructor Summary | |
|---|---|
DfcProperties()
Constructs a DfcProperties object with default values for:
host: localhost
port: 1489
location: {current_directory}/config
The values can afterwards be changed... |
|
DfcProperties(String host,
int port)
Constructs a DfcProperties object with default value for:
location: {current_directory}/config
The value can afterwards be changed... |
|
DfcProperties(String host,
int port,
String globalRegistryRepository,
String globalRegistryUser,
String globalRegistryPassword,
boolean isPasswordEncrypted)
Constructs a DfcProperties object with default value for:
location: {current_directory}/config
The values can afterwards be changed... |
|
DfcProperties(String host,
int port,
String globalRegistryRepository,
String globalRegistryUser,
String globalRegistryPassword,
boolean isPasswordEncrypted,
String location)
Constructs a DfcProperties object without default values. |
|
| Method Summary | |
|---|---|
void |
addOptionalParam(String key,
String value)
Adds an optional extra parameter to the dfc.properties. |
protected String |
buildEntry(String key,
String value)
Internal method that builds a line entry |
void |
create(boolean overwrite)
Creates the dfc.properties. |
protected String |
getEncryptedPassword(String password,
boolean isPasswordEncrypted)
Internal method that encrypts a password if necessary |
String |
getGlobalRegistryPassword()
Gets the encrypted global registry password |
String |
getGlobalRegistryRepository()
Gets the global registry repository |
String |
getGlobalRegistryUser()
Gets the global registry user |
String |
getHost()
Gets the content server hostname |
String |
getLocation()
Gets the location where the dfc.properties should be located |
Map<String,String> |
getOptionalParams()
Gets the map with all the optional parameters defined for this dfc.properties |
int |
getPort()
Gets the content server port |
boolean |
isValid()
Indicates if all necessary params are entered and if the location is valid. |
void |
setGlobalRegistryPassword(String globalRegistryPassword,
boolean isPasswordEncrypted)
Sets the global registry password and encrypts it if necessary |
void |
setGlobalRegistryRepository(String globalRegistryRepository)
Sets the global registry repository |
void |
setGlobalRegistryUser(String globalRegistryUser)
Sets the global registry user |
void |
setHost(String host)
Sets the content server hostname Default value = localhost |
void |
setLocation(String location)
Sets the location where the dfc.properties should be located. |
void |
setPort(int port)
Sets the content server port Default value = 1489 |
protected void |
writeDfcProperties(Writer writer)
Internal method that writes the dfc.properties file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String DFC_PROPERTIES
protected static final String HOST_KEY
protected static final String PORT_KEY
protected static final String GLOBAL_REG_REPO_KEY
protected static final String GLOBAL_REG_USER_KEY
protected static final String GLOBAL_REG_PASS_KEY
protected static boolean created
protected String host
protected int port
protected String globalRegistryRepository
protected String globalRegistryUser
protected String globalRegistryPassword
protected Map<String,String> optionalParams
protected String location
| Constructor Detail |
|---|
public DfcProperties()
DfcProperties object with default values for:
public DfcProperties(String host,
int port)
DfcProperties object with default value for:
host - the content server hostnameport - the content server port
public DfcProperties(String host,
int port,
String globalRegistryRepository,
String globalRegistryUser,
String globalRegistryPassword,
boolean isPasswordEncrypted)
DfcProperties object with default value for:
host - the content server hostnameport - the content server portglobalRegistryRepository - the global registry repositoryglobalRegistryUser - the global registry userglobalRegistryPassword - the global registry passwordisPasswordEncrypted - whether the password is encrypted or not
public DfcProperties(String host,
int port,
String globalRegistryRepository,
String globalRegistryUser,
String globalRegistryPassword,
boolean isPasswordEncrypted,
String location)
DfcProperties object without default values.
host - the content server hostnameport - the content server portglobalRegistryRepository - the global registry repositoryglobalRegistryUser - the global registry userglobalRegistryPassword - the global registry passwordisPasswordEncrypted - whether the password is encrypted or notlocation - the location where dfc.properties should be located| Method Detail |
|---|
public void create(boolean overwrite)
throws com.documentum.fc.common.DfException
dfc.properties.
overwrite - if a previously existing dfc.properties should be overwritten
com.documentum.fc.common.DfExceptionpublic boolean isValid()
boolean - true if the DfcProperties object
is valid, false if it's notpublic String getHost()
public void setHost(String host)
localhost
host - public int getPort()
public void setPort(int port)
1489
port - public String getGlobalRegistryRepository()
public void setGlobalRegistryRepository(String globalRegistryRepository)
globalRegistryRepository - public String getGlobalRegistryUser()
public void setGlobalRegistryUser(String globalRegistryUser)
globalRegistryUser - public String getGlobalRegistryPassword()
public void setGlobalRegistryPassword(String globalRegistryPassword,
boolean isPasswordEncrypted)
globalRegistryPassword - isPasswordEncrypted -
public void addOptionalParam(String key,
String value)
dfc.properties.
DfcProperties dfcProp = new DfcProperties(...);
dfcProp.addOptionalParam("dfc.search.maxresults", "1000");
key - the key for the optional parametervalue - the value of the optional parameterpublic Map<String,String> getOptionalParams()
dfc.properties
public String getLocation()
dfc.properties should be located
public void setLocation(String location)
dfc.properties should be located.{current_directory}/config
location -
protected String getEncryptedPassword(String password,
boolean isPasswordEncrypted)
password - isPasswordEncrypted -
protected void writeDfcProperties(Writer writer)
throws IOException
dfc.properties file
writer -
IOException
protected String buildEntry(String key,
String value)
throws IOException
key - value -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||