Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.asLong()


                                                StatisticNameLookup.statisticNameLookup(statisticName),
                                                Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                                    } else if(Long.class.equals(statistics.getType(statisticName))) {
                                        statistics.setValue(
                                                statisticName,
                                                value.asLong(),
                                                entityManagerFactoryLookup,
                                                StatisticNameLookup.statisticNameLookup(statisticName),
                                                Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                                    } else {
                                        statistics.setValue(
View Full Code Here


public class ModelNodeUtil {
    public static Long getLongIfSetOrGetDefault(final OperationContext context, final ModelNode dataSourceNode, final SimpleAttributeDefinition key) throws OperationFailedException {

        ModelNode resolvedNode = key.resolveModelAttribute(context, dataSourceNode);
        return resolvedNode.isDefined() ? resolvedNode.asLong() : null;
    }

    public static Integer getIntIfSetOrGetDefault(final OperationContext context, final ModelNode dataSourceNode, final SimpleAttributeDefinition key) throws OperationFailedException {

        ModelNode resolvedNode = key.resolveModelAttribute(context, dataSourceNode);
View Full Code Here

                            break;
                        case INT:
                            toSet.set(modelValue.asInt());
                            break;
                        case LONG:
                            toSet.set(modelValue.asLong());
                            break;
                        case STRING:
                            toSet.set(modelValue.asString());
                            break;
                        default:
View Full Code Here

                            break;
                        case INT:
                            toSet.set(modelValue.asInt());
                            break;
                        case LONG:
                            toSet.set(modelValue.asLong());
                            break;
                        case STRING:
                            toSet.set(modelValue.asString());
                            break;
                        default:
View Full Code Here

   * @param propertyName  the name of the property to get
   * @return  the property or null if not defined
   */
  public static Long getAsLong(final ModelNode node, String propertyName) {
    final ModelNode propertyNode = node.get(propertyName);
    return propertyNode.isDefined() ? propertyNode.asLong() : null;
  }
 
  /**
   * returns the property as list
   *
 
View Full Code Here

   * @param propertyName  the name of the property to get
   * @return  the property or null if not defined
   */
  public static Long getAsLong(final ModelNode node, String propertyName) {
    final ModelNode propertyNode = node.get(propertyName);
    return propertyNode.isDefined() ? propertyNode.asLong() : null;
  }
 
  /**
   * returns the property as list
   *
 
View Full Code Here

                            break;
                        case INT:
                            toSet.set(modelValue.asInt());
                            break;
                        case LONG:
                            toSet.set(modelValue.asLong());
                            break;
                        case STRING:
                            toSet.set(modelValue.asString());
                            break;
                        default:
View Full Code Here

        }
        if (notificationPrefix.isDefined()) {
            simplePushConfig.endpointPrefix(notificationPrefix.asString());
        }
        if (notificationAckInterval.isDefined()) {
            simplePushConfig.ackInterval(notificationAckInterval.asLong());
        }
        return simplePushConfig;
    }

}
View Full Code Here

                for (ModelNode modelValue : modelValues) {
                    values.add(modelValue.asString());
                }
                return values;
            case LONG:
                return defaultValue != null ? node.asLong(defaultValue.asLong()) : node.asLong();
            case TYPE:
            case UNDEFINED:
            case PROPERTY:
                throw new OperationFailedException("Unexpected type " + defn.getType() + " for " + defn);
View Full Code Here

public class ModelNodeUtil {
    public static Long getLongIfSetOrGetDefault(final OperationContext context, final ModelNode dataSourceNode, final SimpleAttributeDefinition key) throws OperationFailedException {

        ModelNode resolvedNode = key.resolveModelAttribute(context, dataSourceNode);
        return resolvedNode.isDefined() ? resolvedNode.asLong() : null;
    }

    public static Integer getIntIfSetOrGetDefault(final OperationContext context, final ModelNode dataSourceNode, final SimpleAttributeDefinition key) throws OperationFailedException {

        ModelNode resolvedNode = key.resolveModelAttribute(context, dataSourceNode);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.