public abstract class ISVContentManager
extends java.lang.Object
ISVContentManager provides the prototype for handling the requests to manage the ISV Package content. Any class handling the ISV Content should be extending from this class. Default implementation is provided for rollback method which removes the ISV Package entries from the LDAP. Default implementation is also provided for unload method, which inturn invokes the rollback and also unloads XMLObjects, if any, in the ISV Content.
Any class extending the ISVContentManager should override the default implementation provided, to handle the custom content. The load method is called while loading the ISV Package. Similarly the unLoad method is invoked while unloading the same. The extending class is also required to handle the rollback method. Rollback is invoked once there's an exception during loading/unloading of the ISV Package. The expected behaviour is to undo the operation in process.
// class that extends ISVContentManager to implement the custom // content which sets some system properties. This class implements only // load method other method have their default implementation // // content node looks like this // <SystemContent loader="com.eibus.contentmanagement.ISVSystemPropertyManager" desription="System Property Manager"> // <property> // <key>key</key> // <value>value</value> // </property> // </SystemContent> public class MyContentManager extends ISVContentManager { // When this manager class is encountered it sets the system property taking values // from the specific content item node. public void load(ISVPackage isvPackage,int contentItemNode,int logContentItemNode) throws Exception { // implement the logic that is to be performed while loading the Package int propertyNodes[] = Find.match(contentItemNode,"?<property>") for(int i=0;i<propertyNodes.length;i++) { String key = Node.getDataElement(Find.first(propertyNodes[i],"key")); String value = Node.getDataElement(Find.first(propertyNodes[i],"value")); System.setProperty(key,value); // write to the logfile Document document = Node.getDocument(logContentItemNode); int propNode = document.createElement("property",logContentItemNode); Node.setDataElement(propNode,"key",key); Node.setDataElement(propNode,"value",value); } } }
Modifier and Type | Field and Description |
---|---|
protected static Connector |
connector
Holds the connector of SOAP Processor
|
protected java.lang.String |
currentUserDN
Holds the DN of the current user
|
protected java.lang.String |
FILE_SEPARATOR
Holds the file seperator
|
protected static boolean |
isDeleteReferences
Tells whether references of the methodsets and roles have to be deleted or not
|
boolean |
isRolledBack
Holds the state of the content, if it's rolled back or not.
|
protected boolean |
isvPackExists |
static CordysLogger |
isvpLogger |
protected int |
oldISVPRegistryEntry |
protected int |
oldUninstallLogItem |
protected static java.lang.String |
origin
Holds the cn of the ISV Package
|
protected static java.util.Hashtable<java.lang.Object,java.lang.Object> |
reusableProperties
This hashtable can be used by other content managers(classes which are extending
'ISVContentManager') to exchange any data between different ISV Packages when they are being
loaded by BCP Installer.
|
protected static java.lang.String |
root
Holds the ldap root
|
protected SynchronousRequestResponseHandler |
synchHandler |
protected MultiVersionContentUpgrader |
upgradeManager
Start of Code related to Upgrade of ISV Content manager
|
Constructor and Description |
---|
ISVContentManager() |
Modifier and Type | Method and Description |
---|---|
void |
deleteRecursive(java.lang.String entryDN)
Recursively deletes the DN tree of entryDN from LDAP
|
javax.swing.JPanel |
getInstallerPanel(ISVPackage isvPackage,
int contentItemNode,
int promptsetReference)
Deprecated.
From C3 onwards, ISV packages are not loaded by Cordys installer. Implementing this
method is not required.
|
protected int |
getNumRegisteredInstances()
Deprecated.
|
int |
getOldISVPRegistryEntry()
Gets the loadingdetails node of the ISV package, only during an upgrade
|
int |
getOldUninstallLogItem()
This method would be used by all content managers to do actions with old content
i.e., unloading or updating.
|
java.lang.String |
getPanelDescription(int contentItemNode,
int promptsetReference)
The description returned by this method will be shown on the panel returned by
'getInstallerPanel()' method.
|
java.lang.String |
getPrompSetForKeyAsString(java.lang.String promptName,
java.lang.String isvpName)
This method returns the promptset node in string format when specified the key of the promptset
|
int |
getPromptSetFromRequest(ISVPackage isvpackage)
Returns the promptset with values, for the current ISVP from the load
request.
|
java.util.Hashtable |
getPromptsFromManager()
Deprecated.
Individual content managers' defining prompts is not recommended. If the content manager
class could not be loaded for any reason, these prompts will not be included in the ISV package definition.
Instead, all prompts of an ISV package should be defined in the isv.xml file.
|
int |
getPromptsFromRequest(int contentItemNode,
ISVPackage isvpackage)
Deprecated.
Please Use the getPromptSetFromRequest API and search for the
required prompts in the returned Node.
|
int |
getReusablePromptSetForKey(java.lang.String promptName,
java.lang.String isvpName)
This method returns the promptset node when specified the key of the promptset
|
static java.util.Hashtable |
getReusableProperties()
Returns reusableProperties
|
MultiVersionContentUpgrader |
getUpgradeManager()
Provides the default Multi-version content Manager that provides the
facility to upgrade.
|
boolean |
isIsvPackExists()
This method is used to check whether an ISVP is already loaded or not
while upgrading the ISVP.
|
protected boolean |
isLastMemeber()
Deprecated.
: Use the API isLastMember from ISVPackage.
|
boolean |
isPromptSetExistForKey(java.lang.String promptName,
java.lang.String isvpName)
This method is used to check wether the promptset exist for the key passed as parameter
|
abstract void |
load(ISVPackage isvPackage,
int contentItemNode,
int logcontentItem)
Loads the isvp content from the contentItemNode
|
java.util.Map<java.lang.String,ManifestEntry> |
publishKeyInfo()
The method returns a hashmap with the URIs as the hashmap keys and their types as values.
|
protected void |
registerUpgradeHandler(Version version,
int sequenceOfTheHandler,
ContentUpgrader handler)
Provides the registration of the upgrade handlers.
|
void |
removeResuablePromptSet(java.lang.String promptName,
java.lang.String isvpName) |
void |
rollback(java.lang.String isvpDN)
Rollback the current content loaded to retain the original state
|
void |
setConnector(Connector pconnector)
sets the connector for the content manager classes to use
|
void |
setCurrentUserDN(java.lang.String userDN)
sets the current user dn who initiated load/unload request
|
static void |
setIsDeleteReferences(boolean value)
sets isDeleteReferences to given value
|
void |
setIsvPackExists(boolean isvPackExists)
This method would be called by ISVP Framework while upgrading ISVP
to check whether ISVP is already loaded or not.
|
void |
setISVPLogger(CordysLogger isvLogger)
This method sets CordysLogger (Logger for ISVP) for ISVP Loading / Unloading / Upgrading.
|
void |
setOldISVPRegistryEntry(int oldISVPRegistryEntry)
This method is invoked by the ISVP framework during the upgrade of an ISVPackage.
|
void |
setOldUninstallLogItem(int logItem)
This method would be called by ISVP Framework while upgrading ISVP
to set the old uninstall log file before upgrading ISVP to unload the
old content which is not used to new content
|
void |
setOrigin(java.lang.String originString)
sets origin of content manager to the string passed
|
void |
setReusablePromptSet(java.lang.String promptName,
java.lang.String isvpName,
int promptSet)
This method sets the promptset node as a reusable promptset node for other ISVPs to use.
|
static void |
setReusableProperties(java.util.Hashtable hashtable)
sets the the given hashtable as reusableProperties
|
protected void |
setReusableProperty(java.lang.String key,
IStringResource message,
java.lang.Object... insertions) |
protected void |
setReusableProperty(java.lang.String key,
Message message,
java.lang.Object... insertions)
Deprecated.
Use
#setReusableProperty(String key, IStringResource message, Object...insertions) |
void |
setSynchHandler(SynchronousRequestResponseHandler handler)
This method sets SynchronousRequestResponseHandler for the content managers
|
void |
unload(ISVPackage isvPackage,
int contentItemNode,
int logcontentItem)
Unloads the content from the contentItemNode
|
void |
unload(ISVPackage isvPackage,
int contentItemNode,
int logcontentItem,
boolean option) |
boolean |
updatePrompts(int promptsetReference,
java.awt.Frame parent)
This method would be called by BCP Installer when the screen(returned by getInstallerPanel() method)
is shown.
|
void |
updateUserDetails(int soapEnvelope)
Updates the user information in the header of the input SOAP Envelope
|
void |
upgrade(ISVPackage isvPackage,
int contentItemNode,
int logcontentItem)
Upgrades the isvp content from the contentItemNode
Custom contents should override this method to implement / override default implementation
of upgrade method.
|
protected static Connector connector
protected final java.lang.String FILE_SEPARATOR
protected java.lang.String currentUserDN
public boolean isRolledBack
protected static java.lang.String origin
protected static final java.lang.String root
protected static java.util.Hashtable<java.lang.Object,java.lang.Object> reusableProperties
protected static boolean isDeleteReferences
protected boolean isvPackExists
protected int oldUninstallLogItem
protected int oldISVPRegistryEntry
public static CordysLogger isvpLogger
protected SynchronousRequestResponseHandler synchHandler
protected MultiVersionContentUpgrader upgradeManager
public abstract void load(ISVPackage isvPackage, int contentItemNode, int logcontentItem) throws java.lang.Exception
java.lang.Exception
public java.util.Map<java.lang.String,ManifestEntry> publishKeyInfo() throws java.lang.Exception
java.lang.Exception
@Deprecated protected void setReusableProperty(java.lang.String key, Message message, java.lang.Object... insertions)
#setReusableProperty(String key, IStringResource message, Object...insertions)
protected void setReusableProperty(java.lang.String key, IStringResource message, java.lang.Object... insertions)
public void unload(ISVPackage isvPackage, int contentItemNode, int logcontentItem, boolean option) throws java.lang.Exception
java.lang.Exception
public void setISVPLogger(CordysLogger isvLogger)
isvLogger
- public void unload(ISVPackage isvPackage, int contentItemNode, int logcontentItem) throws java.lang.Exception
java.lang.Exception
public void upgrade(ISVPackage isvPackage, int contentItemNode, int logcontentItem) throws java.lang.Exception
isvPackage
- contentItemNode
- logcontentItem
- java.lang.Exception
public void rollback(java.lang.String isvpDN)
public void deleteRecursive(java.lang.String entryDN)
public void setCurrentUserDN(java.lang.String userDN)
public static java.util.Hashtable getReusableProperties()
public static void setReusableProperties(java.util.Hashtable hashtable)
public static void setIsDeleteReferences(boolean value)
public void setConnector(Connector pconnector)
public void updateUserDetails(int soapEnvelope)
@Deprecated public java.util.Hashtable getPromptsFromManager()
public int getPromptsFromRequest(int contentItemNode, ISVPackage isvpackage)
public int getPromptSetFromRequest(ISVPackage isvpackage)
public void setOrigin(java.lang.String originString)
@Deprecated public javax.swing.JPanel getInstallerPanel(ISVPackage isvPackage, int contentItemNode, int promptsetReference)
public boolean updatePrompts(int promptsetReference, java.awt.Frame parent)
public java.lang.String getPanelDescription(int contentItemNode, int promptsetReference)
public int getReusablePromptSetForKey(java.lang.String promptName, java.lang.String isvpName)
promptName
- - Name of the prompt node prepared.isvpName
- - Name of ISV Packagepublic java.lang.String getPrompSetForKeyAsString(java.lang.String promptName, java.lang.String isvpName)
promptName
- - Name of the prompt node prepared in ISV Package.isvpName
- - Name of the ISV Package.public boolean isPromptSetExistForKey(java.lang.String promptName, java.lang.String isvpName)
promptName
- - Name of the prompt node Ex.: databaseConfigisvpName
- - Name of the ISV Package.public void setReusablePromptSet(java.lang.String promptName, java.lang.String isvpName, int promptSet)
promptName
- - Name of the prompt prepared in ISV Packagte.isvpName
- - Name of the ISV Package.promptSet
- - Node of the promptsetpublic void removeResuablePromptSet(java.lang.String promptName, java.lang.String isvpName)
public boolean isIsvPackExists()
public void setIsvPackExists(boolean isvPackExists)
isvPackExists
- public void setOldUninstallLogItem(int logItem)
logItem
- public int getOldUninstallLogItem()
public int getOldISVPRegistryEntry()
public void setOldISVPRegistryEntry(int oldISVPRegistryEntry)
oldISVPRegistryEntry
- loadingdetails node of the existing ISV package in the ISVP registrypublic MultiVersionContentUpgrader getUpgradeManager()
protected void registerUpgradeHandler(Version version, int sequenceOfTheHandler, ContentUpgrader handler) throws UpgradeException
version
- The version the handler is applicable for.sequenceOfTheHandler
- The sequence of the handler, when there are two or more
handlers for a given version then the lower of the sequence
number's is chosen first for executionhandler
- The handler that contains the actual application logic for
upgrading.UpgradeException
- When registration fails. E.g. the Content Manager does not
implement the UpgradeManager exception.protected boolean isLastMemeber()
protected int getNumRegisteredInstances()
public void setSynchHandler(SynchronousRequestResponseHandler handler)
handler
-