com.toremote.gateway.connection
Class AbstractServerList
java.lang.Object
com.toremote.gateway.connection.AbstractServerList
- All Implemented Interfaces:
- ServerListInterface, java.lang.Cloneable
public abstract class AbstractServerList
- extends java.lang.Object
- implements ServerListInterface
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
public java.lang.String type
display
public java.lang.Boolean display
connections
public Connection[] connections
lastModified
protected java.lang.Long lastModified
AbstractServerList
public AbstractServerList()
getListType
public java.lang.String getListType()
- Specified by:
getListType
in interface ServerListInterface
- Returns:
- TYPE_WHITE_LIST, TYPE_BLACK_LIST or TYPE_NORMAL_LIST
isAllowed
public boolean isAllowed(java.lang.String idOrServer)
- Specified by:
isAllowed
in interface ServerListInterface
- Returns:
- true if this server can be accessed.
getConnectionById
public Connection getConnectionById(java.lang.String id)
- Specified by:
getConnectionById
in interface ServerListInterface
- Returns:
- Connection object, null if not found
getConnectionByIdOrServer
public Connection getConnectionByIdOrServer(java.lang.String is)
- Specified by:
getConnectionByIdOrServer
in interface ServerListInterface
- Returns:
- Connection object, null if not found
isDisplay
public boolean isDisplay()
- Specified by:
isDisplay
in interface ServerListInterface
- Returns:
- true if you want user see this list
toJsonTable
public java.lang.String toJsonTable()
delete
public abstract boolean delete(java.lang.String id)
throws java.io.IOException
- delete server, call persistent to save
- Parameters:
id
-
- Returns:
- true if succeeded
- Throws:
java.io.IOException
add
public abstract boolean add(Connection c)
throws java.io.IOException
- add new server, call persistent to save
- Parameters:
c
- connection
- Returns:
- true if succeeded
- Throws:
java.io.IOException
update
public abstract boolean update(Connection c)
throws java.io.IOException
- update existing server, call persistent to save
- Parameters:
c
-
- Returns:
-
- Throws:
java.io.IOException
persistent
public abstract boolean persistent()
throws java.io.IOException
- save changes to disk
- Returns:
- true if succeeded
- Throws:
java.io.IOException