test_class.file: cosmic-core/server/src/test/java/com/cloud/servlet/ConsoleProxyServletTest.java
test_class.identifier: ConsoleProxyServletTest
test_case.body: @Test
      public void escapeHTML() {
          Assert.assertNull(ConsoleProxyServlet.escapeHTML(null));
          Assert.assertEquals("", ConsoleProxyServlet.escapeHTML(""));
          Assert.assertEquals("&lt;strangevmname&gt;",
                  ConsoleProxyServlet.escapeHTML("<strangevmname>"));
          Assert.assertEquals("&quot;strange&nbsp;vm&quot;",
                  ConsoleProxyServlet.escapeHTML("\"strange vm\""));
          Assert.assertEquals("Nothing-extraordinary-anyway.",
                  ConsoleProxyServlet.escapeHTML("Nothing-extraordinary-anyway."));
      }
test_case.class_method_signature: ConsoleProxyServletTest.escapeHTML()
test_case.full_signature: @Test public void escapeHTML()
test_case.identifier: escapeHTML
test_case.invocations: assertNull escapeHTML assertEquals escapeHTML assertEquals escapeHTML assertEquals escapeHTML assertEquals escapeHTML
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void escapeHTML()
focal_class.declarator: s_logger = LoggerFactory.getLogger(ConsoleProxyServlet.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(ConsoleProxyServlet.class.getName());
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: DEFAULT_THUMBNAIL_WIDTH = 144
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_THUMBNAIL_WIDTH = 144;
focal_class.type: int
focal_class.var_name: DEFAULT_THUMBNAIL_WIDTH
focal_class.declarator: DEFAULT_THUMBNAIL_HEIGHT = 110
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_THUMBNAIL_HEIGHT = 110;
focal_class.type: int
focal_class.var_name: DEFAULT_THUMBNAIL_HEIGHT
focal_class.declarator: s_keysMgr
focal_class.modifier: static
focal_class.original_string: static KeysManager s_keysMgr;
focal_class.type: KeysManager
focal_class.var_name: s_keysMgr
focal_class.declarator: _gson = new GsonBuilder().create()
focal_class.modifier: private final
focal_class.original_string: private final Gson _gson = new GsonBuilder().create();
focal_class.type: Gson
focal_class.var_name: _gson
focal_class.declarator: _accountMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      AccountManager _accountMgr;
focal_class.type: AccountManager
focal_class.var_name: _accountMgr
focal_class.declarator: _vmMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      VirtualMachineManager _vmMgr;
focal_class.type: VirtualMachineManager
focal_class.var_name: _vmMgr
focal_class.declarator: _ms
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      ManagementServer _ms;
focal_class.type: ManagementServer
focal_class.var_name: _ms
focal_class.declarator: _entityMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      EntityManager _entityMgr;
focal_class.type: EntityManager
focal_class.var_name: _entityMgr
focal_class.declarator: _userVmDetailsDao
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      UserVmDetailsDao _userVmDetailsDao;
focal_class.type: UserVmDetailsDao
focal_class.var_name: _userVmDetailsDao
focal_class.declarator: _keysMgr
focal_class.modifier: @Inject
focal_class.original_string: @Inject
      KeysManager _keysMgr;
focal_class.type: KeysManager
focal_class.var_name: _keysMgr
focal_class.file: cosmic-core/server/src/main/java/com/cloud/servlet/ConsoleProxyServlet.java
focal_class.identifier: ConsoleProxyServlet
focal_class.class_method_signature: ConsoleProxyServlet.ConsoleProxyServlet()
focal_class.full_signature: public  ConsoleProxyServlet()
focal_class.identifier: ConsoleProxyServlet
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ConsoleProxyServlet()
focal_class.class_method_signature: ConsoleProxyServlet.parseHostInfo(final String hostInfo)
focal_class.full_signature: static public Ternary<String, String, String> parseHostInfo(final String hostInfo)
focal_class.identifier: parseHostInfo
focal_class.modifiers: static public
focal_class.parameters: (final String hostInfo)
focal_class.return: Ternary<String, String, String>
focal_class.signature: Ternary<String, String, String> parseHostInfo(final String hostInfo)
focal_class.class_method_signature: ConsoleProxyServlet.genAccessTicket(final String host, final String port, final String sid, final String tag)
focal_class.full_signature: public static String genAccessTicket(final String host, final String port, final String sid, final String tag)
focal_class.identifier: genAccessTicket
focal_class.modifiers: public static
focal_class.parameters: (final String host, final String port, final String sid, final String tag)
focal_class.return: String
focal_class.signature: String genAccessTicket(final String host, final String port, final String sid, final String tag)
focal_class.class_method_signature: ConsoleProxyServlet.genAccessTicket(final String host, final String port, final String sid, final String tag, final Date normalizedHashTime)
focal_class.full_signature: public static String genAccessTicket(final String host, final String port, final String sid, final String tag, final Date normalizedHashTime)
focal_class.identifier: genAccessTicket
focal_class.modifiers: public static
focal_class.parameters: (final String host, final String port, final String sid, final String tag, final Date normalizedHashTime)
focal_class.return: String
focal_class.signature: String genAccessTicket(final String host, final String port, final String sid, final String tag, final Date normalizedHashTime)
focal_class.class_method_signature: ConsoleProxyServlet.escapeHTML(final String content)
focal_class.full_signature: public static final String escapeHTML(final String content)
focal_class.identifier: escapeHTML
focal_class.modifiers: public static final
focal_class.parameters: (final String content)
focal_class.return: String
focal_class.signature: String escapeHTML(final String content)
focal_class.class_method_signature: ConsoleProxyServlet.init(final ServletConfig config)
focal_class.full_signature: @Override public void init(final ServletConfig config)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (final ServletConfig config)
focal_class.return: void
focal_class.signature: void init(final ServletConfig config)
focal_class.class_method_signature: ConsoleProxyServlet.doGet(final HttpServletRequest req, final HttpServletResponse resp)
focal_class.full_signature: @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
focal_class.identifier: doGet
focal_class.modifiers: @Override protected
focal_class.parameters: (final HttpServletRequest req, final HttpServletResponse resp)
focal_class.return: void
focal_class.signature: void doGet(final HttpServletRequest req, final HttpServletResponse resp)
focal_class.class_method_signature: ConsoleProxyServlet.doPost(final HttpServletRequest req, final HttpServletResponse resp)
focal_class.full_signature: @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
focal_class.identifier: doPost
focal_class.modifiers: @Override protected
focal_class.parameters: (final HttpServletRequest req, final HttpServletResponse resp)
focal_class.return: void
focal_class.signature: void doPost(final HttpServletRequest req, final HttpServletResponse resp)
focal_class.class_method_signature: ConsoleProxyServlet.handleThumbnailRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.full_signature: private void handleThumbnailRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.identifier: handleThumbnailRequest
focal_class.modifiers: private
focal_class.parameters: (final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.return: void
focal_class.signature: void handleThumbnailRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.class_method_signature: ConsoleProxyServlet.handleAccessRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.full_signature: private void handleAccessRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.identifier: handleAccessRequest
focal_class.modifiers: private
focal_class.parameters: (final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.return: void
focal_class.signature: void handleAccessRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.class_method_signature: ConsoleProxyServlet.handleAuthRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.full_signature: private void handleAuthRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.identifier: handleAuthRequest
focal_class.modifiers: private
focal_class.parameters: (final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.return: void
focal_class.signature: void handleAuthRequest(final HttpServletRequest req, final HttpServletResponse resp, final long vmId)
focal_class.class_method_signature: ConsoleProxyServlet.getEncryptorPassword()
focal_class.full_signature: private String getEncryptorPassword()
focal_class.identifier: getEncryptorPassword
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getEncryptorPassword()
focal_class.class_method_signature: ConsoleProxyServlet.composeThumbnailUrl(final String rootUrl, final VirtualMachine vm, final HostVO hostVo, final int w, final int h)
focal_class.full_signature: private String composeThumbnailUrl(final String rootUrl, final VirtualMachine vm, final HostVO hostVo, final int w, final int h)
focal_class.identifier: composeThumbnailUrl
focal_class.modifiers: private
focal_class.parameters: (final String rootUrl, final VirtualMachine vm, final HostVO hostVo, final int w, final int h)
focal_class.return: String
focal_class.signature: String composeThumbnailUrl(final String rootUrl, final VirtualMachine vm, final HostVO hostVo, final int w, final int h)
focal_class.class_method_signature: ConsoleProxyServlet.composeConsoleAccessUrl(final String rootUrl, final VirtualMachine vm, final HostVO hostVo)
focal_class.full_signature: private String composeConsoleAccessUrl(final String rootUrl, final VirtualMachine vm, final HostVO hostVo)
focal_class.identifier: composeConsoleAccessUrl
focal_class.modifiers: private
focal_class.parameters: (final String rootUrl, final VirtualMachine vm, final HostVO hostVo)
focal_class.return: String
focal_class.signature: String composeConsoleAccessUrl(final String rootUrl, final VirtualMachine vm, final HostVO hostVo)
focal_class.class_method_signature: ConsoleProxyServlet.sendResponse(final HttpServletResponse resp, final String content)
focal_class.full_signature: private void sendResponse(final HttpServletResponse resp, final String content)
focal_class.identifier: sendResponse
focal_class.modifiers: private
focal_class.parameters: (final HttpServletResponse resp, final String content)
focal_class.return: void
focal_class.signature: void sendResponse(final HttpServletResponse resp, final String content)
focal_class.class_method_signature: ConsoleProxyServlet.checkSessionPermision(final HttpServletRequest req, final long vmId, final Account accountObj)
focal_class.full_signature: private boolean checkSessionPermision(final HttpServletRequest req, final long vmId, final Account accountObj)
focal_class.identifier: checkSessionPermision
focal_class.modifiers: private
focal_class.parameters: (final HttpServletRequest req, final long vmId, final Account accountObj)
focal_class.return: boolean
focal_class.signature: boolean checkSessionPermision(final HttpServletRequest req, final long vmId, final Account accountObj)
focal_class.class_method_signature: ConsoleProxyServlet.isValidCmd(final String cmd)
focal_class.full_signature: private boolean isValidCmd(final String cmd)
focal_class.identifier: isValidCmd
focal_class.modifiers: private
focal_class.parameters: (final String cmd)
focal_class.return: boolean
focal_class.signature: boolean isValidCmd(final String cmd)
focal_class.class_method_signature: ConsoleProxyServlet.verifyUser(final Long userId)
focal_class.full_signature: public boolean verifyUser(final Long userId)
focal_class.identifier: verifyUser
focal_class.modifiers: public
focal_class.parameters: (final Long userId)
focal_class.return: boolean
focal_class.signature: boolean verifyUser(final Long userId)
focal_class.class_method_signature: ConsoleProxyServlet.verifyRequest(final Map<String, Object[]> requestParameters)
focal_class.full_signature: private boolean verifyRequest(final Map<String, Object[]> requestParameters)
focal_class.identifier: verifyRequest
focal_class.modifiers: private
focal_class.parameters: (final Map<String, Object[]> requestParameters)
focal_class.return: boolean
focal_class.signature: boolean verifyRequest(final Map<String, Object[]> requestParameters)
focal_class.superclass: extends HttpServlet
focal_method.body: public static final String escapeHTML(final String content) {
          if (content == null || content.isEmpty()) {
              return content;
          }
  
          final StringBuilder sb = new StringBuilder();
          for (int i = 0; i < content.length(); i++) {
              final char c = content.charAt(i);
              switch (c) {
                  case '<':
                      sb.append("&lt;");
                      break;
                  case '>':
                      sb.append("&gt;");
                      break;
                  case '&':
                      sb.append("&amp;");
                      break;
                  case '"':
                      sb.append("&quot;");
                      break;
                  case ' ':
                      sb.append("&nbsp;");
                      break;
                  default:
                      sb.append(c);
                      break;
              }
          }
          return sb.toString();
      }
focal_method.class_method_signature: ConsoleProxyServlet.escapeHTML(final String content)
focal_method.full_signature: public static final String escapeHTML(final String content)
focal_method.identifier: escapeHTML
focal_method.invocations: isEmpty length charAt append append append append append append toString
focal_method.modifiers: public static final
focal_method.parameters: (final String content)
focal_method.return: String
focal_method.signature: String escapeHTML(final String content)