FreeRDP
Loading...
Searching...
No Matches
com.freerdp.freerdpcore.services.QuickConnectHistoryGateway Class Reference

Public Member Functions

 QuickConnectHistoryGateway (HistoryDao dao)
 
ArrayList< BookmarkBase > findHistory (String filter)
 
void addHistoryItem (String item)
 
boolean historyItemExists (String item)
 
void removeHistoryItem (String hostname)
 

Detailed Description

Definition at line 20 of file QuickConnectHistoryGateway.java.

Constructor & Destructor Documentation

◆ QuickConnectHistoryGateway()

com.freerdp.freerdpcore.services.QuickConnectHistoryGateway.QuickConnectHistoryGateway ( HistoryDao  dao)
inline

Definition at line 24 of file QuickConnectHistoryGateway.java.

25 {
26 this.dao = dao;
27 }

Member Function Documentation

◆ addHistoryItem()

void com.freerdp.freerdpcore.services.QuickConnectHistoryGateway.addHistoryItem ( String  item)
inline

Definition at line 46 of file QuickConnectHistoryGateway.java.

47 {
48 dao.insertOrReplace(new HistoryEntity(item));
49 }

◆ findHistory()

ArrayList< BookmarkBase > com.freerdp.freerdpcore.services.QuickConnectHistoryGateway.findHistory ( String  filter)
inline

Definition at line 29 of file QuickConnectHistoryGateway.java.

30 {
31 String query = (filter != null && !filter.isEmpty()) ? ("%" + filter + "%") : "%";
32 List<HistoryEntity> entities = dao.findHistory(query);
33
34 ArrayList<BookmarkBase> result = new ArrayList<>(entities.size());
35 for (HistoryEntity entity : entities)
36 {
37 BookmarkBase bookmark = new BookmarkBase();
38 bookmark.setType(BookmarkBase.TYPE_QUICKCONNECT);
39 bookmark.setLabel(entity.item);
40 bookmark.setHostname(entity.item);
41 result.add(bookmark);
42 }
43 return result;
44 }

◆ historyItemExists()

boolean com.freerdp.freerdpcore.services.QuickConnectHistoryGateway.historyItemExists ( String  item)
inline

Definition at line 51 of file QuickConnectHistoryGateway.java.

52 {
53 return dao.exists(item) > 0;
54 }

◆ removeHistoryItem()

void com.freerdp.freerdpcore.services.QuickConnectHistoryGateway.removeHistoryItem ( String  hostname)
inline

Definition at line 56 of file QuickConnectHistoryGateway.java.

57 {
58 dao.deleteByItem(hostname);
59 }

The documentation for this class was generated from the following file: