test_class.declarator: STATE_UPDATE_WAIT_TIME = 100
test_class.modifier: private static final
test_class.original_string: private static final int STATE_UPDATE_WAIT_TIME = 100;
test_class.type: int
test_class.var_name: STATE_UPDATE_WAIT_TIME
test_class.declarator: HTTP_HEADER_X_ATMOSPHERE_TRANSPORT = "X-Atmosphere-Transport"
test_class.modifier: private static final
test_class.original_string: private static final String HTTP_HEADER_X_ATMOSPHERE_TRANSPORT = "X-Atmosphere-Transport";
test_class.type: String
test_class.var_name: HTTP_HEADER_X_ATMOSPHERE_TRANSPORT
test_class.declarator: ITEM_NAME = "itemName"
test_class.modifier: private static final
test_class.original_string: private static final String ITEM_NAME = "itemName";
test_class.type: String
test_class.var_name: ITEM_NAME
test_class.declarator: SITEMAP_PATH = "/sitemaps"
test_class.modifier: private static final
test_class.original_string: private static final String SITEMAP_PATH = "/sitemaps";
test_class.type: String
test_class.var_name: SITEMAP_PATH
test_class.declarator: SITEMAP_MODEL_NAME = "sitemapModel"
test_class.modifier: private static final
test_class.original_string: private static final String SITEMAP_MODEL_NAME = "sitemapModel";
test_class.type: String
test_class.var_name: SITEMAP_MODEL_NAME
test_class.declarator: SITEMAP_NAME = "defaultSitemap"
test_class.modifier: private static final
test_class.original_string: private static final String SITEMAP_NAME = "defaultSitemap";
test_class.type: String
test_class.var_name: SITEMAP_NAME
test_class.declarator: SITEMAP_TITLE = "Default Sitemap"
test_class.modifier: private static final
test_class.original_string: private static final String SITEMAP_TITLE = "Default Sitemap";
test_class.type: String
test_class.var_name: SITEMAP_TITLE
test_class.declarator: VISIBILITY_RULE_ITEM_NAME = "visibilityRuleItem"
test_class.modifier: private static final
test_class.original_string: private static final String VISIBILITY_RULE_ITEM_NAME = "visibilityRuleItem";
test_class.type: String
test_class.var_name: VISIBILITY_RULE_ITEM_NAME
test_class.declarator: LABEL_COLOR_ITEM_NAME = "labelColorItemName"
test_class.modifier: private static final
test_class.original_string: private static final String LABEL_COLOR_ITEM_NAME = "labelColorItemName";
test_class.type: String
test_class.var_name: LABEL_COLOR_ITEM_NAME
test_class.declarator: VALUE_COLOR_ITEM_NAME = "valueColorItemName"
test_class.modifier: private static final
test_class.original_string: private static final String VALUE_COLOR_ITEM_NAME = "valueColorItemName";
test_class.type: String
test_class.var_name: VALUE_COLOR_ITEM_NAME
test_class.declarator: WIDGET1_LABEL = "widget 1"
test_class.modifier: private static final
test_class.original_string: private static final String WIDGET1_LABEL = "widget 1";
test_class.type: String
test_class.var_name: WIDGET1_LABEL
test_class.declarator: WIDGET2_LABEL = "widget 2"
test_class.modifier: private static final
test_class.original_string: private static final String WIDGET2_LABEL = "widget 2";
test_class.type: String
test_class.var_name: WIDGET2_LABEL
test_class.declarator: WIDGET1_ID = "00"
test_class.modifier: private static final
test_class.original_string: private static final String WIDGET1_ID = "00";
test_class.type: String
test_class.var_name: WIDGET1_ID
test_class.declarator: WIDGET2_ID = "01"
test_class.modifier: private static final
test_class.original_string: private static final String WIDGET2_ID = "01";
test_class.type: String
test_class.var_name: WIDGET2_ID
test_class.declarator: CLIENT_IP = "127.0.0.1"
test_class.modifier: private static final
test_class.original_string: private static final String CLIENT_IP = "127.0.0.1";
test_class.type: String
test_class.var_name: CLIENT_IP
test_class.declarator: sitemapResource
test_class.modifier: private
test_class.original_string: private SitemapResource sitemapResource;
test_class.type: SitemapResource
test_class.var_name: sitemapResource
test_class.declarator: headers
test_class.modifier: private @Mock
test_class.original_string: private @Mock HttpHeaders headers;
test_class.type: HttpHeaders
test_class.var_name: headers
test_class.declarator: defaultSitemap
test_class.modifier: private @Mock
test_class.original_string: private @Mock Sitemap defaultSitemap;
test_class.type: Sitemap
test_class.var_name: defaultSitemap
test_class.declarator: itemUIRegistry
test_class.modifier: private @Mock
test_class.original_string: private @Mock ItemUIRegistry itemUIRegistry;
test_class.type: ItemUIRegistry
test_class.var_name: itemUIRegistry
test_class.declarator: localeService
test_class.modifier: private @Mock
test_class.original_string: private @Mock LocaleService localeService;
test_class.type: LocaleService
test_class.var_name: localeService
test_class.declarator: request
test_class.modifier: private @Mock
test_class.original_string: private @Mock HttpServletRequest request;
test_class.type: HttpServletRequest
test_class.var_name: request
test_class.declarator: sitemapProvider
test_class.modifier: private @Mock
test_class.original_string: private @Mock SitemapProvider sitemapProvider;
test_class.type: SitemapProvider
test_class.var_name: sitemapProvider
test_class.declarator: subscriptions
test_class.modifier: private @Mock
test_class.original_string: private @Mock SitemapSubscriptionService subscriptions;
test_class.type: SitemapSubscriptionService
test_class.var_name: subscriptions
test_class.declarator: uriInfo
test_class.modifier: private @Mock
test_class.original_string: private @Mock UriInfo uriInfo;
test_class.type: UriInfo
test_class.var_name: uriInfo
test_class.declarator: item
test_class.modifier: private
test_class.original_string: private GenericItem item;
test_class.type: GenericItem
test_class.var_name: item
test_class.declarator: visibilityRuleItem
test_class.modifier: private
test_class.original_string: private GenericItem visibilityRuleItem;
test_class.type: GenericItem
test_class.var_name: visibilityRuleItem
test_class.declarator: labelColorItem
test_class.modifier: private
test_class.original_string: private GenericItem labelColorItem;
test_class.type: GenericItem
test_class.var_name: labelColorItem
test_class.declarator: valueColorItem
test_class.modifier: private
test_class.original_string: private GenericItem valueColorItem;
test_class.type: GenericItem
test_class.var_name: valueColorItem
test_class.declarator: widgets
test_class.modifier: private
test_class.original_string: private EList<Widget> widgets;
test_class.type: EList<Widget>
test_class.var_name: widgets
test_class.file: bundles/org.openhab.core.io.rest.sitemap/src/test/java/org/openhab/core/io/rest/sitemap/internal/SitemapResourceTest.java
test_class.identifier: SitemapResourceTest
test_class.superclass: extends JavaTest
test_case.body: @Test
      public void whenLongPollingShouldObserveItemsFromLabelColorConditions() {
          new Thread(() -> {
              try {
                  Thread.sleep(STATE_UPDATE_WAIT_TIME); // wait for the #getPageData call and listeners to attach to the
                                                        // item
                  labelColorItem.setState(new DecimalType(BigDecimal.ONE));
              } catch (InterruptedException e) {
              }
          }).start();
  
          // non-null is sufficient here.
          when(headers.getRequestHeader(HTTP_HEADER_X_ATMOSPHERE_TRANSPORT)).thenReturn(List.of());
  
          Response response = sitemapResource.getPageData(headers, null, SITEMAP_MODEL_NAME, SITEMAP_NAME, null, false);
  
          PageDTO pageDTO = (PageDTO) response.getEntity();
          assertThat(pageDTO.timeout, is(false)); // assert that the item state change did trigger the blocking method to
                                                  // return
      }
