Package org.openscada.opc.lib.da
Class Server
java.lang.Object
org.openscada.opc.lib.da.Server
-
Constructor Summary
ConstructorsConstructorDescriptionServer(ConnectionInformation connectionInformation, ScheduledExecutorService scheduler) -
Method Summary
Modifier and TypeMethodDescriptionaddGroup()Add a new group and let the server generate a group nameAdd a new named group to the servervoidprotected voidcleanup()cleanup after the connection is closedvoidconnect()voidDisconnect the connection if it is connectedvoiddispose()Dispose the connection in the case of an errorFind a group by its nameintintgetErrorMessage(int errorCode) Get the flat browserprotected GroupgetGroup(OPCGroupStateMgt groupMgt) Gets the scheduler for the server.getServerState(int timeout) Get the tree browserprotected booleanbooleanprotected voidnotifyConnectionStateChange(boolean connected) voidremoveGroup(Group group, boolean force) voidvoidsetDefaultActive(boolean defaultActive) voidsetDefaultLocaleID(int defaultLocaleID) voidsetDefaultPercentDeadband(Float defaultPercentDeadband) voidsetDefaultTimeBias(Integer defaultTimeBias) voidsetDefaultUpdateRate(int defaultUpdateRate)
-
Constructor Details
-
Server
-
-
Method Details
-
getScheduler
Gets the scheduler for the server. Note that this scheduler might get blocked for a short time if the connection breaks. It should not be used for time critical operations.- Returns:
- the scheduler for the server
-
isConnected
protected boolean isConnected() -
connect
public void connect() throws IllegalArgumentException, UnknownHostException, org.jinterop.dcom.common.JIException, AlreadyConnectedException- Throws:
IllegalArgumentExceptionUnknownHostExceptionorg.jinterop.dcom.common.JIExceptionAlreadyConnectedException
-
cleanup
protected void cleanup()cleanup after the connection is closed -
disconnect
public void disconnect()Disconnect the connection if it is connected -
dispose
public void dispose()Dispose the connection in the case of an error -
getGroup
protected Group getGroup(OPCGroupStateMgt groupMgt) throws org.jinterop.dcom.common.JIException, IllegalArgumentException, UnknownHostException - Throws:
org.jinterop.dcom.common.JIExceptionIllegalArgumentExceptionUnknownHostException
-
addGroup
public Group addGroup(String name) throws NotConnectedException, IllegalArgumentException, UnknownHostException, org.jinterop.dcom.common.JIException, DuplicateGroupException Add a new named group to the server- Parameters:
name- The name of the group to use. Must be unique ornullso that the server creates a unique name.- Returns:
- The new group
- Throws:
NotConnectedException- If the server is not connected usingconnect()IllegalArgumentExceptionUnknownHostExceptionorg.jinterop.dcom.common.JIExceptionDuplicateGroupException- If a group with this name already exists
-
addGroup
public Group addGroup() throws IllegalArgumentException, UnknownHostException, NotConnectedException, org.jinterop.dcom.common.JIException, DuplicateGroupExceptionAdd a new group and let the server generate a group nameActually this method only calls
addGroup(String)withnullas parameter.- Returns:
- the new group
- Throws:
IllegalArgumentExceptionUnknownHostExceptionNotConnectedExceptionorg.jinterop.dcom.common.JIExceptionDuplicateGroupException
-
findGroup
public Group findGroup(String name) throws IllegalArgumentException, UnknownHostException, org.jinterop.dcom.common.JIException, UnknownGroupException, NotConnectedException Find a group by its name- Parameters:
name- The name to look for- Returns:
- The group
- Throws:
IllegalArgumentExceptionUnknownHostExceptionorg.jinterop.dcom.common.JIExceptionUnknownGroupException- If the group was not foundNotConnectedException- If the server is not connected
-
getDefaultLocaleID
public int getDefaultLocaleID() -
setDefaultLocaleID
public void setDefaultLocaleID(int defaultLocaleID) -
getDefaultPercentDeadband
-
setDefaultPercentDeadband
-
getDefaultTimeBias
-
setDefaultTimeBias
-
getDefaultUpdateRate
public int getDefaultUpdateRate() -
setDefaultUpdateRate
public void setDefaultUpdateRate(int defaultUpdateRate) -
isDefaultActive
public boolean isDefaultActive() -
setDefaultActive
public void setDefaultActive(boolean defaultActive) -
getFlatBrowser
Get the flat browser- Returns:
- The flat browser or
nullif the functionality is not supported
-
getTreeBrowser
Get the tree browser- Returns:
- The tree browser or
nullif the functionality is not supported - Throws:
org.jinterop.dcom.common.JIException
-
getErrorMessage
-
addStateListener
-
removeStateListener
-
notifyConnectionStateChange
protected void notifyConnectionStateChange(boolean connected) -
getServerState
- Throws:
Throwable
-
getServerState
-
removeGroup
- Throws:
org.jinterop.dcom.common.JIException
-