本文整理汇总了Java中com.digitalpetri.opcua.stack.core.StatusCodes.Bad_InternalError方法的典型用法代码示例。如果您正苦于以下问题:Java StatusCodes.Bad_InternalError方法的具体用法?Java StatusCodes.Bad_InternalError怎么用?Java StatusCodes.Bad_InternalError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.digitalpetri.opcua.stack.core.StatusCodes
的用法示例。
在下文中一共展示了StatusCodes.Bad_InternalError方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sign
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
/**
* Sign the contents of the provided buffers using the provided {@link SecurityAlgorithm}.
* Note that only the bytes between position and limit of each buffer are considered.
*
* @param securityAlgorithm the {@link SecurityAlgorithm}.
* @param privateKey the {@link PrivateKey} to sign with.
* @param buffers the data to sign.
* @return the signature bytes.
* @throws UaException
*/
public static byte[] sign(SecurityAlgorithm securityAlgorithm,
PrivateKey privateKey,
ByteBuffer... buffers) throws UaException {
String transformation = securityAlgorithm.getTransformation();
try {
Signature signature = Signature.getInstance(transformation);
signature.initSign(privateKey);
for (ByteBuffer buffer : buffers) {
signature.update(buffer);
}
return signature.sign();
} catch (GeneralSecurityException e) {
throw new UaException(StatusCodes.Bad_InternalError, e);
}
}
示例2: createNodeId
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private NodeId createNodeId(UShort namespaceIndex, Object identifier, IdType type) {
switch (type) {
case Numeric:
return new NodeId(namespaceIndex, (UInteger) identifier);
case String:
return new NodeId(namespaceIndex, (String) identifier);
case Guid:
return new NodeId(namespaceIndex, (UUID) identifier);
case Opaque:
return new NodeId(namespaceIndex, (ByteString) identifier);
default:
throw new UaRuntimeException(StatusCodes.Bad_InternalError, "unhandled type: " + type);
}
}
示例3: addUri
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
public synchronized UShort addUri(String uri) {
UShort index = ushort(1);
while (uriTable.containsKey(index)) {
index = ushort(index.intValue() + 1);
if (index.intValue() == 65535) {
throw new UaRuntimeException(StatusCodes.Bad_InternalError, "uri table full");
}
}
uriTable.put(index, uri);
return index;
}
示例4: addUri
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
public synchronized int addUri(String uri) {
int index = 1;
while (uriTable.containsKey(index)) {
index++;
if (index == 65535) {
throw new UaRuntimeException(StatusCodes.Bad_InternalError, "uri table full");
}
}
uriTable.put(index, uri);
return index;
}
示例5: createKey
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
private static byte[] createKey(String transformation, byte[] secret, byte[] seed, int offset, int length) {
try {
Mac mac = Mac.getInstance(transformation);
byte[] tempBytes = P_hash(transformation, secret, seed, mac, offset + length);
byte[] key = new byte[length];
System.arraycopy(tempBytes, offset, key, 0, key.length);
return key;
} catch (Exception e) {
throw new UaRuntimeException(StatusCodes.Bad_InternalError, e);
}
}
示例6: sha1
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
/**
* Compute the SHA1 digest for a given input.
*
* @param input the input to compute the digest for.
* @return the SHA1 digest of {@code input}.
*/
public static byte[] sha1(byte[] input) {
MessageDigest messageDigest = sha1Digest.get();
if (messageDigest == null) {
try {
messageDigest = MessageDigest.getInstance("SHA1");
sha1Digest.set(messageDigest);
} catch (NoSuchAlgorithmException e) {
throw new UaRuntimeException(StatusCodes.Bad_InternalError, e);
}
}
return messageDigest.digest(input);
}
示例7: onCreateSession
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
@Override
public void onCreateSession(ServiceRequest<CreateSessionRequest, CreateSessionResponse> req) throws UaException {
throw new UaException(StatusCodes.Bad_InternalError);
}
示例8: onActivateSession
import com.digitalpetri.opcua.stack.core.StatusCodes; //导入方法依赖的package包/类
@Override
public void onActivateSession(ServiceRequest<ActivateSessionRequest, ActivateSessionResponse> req) throws UaException {
throw new UaException(StatusCodes.Bad_InternalError);
}