test_case.class_method_signature: SitemapResourceTest.whenLongPollingShouldObserveItemsFromLabelColorConditions()
test_case.full_signature: @Test public void whenLongPollingShouldObserveItemsFromLabelColorConditions()
test_case.identifier: whenLongPollingShouldObserveItemsFromLabelColorConditions
test_case.invocations: start sleep setState thenReturn when getRequestHeader of getPageData getEntity assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void whenLongPollingShouldObserveItemsFromLabelColorConditions()
focal_class.declarator: logger = LoggerFactory.getLogger(SitemapResource.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(SitemapResource.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: PATH_SITEMAPS = "sitemaps"
focal_class.modifier: public static final
focal_class.original_string: public static final String PATH_SITEMAPS = "sitemaps";
focal_class.type: String
focal_class.var_name: PATH_SITEMAPS
focal_class.declarator: SEGMENT_EVENTS = "events"
focal_class.modifier: private static final
focal_class.original_string: private static final String SEGMENT_EVENTS = "events";
focal_class.type: String
focal_class.var_name: SEGMENT_EVENTS
focal_class.declarator: X_ACCEL_BUFFERING_HEADER = "X-Accel-Buffering"
focal_class.modifier: private static final
focal_class.original_string: private static final String X_ACCEL_BUFFERING_HEADER = "X-Accel-Buffering";
focal_class.type: String
focal_class.var_name: X_ACCEL_BUFFERING_HEADER
focal_class.declarator: TIMEOUT_IN_MS = 30000
focal_class.modifier: private static final
focal_class.original_string: private static final long TIMEOUT_IN_MS = 30000;
focal_class.type: long
focal_class.var_name: TIMEOUT_IN_MS
focal_class.declarator: broadcaster
focal_class.modifier: private
focal_class.original_string: private SseBroadcaster<@NonNull SseSinkInfo> broadcaster;
focal_class.type: SseBroadcaster<@NonNull SseSinkInfo>
focal_class.var_name: broadcaster
focal_class.declarator: uriInfo
focal_class.modifier: @Context
      @NonNullByDefault({})
focal_class.original_string: @Context
      @NonNullByDefault({})
      UriInfo uriInfo;
focal_class.type: UriInfo
focal_class.var_name: uriInfo
focal_class.declarator: request
focal_class.modifier: @Context
      @NonNullByDefault({})
focal_class.original_string: @Context
      @NonNullByDefault({})
      HttpServletRequest request;
focal_class.type: HttpServletRequest
focal_class.var_name: request
focal_class.declarator: response
focal_class.modifier: @Context
      @NonNullByDefault({})
focal_class.original_string: @Context
      @NonNullByDefault({})
      HttpServletResponse response;
focal_class.type: HttpServletResponse
focal_class.var_name: response
focal_class.declarator: sse
focal_class.modifier: @Context
      @NonNullByDefault({})
focal_class.original_string: @Context
      @NonNullByDefault({})
      Sse sse;
focal_class.type: Sse
focal_class.var_name: sse
focal_class.declarator: itemUIRegistry
focal_class.modifier: private final
focal_class.original_string: private final ItemUIRegistry itemUIRegistry;
focal_class.type: ItemUIRegistry
focal_class.var_name: itemUIRegistry
focal_class.declarator: subscriptions
focal_class.modifier: private final
focal_class.original_string: private final SitemapSubscriptionService subscriptions;
focal_class.type: SitemapSubscriptionService
focal_class.var_name: subscriptions
focal_class.declarator: localeService
focal_class.modifier: private final
focal_class.original_string: private final LocaleService localeService;
focal_class.type: LocaleService
focal_class.var_name: localeService
focal_class.declarator: sitemapProviders = new ArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final java.util.List<SitemapProvider> sitemapProviders = new ArrayList<>();
focal_class.type: java.util.List<SitemapProvider>
focal_class.var_name: sitemapProviders
focal_class.declarator: knownSubscriptions = new MapMaker().weakValues().makeMap()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, SseSinkInfo> knownSubscriptions = new MapMaker().weakValues().makeMap();
focal_class.type: Map<String, SseSinkInfo>
focal_class.var_name: knownSubscriptions
focal_class.declarator: scheduler = ThreadPoolManager
              .getScheduledPool(ThreadPoolManager.THREAD_POOL_NAME_COMMON)
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService scheduler = ThreadPoolManager
              .getScheduledPool(ThreadPoolManager.THREAD_POOL_NAME_COMMON);
focal_class.type: ScheduledExecutorService
focal_class.var_name: scheduler
focal_class.declarator: cleanSubscriptionsJob
focal_class.modifier: private @Nullable
focal_class.original_string: private @Nullable ScheduledFuture<?> cleanSubscriptionsJob;
focal_class.type: ScheduledFuture<?>
focal_class.var_name: cleanSubscriptionsJob
focal_class.file: bundles/org.openhab.core.io.rest.sitemap/src/main/java/org/openhab/core/io/rest/sitemap/internal/SitemapResource.java
focal_class.identifier: SitemapResource
focal_class.interfaces: implements RESTResource, SitemapSubscriptionCallback, SseBroadcaster.Listener<SseSinkInfo>
focal_class.class_method_signature: SitemapResource.SitemapResource( //
              final @Reference ItemUIRegistry itemUIRegistry, //
              final @Reference LocaleService localeService, //
              final @Reference SitemapSubscriptionService subscriptions)
focal_class.full_signature: @Activate public  SitemapResource( //
              final @Reference ItemUIRegistry itemUIRegistry, //
              final @Reference LocaleService localeService, //
              final @Reference SitemapSubscriptionService subscriptions)
focal_class.identifier: SitemapResource
focal_class.modifiers: @Activate public
focal_class.parameters: ( //
              final @Reference ItemUIRegistry itemUIRegistry, //
              final @Reference LocaleService localeService, //
              final @Reference SitemapSubscriptionService subscriptions)
focal_class.signature:  SitemapResource( //
              final @Reference ItemUIRegistry itemUIRegistry, //
              final @Reference LocaleService localeService, //
              final @Reference SitemapSubscriptionService subscriptions)
focal_class.class_method_signature: SitemapResource.deactivate()
focal_class.full_signature: @Deactivate protected void deactivate()
focal_class.identifier: deactivate
focal_class.modifiers: @Deactivate protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deactivate()
focal_class.class_method_signature: SitemapResource.addSitemapProvider(SitemapProvider provider)
focal_class.full_signature: @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) public void addSitemapProvider(SitemapProvider provider)
focal_class.identifier: addSitemapProvider
focal_class.modifiers: @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) public
focal_class.parameters: (SitemapProvider provider)
focal_class.return: void
focal_class.signature: void addSitemapProvider(SitemapProvider provider)
focal_class.class_method_signature: SitemapResource.removeSitemapProvider(SitemapProvider provider)
focal_class.full_signature: public void removeSitemapProvider(SitemapProvider provider)
focal_class.identifier: removeSitemapProvider
focal_class.modifiers: public
focal_class.parameters: (SitemapProvider provider)
focal_class.return: void
focal_class.signature: void removeSitemapProvider(SitemapProvider provider)
focal_class.class_method_signature: SitemapResource.getSitemaps()
focal_class.full_signature: @GET @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Get all available sitemaps.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SitemapDTO.class)))) }) public Response getSitemaps()
focal_class.identifier: getSitemaps
focal_class.modifiers: @GET @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Get all available sitemaps.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(array = @ArraySchema(schema = @Schema(implementation = SitemapDTO.class)))) }) public
focal_class.parameters: ()
focal_class.return: Response
focal_class.signature: Response getSitemaps()
focal_class.class_method_signature: SitemapResource.getSitemapData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @QueryParam("type") String type, @QueryParam("jsoncallback") @DefaultValue("callback") String callback,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.full_signature: @GET @Path("/{sitemapname: [a-zA-Z_0-9]+}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Get sitemap by name.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SitemapDTO.class))) }) public Response getSitemapData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @QueryParam("type") String type, @QueryParam("jsoncallback") @DefaultValue("callback") String callback,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.identifier: getSitemapData
focal_class.modifiers: @GET @Path("/{sitemapname: [a-zA-Z_0-9]+}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Get sitemap by name.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SitemapDTO.class))) }) public
focal_class.parameters: (@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @QueryParam("type") String type, @QueryParam("jsoncallback") @DefaultValue("callback") String callback,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.return: Response
focal_class.signature: Response getSitemapData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @QueryParam("type") String type, @QueryParam("jsoncallback") @DefaultValue("callback") String callback,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.class_method_signature: SitemapResource.getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.full_signature: @GET @Path("/{sitemapname: [a-zA-Z_0-9]+}/{pageid: [a-zA-Z_0-9]+}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Polls the data for a sitemap.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PageDTO.class))), @ApiResponse(responseCode = "404", description = "Sitemap with requested name does not exist or page does not exist, or page refers to a non-linkable widget"), @ApiResponse(responseCode = "400", description = "Invalid subscription id has been provided.") }) public Response getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.identifier: getPageData
focal_class.modifiers: @GET @Path("/{sitemapname: [a-zA-Z_0-9]+}/{pageid: [a-zA-Z_0-9]+}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Polls the data for a sitemap.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PageDTO.class))), @ApiResponse(responseCode = "404", description = "Sitemap with requested name does not exist or page does not exist, or page refers to a non-linkable widget"), @ApiResponse(responseCode = "400", description = "Invalid subscription id has been provided.") }) public
focal_class.parameters: (@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.return: Response
focal_class.signature: Response getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_class.class_method_signature: SitemapResource.createEventSubscription()
focal_class.full_signature: @POST @Path(SEGMENT_EVENTS + "/subscribe") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Creates a sitemap event subscription.", responses = { @ApiResponse(responseCode = "201", description = "Subscription created."), @ApiResponse(responseCode = "503", description = "Subscriptions limit reached.") }) public Object createEventSubscription()
focal_class.identifier: createEventSubscription
focal_class.modifiers: @POST @Path(SEGMENT_EVENTS + "/subscribe") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Creates a sitemap event subscription.", responses = { @ApiResponse(responseCode = "201", description = "Subscription created."), @ApiResponse(responseCode = "503", description = "Subscriptions limit reached.") }) public
focal_class.parameters: ()
focal_class.return: Object
focal_class.signature: Object createEventSubscription()
focal_class.class_method_signature: SitemapResource.getSitemapEvents(@Context final SseEventSink sseEventSink, @Context final HttpServletResponse response,
              @PathParam("subscriptionid") @Parameter(description = "subscription id") String subscriptionId,
              @QueryParam("sitemap") @Parameter(description = "sitemap name") @Nullable String sitemapname,
              @QueryParam("pageid") @Parameter(description = "page id") @Nullable String pageId)
focal_class.full_signature: @GET @Path(SEGMENT_EVENTS + "/{subscriptionid: [a-zA-Z_0-9-]+}") @Produces(MediaType.SERVER_SENT_EVENTS) @Operation(summary = "Get sitemap events.", responses = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Page not linked to the subscription."), @ApiResponse(responseCode = "404", description = "Subscription not found.") }) public void getSitemapEvents(@Context final SseEventSink sseEventSink, @Context final HttpServletResponse response,
              @PathParam("subscriptionid") @Parameter(description = "subscription id") String subscriptionId,
              @QueryParam("sitemap") @Parameter(description = "sitemap name") @Nullable String sitemapname,
              @QueryParam("pageid") @Parameter(description = "page id") @Nullable String pageId)
focal_class.identifier: getSitemapEvents
focal_class.modifiers: @GET @Path(SEGMENT_EVENTS + "/{subscriptionid: [a-zA-Z_0-9-]+}") @Produces(MediaType.SERVER_SENT_EVENTS) @Operation(summary = "Get sitemap events.", responses = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Page not linked to the subscription."), @ApiResponse(responseCode = "404", description = "Subscription not found.") }) public
focal_class.parameters: (@Context final SseEventSink sseEventSink, @Context final HttpServletResponse response,
              @PathParam("subscriptionid") @Parameter(description = "subscription id") String subscriptionId,
              @QueryParam("sitemap") @Parameter(description = "sitemap name") @Nullable String sitemapname,
              @QueryParam("pageid") @Parameter(description = "page id") @Nullable String pageId)
focal_class.return: void
focal_class.signature: void getSitemapEvents(@Context final SseEventSink sseEventSink, @Context final HttpServletResponse response,
              @PathParam("subscriptionid") @Parameter(description = "subscription id") String subscriptionId,
              @QueryParam("sitemap") @Parameter(description = "sitemap name") @Nullable String sitemapname,
              @QueryParam("pageid") @Parameter(description = "page id") @Nullable String pageId)
focal_class.class_method_signature: SitemapResource.getPageBean(String sitemapName, String pageId, URI uri, Locale locale, boolean timeout,
              boolean includeHidden)
focal_class.full_signature: private PageDTO getPageBean(String sitemapName, String pageId, URI uri, Locale locale, boolean timeout,
              boolean includeHidden)
focal_class.identifier: getPageBean
focal_class.modifiers: private
focal_class.parameters: (String sitemapName, String pageId, URI uri, Locale locale, boolean timeout,
              boolean includeHidden)
focal_class.return: PageDTO
focal_class.signature: PageDTO getPageBean(String sitemapName, String pageId, URI uri, Locale locale, boolean timeout,
              boolean includeHidden)
focal_class.class_method_signature: SitemapResource.getSitemapBeans(URI uri)
focal_class.full_signature: public Collection<SitemapDTO> getSitemapBeans(URI uri)
focal_class.identifier: getSitemapBeans
focal_class.modifiers: public
focal_class.parameters: (URI uri)
focal_class.return: Collection<SitemapDTO>
focal_class.signature: Collection<SitemapDTO> getSitemapBeans(URI uri)
focal_class.class_method_signature: SitemapResource.getSitemapBean(String sitemapname, URI uri, Locale locale, boolean includeHiddenWidgets)
focal_class.full_signature: private SitemapDTO getSitemapBean(String sitemapname, URI uri, Locale locale, boolean includeHiddenWidgets)
focal_class.identifier: getSitemapBean
focal_class.modifiers: private
focal_class.parameters: (String sitemapname, URI uri, Locale locale, boolean includeHiddenWidgets)
focal_class.return: SitemapDTO
focal_class.signature: SitemapDTO getSitemapBean(String sitemapname, URI uri, Locale locale, boolean includeHiddenWidgets)
focal_class.class_method_signature: SitemapResource.createSitemapBean(String sitemapName, Sitemap sitemap, URI uri, Locale locale,
              boolean includeHiddenWidgets)
focal_class.full_signature: private SitemapDTO createSitemapBean(String sitemapName, Sitemap sitemap, URI uri, Locale locale,
              boolean includeHiddenWidgets)
focal_class.identifier: createSitemapBean
focal_class.modifiers: private
focal_class.parameters: (String sitemapName, Sitemap sitemap, URI uri, Locale locale,
              boolean includeHiddenWidgets)
focal_class.return: SitemapDTO
focal_class.signature: SitemapDTO createSitemapBean(String sitemapName, Sitemap sitemap, URI uri, Locale locale,
              boolean includeHiddenWidgets)
focal_class.class_method_signature: SitemapResource.createPageBean(String sitemapName, @Nullable String title, @Nullable String icon, String pageId,
              @Nullable EList<Widget> children, boolean drillDown, boolean isLeaf, URI uri, Locale locale,
              boolean timeout, boolean includeHiddenWidgets)
focal_class.full_signature: private PageDTO createPageBean(String sitemapName, @Nullable String title, @Nullable String icon, String pageId,
              @Nullable EList<Widget> children, boolean drillDown, boolean isLeaf, URI uri, Locale locale,
              boolean timeout, boolean includeHiddenWidgets)
focal_class.identifier: createPageBean
focal_class.modifiers: private
focal_class.parameters: (String sitemapName, @Nullable String title, @Nullable String icon, String pageId,
              @Nullable EList<Widget> children, boolean drillDown, boolean isLeaf, URI uri, Locale locale,
              boolean timeout, boolean includeHiddenWidgets)
focal_class.return: PageDTO
focal_class.signature: PageDTO createPageBean(String sitemapName, @Nullable String title, @Nullable String icon, String pageId,
              @Nullable EList<Widget> children, boolean drillDown, boolean isLeaf, URI uri, Locale locale,
              boolean timeout, boolean includeHiddenWidgets)
focal_class.class_method_signature: SitemapResource.createWidgetBean(String sitemapName, Widget widget, boolean drillDown, URI uri,
              String widgetId, Locale locale, boolean evenIfHidden)
focal_class.full_signature: private @Nullable WidgetDTO createWidgetBean(String sitemapName, Widget widget, boolean drillDown, URI uri,
              String widgetId, Locale locale, boolean evenIfHidden)
focal_class.identifier: createWidgetBean
focal_class.modifiers: private @Nullable
focal_class.parameters: (String sitemapName, Widget widget, boolean drillDown, URI uri,
              String widgetId, Locale locale, boolean evenIfHidden)
focal_class.return: WidgetDTO
focal_class.signature: WidgetDTO createWidgetBean(String sitemapName, Widget widget, boolean drillDown, URI uri,
              String widgetId, Locale locale, boolean evenIfHidden)
focal_class.class_method_signature: SitemapResource.buildProxyUrl(String sitemapName, Widget widget, URI uri)
focal_class.full_signature: private String buildProxyUrl(String sitemapName, Widget widget, URI uri)
focal_class.identifier: buildProxyUrl
focal_class.modifiers: private
focal_class.parameters: (String sitemapName, Widget widget, URI uri)
focal_class.return: String
focal_class.signature: String buildProxyUrl(String sitemapName, Widget widget, URI uri)
focal_class.class_method_signature: SitemapResource.isLeaf(EList<Widget> children)
focal_class.full_signature: private boolean isLeaf(EList<Widget> children)
focal_class.identifier: isLeaf
focal_class.modifiers: private
focal_class.parameters: (EList<Widget> children)
focal_class.return: boolean
focal_class.signature: boolean isLeaf(EList<Widget> children)
focal_class.class_method_signature: SitemapResource.getSitemap(String sitemapname)
focal_class.full_signature: private @Nullable Sitemap getSitemap(String sitemapname)
focal_class.identifier: getSitemap
focal_class.modifiers: private @Nullable
focal_class.parameters: (String sitemapname)
focal_class.return: Sitemap
focal_class.signature: Sitemap getSitemap(String sitemapname)
focal_class.class_method_signature: SitemapResource.blockUnlessChangeOccurs(String sitemapname, String pageId)
focal_class.full_signature: private boolean blockUnlessChangeOccurs(String sitemapname, String pageId)
focal_class.identifier: blockUnlessChangeOccurs
focal_class.modifiers: private
focal_class.parameters: (String sitemapname, String pageId)
focal_class.return: boolean
focal_class.signature: boolean blockUnlessChangeOccurs(String sitemapname, String pageId)
focal_class.class_method_signature: SitemapResource.waitForChanges(EList<Widget> widgets)
focal_class.full_signature: private boolean waitForChanges(EList<Widget> widgets)
focal_class.identifier: waitForChanges
focal_class.modifiers: private
focal_class.parameters: (EList<Widget> widgets)
focal_class.return: boolean
focal_class.signature: boolean waitForChanges(EList<Widget> widgets)
focal_class.class_method_signature: SitemapResource.getAllItems(EList<Widget> widgets)
focal_class.full_signature: private Set<GenericItem> getAllItems(EList<Widget> widgets)
focal_class.identifier: getAllItems
focal_class.modifiers: private
focal_class.parameters: (EList<Widget> widgets)
focal_class.return: Set<GenericItem>
focal_class.signature: Set<GenericItem> getAllItems(EList<Widget> widgets)
focal_class.class_method_signature: SitemapResource.getItemsInVisibilityCond(EList<VisibilityRule> ruleList)
focal_class.full_signature: private Set<GenericItem> getItemsInVisibilityCond(EList<VisibilityRule> ruleList)
focal_class.identifier: getItemsInVisibilityCond
focal_class.modifiers: private
focal_class.parameters: (EList<VisibilityRule> ruleList)
focal_class.return: Set<GenericItem>
focal_class.signature: Set<GenericItem> getItemsInVisibilityCond(EList<VisibilityRule> ruleList)
focal_class.class_method_signature: SitemapResource.getItemsInColorCond(EList<ColorArray> colorList)
focal_class.full_signature: private Set<GenericItem> getItemsInColorCond(EList<ColorArray> colorList)
focal_class.identifier: getItemsInColorCond
focal_class.modifiers: private
focal_class.parameters: (EList<ColorArray> colorList)
focal_class.return: Set<GenericItem>
focal_class.signature: Set<GenericItem> getItemsInColorCond(EList<ColorArray> colorList)
focal_class.class_method_signature: SitemapResource.onEvent(SitemapEvent event)
focal_class.full_signature: @Override public void onEvent(SitemapEvent event)
focal_class.identifier: onEvent
focal_class.modifiers: @Override public
focal_class.parameters: (SitemapEvent event)
focal_class.return: void
focal_class.signature: void onEvent(SitemapEvent event)
focal_class.class_method_signature: SitemapResource.onRelease(String subscriptionId)
focal_class.full_signature: @Override public void onRelease(String subscriptionId)
focal_class.identifier: onRelease
focal_class.modifiers: @Override public
focal_class.parameters: (String subscriptionId)
focal_class.return: void
focal_class.signature: void onRelease(String subscriptionId)
focal_class.class_method_signature: SitemapResource.sseEventSinkRemoved(SseEventSink sink, SseSinkInfo info)
focal_class.full_signature: @Override public void sseEventSinkRemoved(SseEventSink sink, SseSinkInfo info)
focal_class.identifier: sseEventSinkRemoved
focal_class.modifiers: @Override public
focal_class.parameters: (SseEventSink sink, SseSinkInfo info)
focal_class.return: void
focal_class.signature: void sseEventSinkRemoved(SseEventSink sink, SseSinkInfo info)
focal_method.body: @GET
      @Path("/{sitemapname: [a-zA-Z_0-9]+}/{pageid: [a-zA-Z_0-9]+}")
      @Produces(MediaType.APPLICATION_JSON)
      @Operation(summary = "Polls the data for a sitemap.", responses = {
              @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PageDTO.class))),
              @ApiResponse(responseCode = "404", description = "Sitemap with requested name does not exist or page does not exist, or page refers to a non-linkable widget"),
              @ApiResponse(responseCode = "400", description = "Invalid subscription id has been provided.") })
      public Response getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets) {
          final Locale locale = localeService.getLocale(language);
          logger.debug("Received HTTP GET request from IP {} at '{}'", request.getRemoteAddr(), uriInfo.getPath());
  
          if (subscriptionId != null) {
              try {
                  subscriptions.setPageId(subscriptionId, sitemapname, pageId);
              } catch (IllegalArgumentException e) {
                  return JSONResponse.createErrorResponse(Response.Status.BAD_REQUEST, e.getMessage());
              }
          }
  
          boolean timeout = false;
          if (headers.getRequestHeader("X-Atmosphere-Transport") != null) {
              // Make the REST-API pseudo-compatible with openHAB 1.x
              // The client asks Atmosphere for server push functionality,
              // so we do a simply listening for changes on the appropriate items
              // The blocking has a timeout of 30 seconds. If this timeout is reached,
              // we notice this information in the response object.
              timeout = blockUnlessChangeOccurs(sitemapname, pageId);
          }
          PageDTO responseObject = getPageBean(sitemapname, pageId, uriInfo.getBaseUriBuilder().build(), locale, timeout,
                  includeHiddenWidgets);
          return Response.ok(responseObject).build();
      }
focal_method.class_method_signature: SitemapResource.getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_method.full_signature: @GET @Path("/{sitemapname: [a-zA-Z_0-9]+}/{pageid: [a-zA-Z_0-9]+}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Polls the data for a sitemap.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PageDTO.class))), @ApiResponse(responseCode = "404", description = "Sitemap with requested name does not exist or page does not exist, or page refers to a non-linkable widget"), @ApiResponse(responseCode = "400", description = "Invalid subscription id has been provided.") }) public Response getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_method.identifier: getPageData
focal_method.invocations: getLocale debug getRemoteAddr getPath setPageId createErrorResponse getMessage getRequestHeader blockUnlessChangeOccurs getPageBean build getBaseUriBuilder build ok
focal_method.modifiers: @GET @Path("/{sitemapname: [a-zA-Z_0-9]+}/{pageid: [a-zA-Z_0-9]+}") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Polls the data for a sitemap.", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = PageDTO.class))), @ApiResponse(responseCode = "404", description = "Sitemap with requested name does not exist or page does not exist, or page refers to a non-linkable widget"), @ApiResponse(responseCode = "400", description = "Invalid subscription id has been provided.") }) public
focal_method.parameters: (@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)
focal_method.return: Response
focal_method.signature: Response getPageData(@Context HttpHeaders headers,
              @HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @Parameter(description = "language") @Nullable String language,
              @PathParam("sitemapname") @Parameter(description = "sitemap name") String sitemapname,
              @PathParam("pageid") @Parameter(description = "page id") String pageId,
              @QueryParam("subscriptionid") @Parameter(description = "subscriptionid") @Nullable String subscriptionId,
              @QueryParam("includeHidden") @Parameter(description = "include hidden widgets") boolean includeHiddenWidgets)