ariba.util.http.multitab
Class NoMultiTabSupport

java.lang.Object
  extended by ariba.util.http.multitab.NoMultiTabSupport
All Implemented Interfaces:
MultiTabSupport

public class NoMultiTabSupport
extends java.lang.Object
implements MultiTabSupport

This is dummy implementation for the multitab. We can see this as a empty shell that only bypasses the request to normal processing


Nested Class Summary
static class NoMultiTabSupport.ByPassHandler
           
 
Nested classes/interfaces inherited from interface ariba.util.http.multitab.MultiTabSupport
MultiTabSupport.Instance
 
Constructor Summary
NoMultiTabSupport()
           
 
Method Summary
 java.lang.String defaultTabPrefix()
          Returns a string that help us differentiate between Tabbed and non Tabbed URI.
 MultiTabHandler handlerClassForName(java.lang.String name)
           
 MultiTabHandler initHandler(RequestProcessor requestProcessor, javax.servlet.http.HttpServletRequest request)
          creates request specific handler.
 java.lang.String insertTabInUri(java.lang.String untabbedUrl, int tabIndex, boolean isNotZero)
          Inserts the tab into the untabbedUrl, if a tab was found in tabbedUrl.
 boolean isMultiTabEnabled()
          Provides information if the multitab is enabled in the system
 int maximumNumberOfTabs()
          Defines max number of tabs system allows to be opened at the same time
 void processRequest(MultiTabHandler.RequestInfo data, MultiTabHandler multiTabHandlerCallback)
          Determine the state of the request and return what multi-tab related action should be taken by the caller.
 void registerHandlerClassForName(java.lang.String name, java.lang.Class<? extends MultiTabHandler> handler)
          Factory methods to register a handler and to retrieve.
 java.lang.String stripTabFromUri(java.lang.String uri)
          Removes the tab # from the URI.
 java.lang.String tabNumberToUri(java.lang.String servletName, java.lang.String applicationNameSuffix, int tabIndex, java.lang.String uri)
          If the tab index is more than ZERO, apply your customer naming scheme to identify your tab URI
 int uriToTabNumber(java.lang.String uri, int defaultTab)
          Attempts to parse the tab number from the provided URI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoMultiTabSupport

public NoMultiTabSupport()
Method Detail

insertTabInUri

public java.lang.String insertTabInUri(java.lang.String untabbedUrl,
                                       int tabIndex,
                                       boolean isNotZero)
Description copied from interface: MultiTabSupport
Inserts the tab into the untabbedUrl, if a tab was found in tabbedUrl. Noop, if onlyWhenPositive is true and tabIndex is zero.

Specified by:
insertTabInUri in interface MultiTabSupport
Parameters:
untabbedUrl - An untabbed relative or absolute request URI.
tabIndex - The tab to insert.
isNotZero - Only calls replace when the tabIndex is not ZERO.
Returns:
The modified URI.

stripTabFromUri

public java.lang.String stripTabFromUri(java.lang.String uri)
Description copied from interface: MultiTabSupport
Removes the tab # from the URI.

Specified by:
stripTabFromUri in interface MultiTabSupport
Parameters:
uri - The URI to evaluate.
Returns:
A URI without any tab info.

maximumNumberOfTabs

public int maximumNumberOfTabs()
Description copied from interface: MultiTabSupport
Defines max number of tabs system allows to be opened at the same time

Specified by:
maximumNumberOfTabs in interface MultiTabSupport
Returns:
Max defined number of tabs.

uriToTabNumber

public int uriToTabNumber(java.lang.String uri,
                          int defaultTab)
Description copied from interface: MultiTabSupport
Attempts to parse the tab number from the provided URI. Returns tab defaultTab if UnexpectedTabException was thrown.

Specified by:
uriToTabNumber in interface MultiTabSupport
Parameters:
uri - The URI to evaluate.
defaultTab - The default tab, when an exception happens.
Returns:
The tab number, default, or 0.

tabNumberToUri

public java.lang.String tabNumberToUri(java.lang.String servletName,
                                       java.lang.String applicationNameSuffix,
                                       int tabIndex,
                                       java.lang.String uri)
Description copied from interface: MultiTabSupport
If the tab index is more than ZERO, apply your customer naming scheme to identify your tab URI

Specified by:
tabNumberToUri in interface MultiTabSupport
Parameters:
servletName - The name of the servlet.
applicationNameSuffix - Usually, "/", but allows for modifications to the servlet name.
tabIndex - The tab index to evaluate.
Returns:
The concatenated tab-aware servlet-name.

isMultiTabEnabled

public boolean isMultiTabEnabled()
Description copied from interface: MultiTabSupport
Provides information if the multitab is enabled in the system

Specified by:
isMultiTabEnabled in interface MultiTabSupport
Returns:
true if MultiTab is enabled

processRequest

public void processRequest(MultiTabHandler.RequestInfo data,
                           MultiTabHandler multiTabHandlerCallback)
                    throws java.io.IOException
Description copied from interface: MultiTabSupport
Determine the state of the request and return what multi-tab related action should be taken by the caller.

Specified by:
processRequest in interface MultiTabSupport
Parameters:
data - A data wrapper.
multiTabHandlerCallback - A class implementing MultiTab.
Throws:
java.io.IOException

defaultTabPrefix

public java.lang.String defaultTabPrefix()
Description copied from interface: MultiTabSupport
Returns a string that help us differentiate between Tabbed and non Tabbed URI.

Specified by:
defaultTabPrefix in interface MultiTabSupport
Returns:

initHandler

public MultiTabHandler initHandler(RequestProcessor requestProcessor,
                                   javax.servlet.http.HttpServletRequest request)
                            throws java.io.IOException
Description copied from interface: MultiTabSupport
creates request specific handler. This method stores current handler in the ThreadLocal which is not the best way how to handle temp info for the request. Probably next task will be some refactoring to this. Especially for servlet 3.0 where the same thread can be reused for processing another concurrent request. something like NIO.

Specified by:
initHandler in interface MultiTabSupport
Throws:
java.io.IOException

registerHandlerClassForName

public void registerHandlerClassForName(java.lang.String name,
                                        java.lang.Class<? extends MultiTabHandler> handler)
Description copied from interface: MultiTabSupport
Factory methods to register a handler and to retrieve. We had to introduce this due to the package dependencies. Therefore we have a common place usually in the APP that registers handlers and one place we do lookup.

Specified by:
registerHandlerClassForName in interface MultiTabSupport

handlerClassForName

public MultiTabHandler handlerClassForName(java.lang.String name)
Specified by:
handlerClassForName in interface MultiTabSupport


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.