|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.application.Server
public class Server
This object represents a service server. It is an application that responds
to ServiceRequests queries.
Server is assigned with at least one application instance certificate.
The initial server contains EndpointDiscoveryService by default.
Application,
service handler| Field Summary | |
|---|---|
protected Application |
application
The application |
protected List<EndpointServer.EndpointHandle> |
boundHandles
Bound handles |
protected EndpointBindingCollection |
endpointBindings
Endpoints |
protected EndpointDiscoveryService |
endpointDiscoveryService
Endpoint discovery service |
static String |
HTTPS_BINARY_TRANSPORT_PROFILE_URI
Constant HTTPS_BINARY_TRANSPORT_PROFILE_URI="http://opcfoundation.org/UA-Profile/Tra"{trunked} |
protected ServiceHandlerComposition |
serviceHandlers
Service Handler |
static String |
SOAP_XML_TRANSPORT_PROFILE_URI
Constant SOAP_XML_TRANSPORT_PROFILE_URI="http://opcfoundation.org/UA-Profile/Tra"{trunked} |
static String |
UATCP_BINARY_TRANSPORT_PROFILE_URI
Constant UATCP_BINARY_TRANSPORT_PROFILE_URI="http://opcfoundation.org/UA-Profile/Tra"{trunked} |
protected List<UserTokenPolicy> |
userTokenPolicies
User Token Policies |
| Constructor Summary | |
|---|---|
Server(Application application)
Constructor for Server. |
|
| Method Summary | ||
|---|---|---|
void |
addServiceHandler(Object serviceHandler)
Add Service Handler. |
|
void |
addUserTokenPolicy(UserTokenPolicy policy)
addUserTokenPolicy. |
|
List<EndpointServer.EndpointHandle> |
bind(String bindAddress,
Endpoint endpointAddress)
Bind an endpoint to the server. |
|
List<EndpointServer.EndpointHandle> |
bind(String bindAddress,
String endpointUri,
SecurityMode... modes)
bind. |
|
void |
close()
Close the server. |
|
ApplicationDescription |
createApplicationDescription()
createApplicationDescription. |
|
static Server |
createServerApplication()
createServerApplication. |
|
Application |
getApplication()
Getter for the field application. |
|
EndpointServer[] |
getBindings()
getBindings. |
|
EncoderContext |
getEncoderContext()
getEncoderContext. |
|
EndpointBindingCollection |
getEndpointBindings()
Getter for the field endpointBindings. |
|
Endpoint |
getEndpointByUri(String uri)
getEndpointByUri. |
|
EndpointDescription[] |
getEndpointDescriptions()
getEndpointDescriptions. |
|
EndpointDescription[] |
getEndpointDescriptions(SocketAddress requestAddress)
getEndpointDescriptions. |
|
Endpoint[] |
getEndpoints()
getEndpoints. |
|
|
getServiceHandlerByService(Class<? extends ServiceRequest> requestClass)
Get Service Handler object by service. |
|
ServiceHandlerComposition |
getServiceHandlerComposition()
getServiceHandlerComposition. |
|
ServiceHandler[] |
getServiceHandlers()
Getter for the field serviceHandlers. |
|
UserTokenPolicy[] |
getUserTokenPolicies()
Getter for the field userTokenPolicies. |
|
boolean |
handlesService(Class<? extends IEncodeable> requestClass)
Query whether the server can handle a service. |
|
boolean |
hasEndpoint(String uri)
hasEndpoint. |
|
void |
removeUserTokenPolicy(UserTokenPolicy policy)
removeUserTokenPolicy. |
|
void |
setEndpointBindings(EndpointBindingCollection newBindings)
Setter for the field endpointBindings. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SOAP_XML_TRANSPORT_PROFILE_URI
SOAP_XML_TRANSPORT_PROFILE_URI="http://opcfoundation.org/UA-Profile/Tra"{trunked}
public static final String UATCP_BINARY_TRANSPORT_PROFILE_URI
UATCP_BINARY_TRANSPORT_PROFILE_URI="http://opcfoundation.org/UA-Profile/Tra"{trunked}
public static final String HTTPS_BINARY_TRANSPORT_PROFILE_URI
HTTPS_BINARY_TRANSPORT_PROFILE_URI="http://opcfoundation.org/UA-Profile/Tra"{trunked}
protected ServiceHandlerComposition serviceHandlers
protected List<UserTokenPolicy> userTokenPolicies
protected EndpointBindingCollection endpointBindings
protected EndpointDiscoveryService endpointDiscoveryService
protected Application application
protected List<EndpointServer.EndpointHandle> boundHandles
| Constructor Detail |
|---|
public Server(Application application)
Constructor for Server.
application - a Application object.| Method Detail |
|---|
public static Server createServerApplication()
createServerApplication.
Server object.public Application getApplication()
Getter for the field application.
Application object.public ApplicationDescription createApplicationDescription()
createApplicationDescription.
ApplicationDescription object.public void setEndpointBindings(EndpointBindingCollection newBindings)
Setter for the field endpointBindings.
newBindings - a EndpointBindingCollection object.public EndpointBindingCollection getEndpointBindings()
Getter for the field endpointBindings.
EndpointBindingCollection object.public EncoderContext getEncoderContext()
getEncoderContext.
EncoderContext object.public void addServiceHandler(Object serviceHandler)
The serviceHandler is either:
(a) an implementation of ServiceHandler
(b) an object that contains methods that implement service requests.
These methods are discovered using Java Reflection.
The following list contains service methods grouped by service sets:
serviceHandler - instanceof ServiceHandler or Object implementing service requestsAttributeServiceSetHandler,
DiscoveryServiceSetHandler,
MethodServiceSetHandler,
MonitoredItemServiceSetHandler,
NodeManagementServiceSetHandler,
SessionServiceSetHandler,
SubscriptionServiceSetHandler,
The serviceHandler may implement one or more methods.
In typical case service handler implements one service set, e.g.
{@link org.opcfoundation.ua.core.SessionServiceSetHandler}.
A {@link org.opcfoundation.ua.core.ServiceFault} is returned to the client in case the server doesn't
the requested service method.
Example:
addServiceHandler( new TestServiceSetHandler() {
void onTestStack(EndpointServiceRequest<TestStackRequest, TestStackResponse> req) {
req.sendResponse( new ServiceFault() );
}
void onTestStackEx(EndpointServiceRequest<TestStackExRequest, TestStackExResponse> req) {
req.sendFault(new ServiceFault());
}
} );
public ServiceHandler[] getServiceHandlers()
Getter for the field serviceHandlers.
ServiceHandler objects.public <T> T getServiceHandlerByService(Class<? extends ServiceRequest> requestClass)
For example, to acquire session manager: SessionManager sessionManager = x.getServiceHandlerByService( CreateSessionRequest.class );
T - service handler typerequestClass - Service request class
public boolean handlesService(Class<? extends IEncodeable> requestClass)
requestClass - request class of the service, e.g. ReadRequest
public ServiceHandlerComposition getServiceHandlerComposition()
getServiceHandlerComposition.
ServiceHandlerComposition object.public void addUserTokenPolicy(UserTokenPolicy policy)
addUserTokenPolicy.
policy - a UserTokenPolicy object.public void removeUserTokenPolicy(UserTokenPolicy policy)
removeUserTokenPolicy.
policy - a UserTokenPolicy object.public UserTokenPolicy[] getUserTokenPolicies()
Getter for the field userTokenPolicies.
UserTokenPolicy objects.
public List<EndpointServer.EndpointHandle> bind(String bindAddress,
Endpoint endpointAddress)
throws ServiceResultException
bindAddress - bind address for the endpointendpointAddress - endpoint to bind
ServiceResultException - if error
public List<EndpointServer.EndpointHandle> bind(String bindAddress,
String endpointUri,
SecurityMode... modes)
throws ServiceResultException
bind.
bindAddress - a String object.endpointUri - a String object.modes - a SecurityMode object.
List object.
ServiceResultException - if any.public void close()
public Endpoint[] getEndpoints()
getEndpoints.
Endpoint objects.public boolean hasEndpoint(String uri)
hasEndpoint.
uri - a String object.
public Endpoint getEndpointByUri(String uri)
getEndpointByUri.
uri - a String object.
Endpoint object.public EndpointDescription[] getEndpointDescriptions()
getEndpointDescriptions.
EndpointDescription objects.public EndpointDescription[] getEndpointDescriptions(SocketAddress requestAddress)
getEndpointDescriptions.
requestAddress - a SocketAddress object.
EndpointDescription objects.public EndpointServer[] getBindings()
getBindings.
EndpointServer objects.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||