本文整理汇总了Java中org.jboss.dmr.ModelNode.hasDefined方法的典型用法代码示例。如果您正苦于以下问题:Java ModelNode.hasDefined方法的具体用法?Java ModelNode.hasDefined怎么用?Java ModelNode.hasDefined使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.dmr.ModelNode
的用法示例。
在下文中一共展示了ModelNode.hasDefined方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performRuntime
import org.jboss.dmr.ModelNode; //导入方法依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
final ModelNode profileEntry = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
final Set<String> outboundSocketBindings = new HashSet<>();
ConfigurationBuilder builder = new ConfigurationBuilder();
if (profileEntry.hasDefined(CommonAttributes.ID_NAME)) {
builder.setDescription(profileEntry.get(CommonAttributes.ID_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.JNDI_NAME)) {
builder.setJNDIName(profileEntry.get(CommonAttributes.JNDI_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.MODULE_NAME)) {
builder.setModuleName(profileEntry.get(CommonAttributes.MODULE_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.TRANSACTION)) {
builder.setTransactionEnlistment(TransactionEnlistmentType.getFromStringValue(profileEntry.get(CommonAttributes.TRANSACTION).asString()));
}
if (profileEntry.hasDefined(CommonAttributes.HOST_DEF)) {
ModelNode hostModels = profileEntry.get(CommonAttributes.HOST_DEF);
for (ModelNode host : hostModels.asList()) {
for (ModelNode hostEntry : host.get(0).asList()) {
if (hostEntry.hasDefined(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF)) {
String outboundSocketBindingRef = hostEntry.get(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF).asString();
outboundSocketBindings.add(outboundSocketBindingRef);
}
}
}
}
if (profileEntry.hasDefined(CommonAttributes.SECURITY_DOMAIN)) {
builder.setSecurityDomain(profileEntry.get(CommonAttributes.SECURITY_DOMAIN).asString());
}
startNeo4jDriverService(context, builder, outboundSocketBindings);
}
示例2: getConfiguration
import org.jboss.dmr.ModelNode; //导入方法依赖的package包/类
private Configuration getConfiguration(ModelNode profileEntry) {
Configuration.Builder builder = new Configuration.Builder();
if (profileEntry.hasDefined(CommonAttributes.ID)) {
builder.profileName(profileEntry.get(CommonAttributes.ID).asString());
}
if (profileEntry.hasDefined(CommonAttributes.DATABASE)) {
builder.database(profileEntry.get(CommonAttributes.DATABASE).asString());
}
if (profileEntry.hasDefined(CommonAttributes.REMOTE)) {
builder.remote(profileEntry.get(CommonAttributes.REMOTE).asBoolean());
}
if (profileEntry.hasDefined(CommonAttributes.JNDI_NAME)) {
builder.jndiName(profileEntry.get(CommonAttributes.JNDI_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.MODULE_NAME)) {
builder.moduleName(profileEntry.get(CommonAttributes.MODULE_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.SECURITY_DOMAIN)) {
builder.securityDomain(profileEntry.get(CommonAttributes.SECURITY_DOMAIN).asString());
}
if (profileEntry.hasDefined(CommonAttributes.MAX_PARTITION_SIZE)) {
builder.maxPartitionSize(profileEntry.get(CommonAttributes.MAX_PARTITION_SIZE).asInt());
}
if (profileEntry.hasDefined(CommonAttributes.MAX_POOL_SIZE)) {
builder.maxPoolSize(profileEntry.get(CommonAttributes.MAX_POOL_SIZE).asInt());
}
return builder.build();
}
示例3: getOutboundSocketBinding
import org.jboss.dmr.ModelNode; //导入方法依赖的package包/类
private String getOutboundSocketBinding(ModelNode profileEntry) {
if (profileEntry.hasDefined(CommonAttributes.HOST)) {
ModelNode hostModels = profileEntry.get(CommonAttributes.HOST);
for (ModelNode host : hostModels.asList()) {
for (ModelNode hostEntry : host.get(0).asList()) {
if (hostEntry.hasDefined(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF)) {
return hostEntry.get(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF).asString();
}
}
}
}
return null;
}
示例4: performRuntime
import org.jboss.dmr.ModelNode; //导入方法依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
final ModelNode profileEntry = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
final Set<String> outboundSocketBindings = new HashSet<>();
ConfigurationBuilder builder = new ConfigurationBuilder();
if (profileEntry.hasDefined(CommonAttributes.ID_NAME)) {
builder.setDescription(profileEntry.get(CommonAttributes.ID_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.JNDI_NAME)) {
builder.setJNDIName(profileEntry.get(CommonAttributes.JNDI_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.MODULE_NAME)) {
builder.setModuleName(profileEntry.get(CommonAttributes.MODULE_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.DATABASE)) {
builder.setKeyspace(profileEntry.get(CommonAttributes.DATABASE).asString());
}
if (profileEntry.hasDefined(CommonAttributes.SSL)) {
builder.setWithSSL(profileEntry.get(CommonAttributes.SSL).asBoolean());
}
if (profileEntry.hasDefined(CommonAttributes.HOST_DEF)) {
ModelNode hostModels = profileEntry.get(CommonAttributes.HOST_DEF);
for (ModelNode host : hostModels.asList()) {
for (ModelNode hostEntry : host.get(0).asList()) {
if (hostEntry.hasDefined(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF)) {
String outboundSocketBindingRef = hostEntry.get(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF).asString();
outboundSocketBindings.add(outboundSocketBindingRef);
}
}
}
}
if (profileEntry.hasDefined(CommonAttributes.SECURITY_DOMAIN)) {
builder.setSecurityDomain(profileEntry.get(CommonAttributes.SECURITY_DOMAIN).asString());
}
startCassandraDriverService(context, builder, outboundSocketBindings);
}
示例5: peek
import org.jboss.dmr.ModelNode; //导入方法依赖的package包/类
private ModelNode peek(ModelNode node, String... args) {
for (String arg : args) {
if (!node.hasDefined(arg)) {
return null;
}
node = node.get(arg);
}
return node;
}
示例6: performRuntime
import org.jboss.dmr.ModelNode; //导入方法依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
final ModelNode profileEntry = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
final Set<String> outboundSocketBindings = new HashSet<>();
ConfigurationBuilder builder = new ConfigurationBuilder();
if (profileEntry.hasDefined(CommonAttributes.ID_NAME)) {
builder.setDescription(profileEntry.get(CommonAttributes.ID_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.JNDI_NAME)) {
builder.setJNDIName(profileEntry.get(CommonAttributes.JNDI_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.MODULE_NAME)) {
builder.setModuleName(profileEntry.get(CommonAttributes.MODULE_NAME).asString());
}
if (profileEntry.hasDefined(CommonAttributes.DATABASE)) {
builder.setDatabase(profileEntry.get(CommonAttributes.DATABASE).asString());
}
if (profileEntry.hasDefined(CommonAttributes.SECURITY_DOMAIN)) {
builder.setSecurityDomain(profileEntry.get(CommonAttributes.SECURITY_DOMAIN).asString());
}
if (profileEntry.hasDefined(CommonAttributes.AUTH_TYPE)) {
AuthType authType = AuthType.valueOf(profileEntry.get(CommonAttributes.AUTH_TYPE).asString());
builder.setAuthType(authType);
}
if (profileEntry.hasDefined(CommonAttributes.SSL)) {
builder.setSSL(profileEntry.get(CommonAttributes.SSL).asBoolean());
}
if (profileEntry.hasDefined(CommonAttributes.HOST_DEF)) {
ModelNode hostModels = profileEntry.get(CommonAttributes.HOST_DEF);
for (ModelNode host : hostModels.asList()) {
for (ModelNode hostEntry : host.get(0).asList()) {
if (hostEntry.hasDefined(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF)) {
String outboundSocketBindingRef = hostEntry.get(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF).asString();
outboundSocketBindings.add(outboundSocketBindingRef);
}
}
}
}
if (profileEntry.hasDefined(CommonAttributes.PROPERTIES)) {
for (ModelNode propertyProfiles : profileEntry.get(CommonAttributes.PROPERTIES).asList()) {
for (ModelNode propertyModels : propertyProfiles.get(0).asList()) {
if (propertyModels.hasDefined(CommonAttributes.PROPERTY)) {
for (Property property : propertyModels.get(CommonAttributes.PROPERTY).asPropertyList()) {
if (property.getName().equals(CommonAttributes.WRITE_CONCERN)) {
builder.setWriteConcern(WriteConcernType.valueOf(property.getValue().asString()).name());
} else if (property.getName().equals(CommonAttributes.READ_CONCERN)) {
builder.setReadConcern(ReadConcernType.valueOf(property.getValue().asString()).name());
}
}
}
}
}
}
startMongoDriverService(context, builder, outboundSocketBindings);
}