lumis.portal.servicecontainer
Class ReplaceInterfacesStorage

Package class diagram package ReplaceInterfacesStorage
java.lang.Object
  extended by lumis.portal.servicecontainer.ReplaceInterfacesStorage

public class ReplaceInterfacesStorage
extends Object

Storage for replace interfaces.

Since:
7.0.0

Constructor Summary
ReplaceInterfacesStorage(String replaceInterfacesStr)
          Constructs a new storage with the given string.
 
Method Summary
 Map<String,String> getMap()
          Returns the replace map.
protected  String getReplaceInterfaceParametersParameterName()
           
 String getStackTopByExistentItem(String item)
          Returns the top of replace stack by a given item.
 String getStateString()
          Returns the state of replace interface information as a string in the format for PortalRequestParameters.PAGE_PARAMETER_REPLACE_INTERFACES_STATE.
 String handleReplaceInterfaceOperations(String currentInterfaceInstanceId, String[] replaceInterfaceOperations, PortalRequestParameters parameters)
          Handles the replace interface commands.
 String put(String source, String target)
          Creates a new replace mapping source -> target.
 String remove(String item)
          Removes the given interface instance from the replace map (searching it as the mapping key).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceInterfacesStorage

public ReplaceInterfacesStorage(String replaceInterfacesStr)
                         throws UnsupportedEncodingException
Constructs a new storage with the given string.

The string must be formatted as following:
originInterfaceInstance=destinationInterfaceInstance(;originInterfaceInstance=destinationInterfaceInstance)*
Where:

If the given string is null or empty no interface instance is being replaced.

Parameters:
replaceInterfacesStr - the string of replaces.
Throws:
UnsupportedEncodingException
Since:
7.0.0
Method Detail

getStateString

public String getStateString()
Returns the state of replace interface information as a string in the format for PortalRequestParameters.PAGE_PARAMETER_REPLACE_INTERFACES_STATE.

Returns:
the state of replace interface information as a string in the format for PortalRequestParameters.PAGE_PARAMETER_REPLACE_INTERFACES_STATE.
Since:
7.0.0

getMap

public Map<String,String> getMap()
Returns the replace map.

Returns:
the replace map.
Since:
7.0.0

getStackTopByExistentItem

public String getStackTopByExistentItem(String item)
Returns the top of replace stack by a given item.

Parameters:
item - the item used to search in the map.
Returns:
the top of replace stack by a given item.
Since:
7.0.0

remove

public String remove(String item)
Removes the given interface instance from the replace map (searching it as the mapping key).

Parameters:
item - the item to be removed.
Returns:
the result of Map.remove(Object).
Since:
7.0.0

put

public String put(String source,
                  String target)
Creates a new replace mapping source -> target.

Parameters:
source - the interface instance that is going to be replaced.
target - the interface instance that is going to replace.
Returns:
the result of Map.put(Object, Object).
Since:
7.0.0

handleReplaceInterfaceOperations

public String handleReplaceInterfaceOperations(String currentInterfaceInstanceId,
                                               String[] replaceInterfaceOperations,
                                               PortalRequestParameters parameters)
                                        throws PortalException
Handles the replace interface commands. Also applies the properly parameters in PortalRequestParameters if needed. Returns the result interface instance after the commands are applied. The commands are formatted in a string array. Each command string may have multiple commands separated by a ',' character.

The supported commands are:

Parameters:
currentInterfaceInstanceId - the current interface instance.
replaceInterfaceOperations - the replace commands array.
parameters - the replace interface parameters.
Returns:
the result interface instance after the commands are applied.
Throws:
PortalException
Since:
7.0.0

getReplaceInterfaceParametersParameterName

protected String getReplaceInterfaceParametersParameterName()


Lumisportal  7.0.0.121130 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.