public class Server extends Object
| Constructor and Description |
|---|
Server(ConnectionInformation connectionInformation,
ScheduledExecutorService scheduler) |
| Modifier and Type | Method and Description |
|---|---|
Group |
addGroup()
Add a new group and let the server generate a group name
Actually this method only calls
addGroup(String) with null
as parameter. |
Group |
addGroup(String name)
Add a new named group to the server
|
void |
addStateListener(ServerConnectionStateListener listener) |
protected void |
cleanup()
cleanup after the connection is closed
|
void |
connect() |
void |
disconnect()
Disconnect the connection if it is connected
|
void |
dispose()
Dispose the connection in the case of an error
|
Group |
findGroup(String name)
Find a group by its name
|
int |
getDefaultLocaleID() |
Float |
getDefaultPercentDeadband() |
Integer |
getDefaultTimeBias() |
int |
getDefaultUpdateRate() |
String |
getErrorMessage(int errorCode) |
FlatBrowser |
getFlatBrowser()
Get the flat browser
|
protected Group |
getGroup(OPCGroupStateMgt groupMgt) |
ScheduledExecutorService |
getScheduler()
Gets the scheduler for the server.
|
OPCSERVERSTATUS |
getServerState() |
OPCSERVERSTATUS |
getServerState(int timeout) |
TreeBrowser |
getTreeBrowser()
Get the tree browser
|
protected boolean |
isConnected() |
boolean |
isDefaultActive() |
protected void |
notifyConnectionStateChange(boolean connected) |
void |
removeGroup(Group group,
boolean force) |
void |
removeStateListener(ServerConnectionStateListener listener) |
void |
setDefaultActive(boolean defaultActive) |
void |
setDefaultLocaleID(int defaultLocaleID) |
void |
setDefaultPercentDeadband(Float defaultPercentDeadband) |
void |
setDefaultTimeBias(Integer defaultTimeBias) |
void |
setDefaultUpdateRate(int defaultUpdateRate) |
public Server(ConnectionInformation connectionInformation, ScheduledExecutorService scheduler)
public ScheduledExecutorService getScheduler()
protected boolean isConnected()
public void connect()
throws IllegalArgumentException,
UnknownHostException,
JIException,
AlreadyConnectedException
protected void cleanup()
public void disconnect()
public void dispose()
protected Group getGroup(OPCGroupStateMgt groupMgt) throws JIException, IllegalArgumentException, UnknownHostException
public Group addGroup(String name) throws NotConnectedException, IllegalArgumentException, UnknownHostException, JIException, DuplicateGroupException
name - The name of the group to use. Must be unique or null so that the server creates a unique name.NotConnectedException - If the server is not connected using connect()IllegalArgumentExceptionUnknownHostExceptionJIExceptionDuplicateGroupException - If a group with this name already existspublic Group addGroup() throws IllegalArgumentException, UnknownHostException, NotConnectedException, JIException, DuplicateGroupException
addGroup(String) with null
as parameter.IllegalArgumentExceptionUnknownHostExceptionNotConnectedExceptionJIExceptionDuplicateGroupExceptionpublic Group findGroup(String name) throws IllegalArgumentException, UnknownHostException, JIException, UnknownGroupException, NotConnectedException
name - The name to look forIllegalArgumentExceptionUnknownHostExceptionJIExceptionUnknownGroupException - If the group was not foundNotConnectedException - If the server is not connectedpublic int getDefaultLocaleID()
public void setDefaultLocaleID(int defaultLocaleID)
public Float getDefaultPercentDeadband()
public void setDefaultPercentDeadband(Float defaultPercentDeadband)
public Integer getDefaultTimeBias()
public void setDefaultTimeBias(Integer defaultTimeBias)
public int getDefaultUpdateRate()
public void setDefaultUpdateRate(int defaultUpdateRate)
public boolean isDefaultActive()
public void setDefaultActive(boolean defaultActive)
public FlatBrowser getFlatBrowser()
null if the functionality is not supportedpublic TreeBrowser getTreeBrowser() throws JIException
null if the functionality is not supportedJIExceptionpublic String getErrorMessage(int errorCode)
public void addStateListener(ServerConnectionStateListener listener)
public void removeStateListener(ServerConnectionStateListener listener)
protected void notifyConnectionStateChange(boolean connected)
public OPCSERVERSTATUS getServerState(int timeout) throws Throwable
Throwablepublic OPCSERVERSTATUS getServerState()
public void removeGroup(Group group, boolean force) throws JIException
JIExceptionCopyright © 2017 LSST. All rights reserved.