|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.utils.EndpointUtil
public class EndpointUtil
Discovery client enumerates endpoints. Current version supports only opc.tcp protocol.
| Constructor Summary | |
|---|---|
EndpointUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
containsSecureUserTokenPolicy(UserTokenPolicy[] userIdentityTokens)
containsSecureUserTokenPolicy. |
static UserIdentityToken |
createAnonymousIdentityToken(EndpointDescription ep)
Create anonymous user identity token |
static UserIdentityToken |
createIssuedIdentityToken(EndpointDescription ep,
byte[] senderNonce,
byte[] issuedIdentityToken)
Create user identity token based on an issued token |
static UserIdentityToken |
createUserNameIdentityToken(EndpointDescription ep,
byte[] senderNonce,
String username,
String password)
Create user identity token based on username and password |
static X509IdentityToken |
createX509IdentityToken(EndpointDescription ep,
byte[] serverNonce,
Cert certificate,
PrivateKey key,
SignatureData signatureData)
createX509IdentityToken. |
static String |
getHostname()
Figure out some random hostname for this computer |
static Set<InetAddress> |
getInetAddresses()
Get all Internet addresses of this computer. |
static Set<InetAddress> |
getInetAddresses(boolean enableIPv6)
Get all Internet addresses of this computer. |
static Set<String> |
getInetAddressNames()
Get all internet address names of this computer. |
static String |
inetAddressToName(InetAddress addr)
inetAddressToName. |
static void |
reverse(Object array)
Reverse elements of an array |
static EndpointDescription |
select(EndpointDescription[] endpoints)
Select an endpoint that is supported by the stack and has the highest security level. |
static EndpointDescription[] |
select(EndpointDescription[] searchSet,
int minKeySize,
int maxKeySize)
select. |
static EndpointDescription |
select(EndpointDescription[] endpoints,
String url)
select. |
static EndpointDescription[] |
select(EndpointDescription[] searchSet,
String url,
String protocol,
MessageSecurityMode mode,
SecurityPolicy policy,
byte[] serverCertificate)
Filter endpoints by various criteria |
static EndpointDescription[] |
selectByMessageSecurityMode(EndpointDescription[] searchSet,
MessageSecurityMode mode)
Selects all endpoints that conform to given message security mode |
static EndpointDescription[] |
selectByProtocol(EndpointDescription[] searchSet,
String protocol)
Selects all endpoints that conform to given protcol |
static EndpointDescription[] |
selectBySecurityPolicy(EndpointDescription[] searchSet,
SecurityPolicy policy)
Selects all endpoints that conform to given message security mode |
static EndpointDescription[] |
selectByUrl(EndpointDescription[] searchSet,
String url)
Selects all endpoints with the given url. |
static EndpointDescription |
selectEndpoint(EndpointDescription[] endpoints)
Select the most suitable endpoint. |
static EndpointDescription[] |
sortBySecurityLevel(EndpointDescription[] set)
Sorts endpoints by their security level. |
static List<SocketAddress> |
toSocketAddresses(String endpointUrl)
Convert endpoint url to socket addresses. |
static List<SocketAddress> |
toSocketAddresses(String endpointUrl,
boolean enableIPv6)
Convert endpoint url to socket addresses. |
static boolean |
urlEqualsHostIgnoreCase(String endpointUrl,
String url)
Check if the endpointUrl matches the url, except for the hostname part. |
static boolean |
urlEqualsHostIgnoreCase(URI uri,
URI requestedUri)
Check if the endpointUrl matches the url, except for the hostname part. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EndpointUtil()
| Method Detail |
|---|
public static EndpointDescription select(EndpointDescription[] endpoints,
String url)
throws ServiceResultException
select.
endpoints - an array of EndpointDescription objects.url - a String object.
EndpointDescription object.
ServiceResultException - if any.
public static EndpointDescription select(EndpointDescription[] endpoints)
throws ServiceResultException
endpoints - an array of EndpointDescription objects.
ServiceResultException - error
public static EndpointDescription[] select(EndpointDescription[] searchSet,
String url,
String protocol,
MessageSecurityMode mode,
SecurityPolicy policy,
byte[] serverCertificate)
searchSet - set of endpointsurl - filter by url (inclusive, case insensitive) or nullprotocol - filter by protocol (inclusive) or nullmode - filter by mode or nullpolicy - filter by policy or nullserverCertificate - an array of byte.
public static EndpointDescription[] select(EndpointDescription[] searchSet,
int minKeySize,
int maxKeySize)
select.
searchSet - an array of EndpointDescription objects.minKeySize - a int.maxKeySize - a int.
EndpointDescription objects.
public static EndpointDescription[] selectByProtocol(EndpointDescription[] searchSet,
String protocol)
searchSet - an array of EndpointDescription objects.protocol - a String object.
public static EndpointDescription[] selectByMessageSecurityMode(EndpointDescription[] searchSet,
MessageSecurityMode mode)
searchSet - an array of EndpointDescription objects.mode - a MessageSecurityMode object.
public static EndpointDescription[] selectBySecurityPolicy(EndpointDescription[] searchSet,
SecurityPolicy policy)
searchSet - an array of EndpointDescription objects.policy - a SecurityPolicy object.
public static EndpointDescription[] selectByUrl(EndpointDescription[] searchSet,
String url)
searchSet - an array of urlsurl - a String object.
public static EndpointDescription[] sortBySecurityLevel(EndpointDescription[] set)
set - set of endpoints
public static EndpointDescription selectEndpoint(EndpointDescription[] endpoints)
Selection uses the following precedence: 1) Protocol must be opc.tcp (as http is not implemented) 2) Security uses sign and encrypt 3) Select highest security level (determined by the server) 4) Prefer hostname over localhost
endpoints - an array of EndpointDescription objects.
public static void reverse(Object array)
array - a Object object.
public static UserIdentityToken createUserNameIdentityToken(EndpointDescription ep,
byte[] senderNonce,
String username,
String password)
throws ServiceResultException
ep - a EndpointDescription object.username - a String object.password - a String object.senderNonce - an array of byte.
ServiceResultException - if endpoint or the stack doesn't support UserName token policy
public static UserIdentityToken createIssuedIdentityToken(EndpointDescription ep,
byte[] senderNonce,
byte[] issuedIdentityToken)
throws ServiceResultException
ep - a EndpointDescription object.senderNonce - an array of byte.issuedIdentityToken - an array of byte.
ServiceResultException - if endpoint or the stack doesn't support UserName token policy
public static Set<InetAddress> getInetAddresses()
throws SocketException
SocketException - if any.
public static Set<InetAddress> getInetAddresses(boolean enableIPv6)
throws SocketException
enableIPv6 - Set true to enable IPv6 addressing. Requires Java 7 or later on Windows platforms.
SocketException - if any.
public static String getHostname()
throws SocketException
String object.
SocketException - if any.
public static Set<String> getInetAddressNames()
throws SocketException
SocketException - if any.public static String inetAddressToName(InetAddress addr)
inetAddressToName.
addr - a InetAddress object.
String object.
public static List<SocketAddress> toSocketAddresses(String endpointUrl)
throws IllegalArgumentException
endpointUrl - a String object.
IllegalArgumentException - endpointUrl is problematic some way
public static List<SocketAddress> toSocketAddresses(String endpointUrl,
boolean enableIPv6)
throws IllegalArgumentException
endpointUrl - a String object.enableIPv6 - Set true to enable IPv6 addressing. Requires Java 7 or later on Windows platforms.
IllegalArgumentException - endpointUrl is problematic some way
public static UserIdentityToken createAnonymousIdentityToken(EndpointDescription ep)
throws ServiceResultException
ep - a EndpointDescription object.
ServiceResultException - if endpoint or the stack doesn't support Anonymous token policy
public static X509IdentityToken createX509IdentityToken(EndpointDescription ep,
byte[] serverNonce,
Cert certificate,
PrivateKey key,
SignatureData signatureData)
throws ServiceResultException
createX509IdentityToken.
ep - a EndpointDescription object.serverNonce - an array of byte.certificate - a Cert object.key - a PrivateKey object.signatureData - a SignatureData object.
X509IdentityToken object.
ServiceResultException - if any.
public static boolean urlEqualsHostIgnoreCase(URI uri,
URI requestedUri)
uri - a URI object.requestedUri - a URI object.
public static boolean urlEqualsHostIgnoreCase(String endpointUrl,
String url)
endpointUrl - a String object.url - a String object.
public static boolean containsSecureUserTokenPolicy(UserTokenPolicy[] userIdentityTokens)
containsSecureUserTokenPolicy.
userIdentityTokens - an array of UserTokenPolicy objects.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||