@Create(value="create-server-pool-user", resolver = ServerPoolResolver.class, i18n = @I18n("org.glassfish.virtualization.create-machine")) void setUser(VirtUser user);
@Override public void postConstruct() { super.postConstruct(); create = getAnnotation(targetMethod, Create.class); resolverType = create.resolver(); try { model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(), new LocalStringManagerImpl(targetType), habitat.<DomDocument>getService(DomDocument.class), commandName, AnnotationUtil.presentTransitive(ManagedJob.class, create.decorator()), create.resolver(), create.decorator()); if (logger.isLoggable(level)) { for (String paramName : model.getParametersNames()) { CommandModel.ParamModel param = model.getModelFor(paramName); logger.log(Level.FINE, "I take {0} parameters", param.getName()); } } } catch(Exception e) { String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.command_model_exception", "Exception while creating the command model for the generic command {0} : {1}", commandName, e.getMessage()); logger.log(Level.SEVERE, ConfigApiLoggerInfo.GENERIC_CREATE_CMD_FAILED, commandName); throw new RuntimeException(msg, e); } }
@Override public Class getDecoratorClass() { if (create != null) { return create.decorator(); } else { return null; } }
CreationDecorator<ConfigBeanProxy> decorator = habitat.getComponent(create.decorator()); if (decorator==null) { String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.decorator_not_found", "The CreationDecorator {0} could not be found in the habitat, is it annotated with @Service ?", create.decorator().toString()); result.failure(logger, msg); throw new TransactionFailure(msg);
@Create(value="create-template-user", resolver = TemplateResolver.class, i18n = @I18n("org.glassfish.virtualization.create-machine")) void setUser(VirtUser user);
public void postConstruct() { super.postConstruct(); create = getAnnotation(targetMethod, Create.class); resolverType = create.resolver(); try { model = new GenericCommandModel(targetType, true, create.cluster(), create.i18n(), new LocalStringManagerImpl(targetType), habitat.getComponent(DomDocument.class), commandName, create.resolver(), create.decorator()); if (logger.isLoggable(level)) { for (String paramName : model.getParametersNames()) { CommandModel.ParamModel param = model.getModelFor(paramName); logger.fine("I take " + param.getName() + " parameters"); } } } catch(Exception e) { String msg = localStrings.getLocalString(GenericCrudCommand.class, "GenericCreateCommand.command_model_exception", "Exception while creating the command model for the generic command {0} : {1}", commandName, e.getMessage()); logger.severe(msg); throw new ComponentException(msg, e); } }
decorator = habitat.getService(create.decorator()); "GenericCreateCommand.decorator_not_found", "The CreationDecorator {0} could not be found in the habitat, is it annotated with @Service ?", create == null ? "null" : create.decorator().toString()); result.failure(logger, msg); throw new TransactionFailure(msg);
@Create(value="create-machine-user", resolver = MachineResolver.class, i18n = @I18n("org.glassfish.virtualization.create-machine")) void setUser(VirtUser user);
/** * Return the list of currently configured elastic service. Services can * be added or removed by using the returned {@link java.util.List} * instance * * @return the list of configured {@link ElasticServiceConfig} */ @Create(value = "_create-elastic-services-element", resolver = ESResolver.class, i18n = @I18n("org.glassfish.elasticity.config.create-elastic-service-element")) @Element ("elasticservice") public List<ElasticServiceConfig> getElasticService();
/** * Gets the value of the config property. <p/> <p/> This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This * is why there is not a <CODE>set</CODE> method for the config property. <p/> <p/> For example, to add a new item, * do as follows: * <pre> * getConfig().add(newItem); * </pre> * <p/> <p/> <p/> Objects of the following type(s) are allowed in the list {@link Config } */ @Create(value="_create-config", i18n=@I18n("create.config.command")) @Element(required=true) List<Config> getConfig();
/** * Gets the value of the config property. <p/> <p/> This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This * is why there is not a <CODE>set</CODE> method for the config property. <p/> <p/> For example, to add a new item, * do as follows: * <pre> * getConfig().add(newItem); * </pre> * <p/> <p/> <p/> Objects of the following type(s) are allowed in the list {@link Config } */ @Create(value="_create-config", i18n=@I18n("create.config.command")) @Element(required=true) List<Config> getConfig();
/** * Return the list of clusters currently configured * * @return list of {@link Cluster } */ @Element @Create(value="create-cluster", decorator=Cluster.Decorator.class, i18n=@I18n("create.cluster.command")) @Delete(value="delete-cluster", resolver= TypeAndNameResolver.class, decorator=Cluster.DeleteDecorator.class , i18n=@I18n("delete.cluster.command")) public List<Cluster> getCluster();
/** * Return the list of nodes currently configured * * @return list of {@link Node } */ @Element @Create(value="_create-node", decorator=Node.Decorator.class, i18n=@I18n("_create.node.command") ) @Delete(value="_delete-node", resolver= TypeAndNameResolver.class, decorator=Node.DeleteDecorator.class, i18n=@I18n("delete.node.command")) public List<Node> getNode();
/** * Return the list of clusters currently configured * * @return list of {@link Cluster } */ @Element @Create(value="create-cluster", decorator=Cluster.Decorator.class, i18n=@I18n("create.cluster.command")) @Delete(value="delete-cluster", resolver= TypeAndNameResolver.class, decorator=Cluster.DeleteDecorator.class , i18n=@I18n("delete.cluster.command")) public List<Cluster> getCluster();
/** * Return the list of nodes currently configured * * @return list of {@link Node } */ @Element @Create(value="_create-node", decorator=Node.Decorator.class, i18n=@I18n("_create.node.command") ) @Delete(value="_delete-node", resolver= TypeAndNameResolver.class, decorator=Node.DeleteDecorator.class, i18n=@I18n("delete.node.command")) public List<Node> getNode();
/** * Return the list of currently configured server. Servers can * be added or removed by using the returned {@link java.util.List} * instance * * @return the list of configured {@link Server} */ @Element // example below on how to annotate a CRUD command with cluster specific data. @Create(value="_register-instance", resolver= TypeResolver.class, decorator= Server.CreateDecorator.class, cluster=@org.glassfish.api.admin.ExecuteOn(value = RuntimeType.DAS), i18n=@I18n("_register.instance.command")) @Delete(value="_unregister-instance", resolver= TypeAndNameResolver.class, decorator=Server.DeleteDecorator.class, cluster=@org.glassfish.api.admin.ExecuteOn(value = {RuntimeType.DAS,RuntimeType.INSTANCE}), i18n=@I18n("_unregister.instance.command")) public List<Server> getServer();
/** * Return the list of currently configured server. Servers can * be added or removed by using the returned {@link java.util.List} * instance * * @return the list of configured {@link Server} */ @Element // example below on how to annotate a CRUD command with cluster specific data. @Create(value="_register-instance", resolver= TypeResolver.class, decorator= Server.CreateDecorator.class, cluster=@org.glassfish.api.admin.ExecuteOn(value = RuntimeType.DAS), i18n=@I18n("_register.instance.command")) @Delete(value="_unregister-instance", resolver= TypeAndNameResolver.class, decorator=Server.DeleteDecorator.class, cluster=@org.glassfish.api.admin.ExecuteOn(value = {RuntimeType.DAS,RuntimeType.INSTANCE}), i18n=@I18n("_unregister.instance.command")) public List<Server> getServer();
/** * This really should not be here mixing clients and providers information , but for prototyping * it's fine. */ @Element("server-pool") @Create(value = "create-server-pool", resolver = VirtResolver.class, decorator = ServerPoolDecorator.class, i18n = @I18n("org.glassfish.virtualization.create-virt-serverPool")) @Listing(value = "list-server-pools", resolver = VirtResolver.class, i18n = @I18n("org.glassfish.virtualization.list-virt-groups")) @Delete(value="delete-server-pool", resolver= TypeAndNameResolver.class, i18n = @I18n("org.glassfish.virtualization.list-virt-serverPool")) List<ServerPoolConfig> getServerPools();
@Element @Create(value = "create-machine", resolver = ServerPoolResolver.class, i18n = @I18n("org.glassfish.virtualization.create-machine")) @Listing(value = "list-machines", resolver = ServerPoolResolver.class, i18n = @I18n("org.glassfish.virtualization.list-machines")) @Delete(value="delete-machine", resolver= WithinGroupResolver.class, i18n = @I18n("org.glassfish.virtualization.delete-machine")) List<MachineConfig> getMachines();
/** * Gets the value of the lbConfig property. * <p/> * <p/> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the lbConfig property. * <p/> * <p/> * For example, to add a new item, do as follows: * <pre> * getLbConfig().add(newItem); * </pre> * <p/> * <p/> * <p/> * Objects of the following type(s) are allowed in the list * {@link LbConfig } */ @Element @Create(value="create-http-lb-config", decorator=LbConfig.Decorator.class, cluster=@org.glassfish.api.admin.ExecuteOn(value = RuntimeType.DAS), i18n=@I18n("create.http.lb.config.command")) @Delete(value="delete-http-lb-config", resolver= TypeAndNameResolver.class, decorator=LbConfig.DeleteDecorator.class, i18n=@I18n("delete.http.lb.config.command")) public List<LbConfig> getLbConfig();