Foreword
This document is intended as a reference manual for the Topoi language. It lists the language constructs, and gives their precise syntax and informal semantics. It is by no means a tutorial introduction to the language.
In future we will make a proper landing page for the language. But right now it serves as our internal team's draft.
Notations
The syntax of the languages is given in BNF-like notation.
Where square brackets [...]
denote optional components, curly brackets {...}
denotes zero, one or several repetitions of the encolesd components.
Curly brackets with a trailing asterisk sign {...}*
denote one or several repetitions of the encolosed components.
Parentheses (...)
denote grouping of components.
| Notation | Repetition |
|---|---|
{...}? |
0 or 1 |
{...}* |
0 or more |
{...}+ |
1 or more |
Identifier and Keywords
identifier
= letter (letter | "_" | "'" )*
| "_" identifier
qualified_identifier
= (identifier ".")+
When referencing something inside a module or a record, or a tuple, we use a qualified name (qualified_identifier
).
Comment and Documentation
prefix
= letter (letter | "_" | "'" )*
| "_" prefix
comment
= "--" (char)* newline
doc_comment
= "--|" (char)* newline
prefixed_doc_comment
= "--|" prefix "|" (char)* newline
block_comment
= "--[" (char)* "]--"
prefixed_block_comment
= "--[" prefix "|" (char)* "]--"
Content enclosed in documentation comment (doc_comment
) and prefixed block comment (prefixed_block_comment
) are conversed in AST and will be output or generated as web content.
The prefix is just a name that will let compiler pass to know what generator used to process the content inside the doc comment or block comment. eg.: LaTex, KaTeX, markdown...
Primitive value and types
Full Grammar
program
= {definition}+
definition
= constant_definition
| type_definition
constant_definition
= assignable [":" type] ":=" expression
assignable
= identifier
| destructurable
destructurable
= "("
{identifier [":" type] ["as" assignable]","}*
["..." identifier]
")"
expression
= function_abstraction
| function_application
| identifier
| record
| adt_construction
function_abstraction
= "{" {assignable "->" expression ","}+ "}"
function_application
= expression "." expression
record
= "(" {record_body ","}*")"
record_body
= identifier [":" type] [":=" expression]
| spread_expression
spread_expression
= "..." expression
type
= identifier
| function_type
| record_type
| type_function_application
type_function_application
= function_application
function_type
= record_type "->" (record_type|function_type)
record_type
= "(" {identifier [":" type]}* ")"
type_definition
= "type" identifier [":" type ":=" type_body]
type_body
= {"|" constructor [record_type] ":" type}+
constructor
= identifier
Expressions
Record
Record expression are key-value pairs. Each record are enclosed by round brackets.
Record Construction
Empty record is denoted as ()
.
Examples of non-empty records:
(name := "topoi", age := "12")
Each property of a record can so be optionally typed, to ensure that the property will be initiated with the correct type.
(name : String = "topoi", age := "0")
We can also construct nested record:
(
name := "topoi",
friend := (
name := "haskell",
age := "30"
)
)
Shorthand construction
Suppose we have two variables x
and y
, to create a record like (x := x, y := y)
, we can instead write as (x, y)
. This feature can prevent property mismatch like (x := y, y := y)
.
Record Type
The type of each record can be inferred by the Topoi type system, for example (name := "topoi", age := "12")
has the type of (name: String, age: String)
Record destructuring
The property of each record can be destructured, and be populated in the current environment.
(name, age) := (name := "topoi", age := "0")
-- `name` and `age` will be exposed to the current environment as named variables
Note that not all of the properties need to be destructured.
(name) := (name := "topoi", age := "0")
Also, the destructuring order does not matter:
(age, name) := (name := "topoi", age := "0")
Besides that, we can also re-alias the property name using they keyword as
.
(name as myName, age) = (name := "topoi", age := 1)
-- `myName` and `age` is exposed, but `name` is not
Accessing properties
We can do it by using the dot notation.
record.propertyName
For example:
me := (name := "john", age := 2)
myName = me.name
Mutating properties
In Topoi, properties mutation is not allowed, however we can use the spread notation with the triple dot operator.
For example,
me := (name := "john", age := 2)
newMe := (...me, age := 3)
Basically it's the same as JavaScript spread operation.
We can also combine the properties of multiple records into one as such:
me := (name := "john", age := 2)
otherDetail := （address := "sea")
fullMe = (...me, ...otherDetail)
Function
Constructing function
We can construct an unnamed function using the {arguments -> body}
notation.
However, note that the function arguments must be of record type, and the return type must also be record type or function type.
For example:
add := {
(value: Int, by: Int) -> (
result := 0
)
}
Function type
Each function has a type, for example, the add
function above has the type of:
(value: Int, by: Int) -> (result: Int)
Because of that, we can also define the add
function as such:
add
: (value: Int, by: Int) -> (result: Int)
= {
(value, by) -> (result := 0)
}
Using function
In Topoi, we can use (a.k.a. apply) a function using the following notation (note that this is the only allowed notation):
arg1.func(arg2 := value1, arg3 := value2, ...)
Note that the first argument can ignore the property name, and the order is not important.
For example, the following function usage are equivalent:
1.add(by := 2)
2.add(value := 1)
(value:=1, by:=2).add
We can also chain function call:
1.add(by:= 2).add(by:= 3)
Because of the dot notation, we can also directly apply an unnamed function (a.k.a. lambda) to an expression.
(x:=1, y:=2).{
(x, y) -> x.add(by:=y)
}
Pattern Matching (not finalized)
We can pattern match a value using the equal
operator.
For example:
divide : (value: Int, by: Int) -> (result: Result.where(ok:= Int, fail:= String)) := {
(by = 0) -> Result.fail("Cannot divide by 0"),
(value, by) -> (
result := -- something
)
}
Another example:
type Shape :=
| Circle (radius: Float)
| Rectangle (height: Float, width: Float)
| None
area: (shape: Shape) -> (result: Float) := {
(shape = Circle(radius)) ->
radius.square.multiple(by:= pi),
(shape = Rectangle(height, width)) ->
height.multiple(by:= width),
(shape = None) ->
0
}


This course combines Genetics, Human Genetics, Evolution and Ecology. It is an introductory course for non-science majors, and it is hoped that you will develop a basic understanding of genetic and biological terms and their importance to our technologically advanced society. Evolution is a central theme of biology and it helps us to understand the process of life that is ongoing all across our globe. The interactions among members of that global community provide the backdrop for understanding the ecology of our planet and our place in that community. There are no prerequisites for this course.
All students are expected to complete the weekly quizzes on time. These will be available for at least one week so budget your time accordingly. You are not able to take all of your tests at one time and be done. This course is paced so you can progress through at a reasonable speed.
Each week there will be at least one lesson for you to study. Each lesson will have one quiz, one homework assignment, and textbook assignment (LearnSmart modules, Labs, etc.). Be aware that some weeks there may be more than one lesson, thus more than one quiz and homework/textbook assignments. Each of these have specific due dates listed on the folder in which you find them.
You may complete the homework and textbook assignments early as they will be available from the start of the semester. However, each quiz has a definite shelf life. Quizzes are meant to activate on a Saturday and deactivate on the following Sunday. That means you have more than a week to complete it. At no other time will you be able to view or complete quizzes, it is impossible to open up the quiz for a single person. The only exception to this is an instance of the quiz being improperly configured. If I short the class on time due an incorrect setting I will open up the quiz for additional time and everyone will have an opportunity to then complete it. However, that has been a rare event (but if it happens, notify the instructor). Pay attention to due dates, each assignment has one listed with the folder for that week.
The quizzes are set to overlap so you can manage your schedule if you happen to be away from a computer for an entire weekend. If you know that will happen then either get things out of the way very early or make it a point to finish the following weekend. Missing an assignment should never happen if you manage your time properly. You will be entirely responsible for your time and scheduling.
The weekly quizzes will be timed so it will not be possible to look up the answers to these questions at your leisure. The expectation is that you will study the content, gain some level of mastery of the terminology and take the tests to see how well you know everything. You are not to have access to sources of information when you take these tests, they are not open book.
The homework assignments may be completed ahead of schedule but not after the due date. Being late a day or two will result in a late penalty. Homework turned in after that will result in a zero. Homework assignments should not be copied from any other source, cited correctly or not. Many assignments will have you finding information from sources including the internet, however, a cut and paste job does not equal effort. Googling information is not considered an academic achievement.
Everything you write is expected to be your own work, not something you find and copy from the internet. It's perfectly clear when students have plagiarized a paragraph from a web page. It only takes 30 minutes to find a few web sites about a topic and then write up a summary of what you find. Don't risk University sanctions and an F for a homework assignment that should take less than an hour. See the statement on academic integrity for further information.
Since you have seven days in which to submit homework, and take a quiz, I will not accept illness or technical difficulties as an excuse to make up missed work. The only exception to this would be an extended hospitalization stay. All quizzes and homework message boards are available at the beginning of of the course. The due dates listed with each assignment are the last days that a quiz or homework assignment is available. To avoid missing deadlines, submit your work early and avoid waiting until the last evening at 11:55 pm to submit your homework or take a quiz. Your internet dropping out at the last possible minute to submit work is not a reasonable cause for being unable to complete work in a timely manner. Do not turn in work at the last possible minute. No scores will be dropped. Work cannot be turned in for a higher grade once a grade is assigned. There will be no opportunities to turn in extra work for extra credit. Be prepared to do the necessary work to reach your goals for a final grade.
All course work will be submitted to your instructor through Canvas. To do this, you will need to:
The Grading Scale can be found in the Getting Started section of Canvas. All grades can be found in Canvas by going to the Grades button on the left hand side.
Each lesson has a quiz that will vary in length between 10 and 20 points each. Some will be longer than others depending on the amount of material covered in a particular lesson.
Each quiz question is worth 1 point out of the total. Every question is worth exactly the same as any other question; only the length of the quiz each week will vary. Do not think in terms of percentage points here, this will be a point system based on total points.
Students will work on these assignments as an individual and will be responsible for completing them on time. Late assignments will have a deduction, assignments more than a couple of days late will not be accepted. Once we reach the end of the course it will not be possible to go back and complete work that is outdated by weeks or even months. Keep up on assignments to gain maximum points.
Grades are based on a combination of quizzes where each question is worth one point and various homework assignments worth a handful of points. All students are expected to complete the weekly quizzes on time. These will be available for at least one week so budget your time accordingly. You are not able to take all your tests at one time and be done. This course is paced so you can progress through at a reasonable speed.Each homework assignment has a specific number of points associated with it.
Any questions concerning a particular quiz or homework assignment must be resolved immediately. You cannot wait till the end of the semester to correct any problems. Due to time constraints, it will be impossible to review all assignments on the last day in the hope of finding one or two points to meet a grade cutoff. You should ask that all grading issues be resolved as they occur during the semester. No exams will be dropped; no extra credit will be accepted. It's impossible to evaluate hundreds of book reports or shoebox dioramas.
Students who are unable to complete the course because of illness or emergency may be granted a deferred grade which will allow the student to complete the course within the first six weeks of the following semester.
When a request for a deferred grade is supported by the instructor, the instructor indicates this approval by recording the deferred grade symbol (DF) for the student. The expiration date for the deferred grade is automatically recorded as the end of the sixth week of the next semester. Spring semester approvals expire during the fall semester unless the student enrolls during summer session. Therefore, course requirements must be completed and a grade must be submitted by the end of six weeks into the student’s next semester for which he or she is registered. Any deferred grade that is not replaced by the deadline will automatically become an F.
Note that deferred grades are limited to those students who can verify and document a valid reason for not being able to complete the last few assignments, not for gaining extra time to complete missing work from earlier in the semester. Students are expected to have completed at least 75% of the course assignments to be eligible for a deferment. For more information see DF grade.


|
| Local Methods | ||
| Managed Object Types | Data Object Types | All Properties | All Methods |
It deprecates vim.VsanUpgradeSystem, to take care of vSAN upgrade process.
It has capability to support additional advanced disk format conversion specification, to help on configuration of latest vSAN advanced features.
It supports following vSAN on-disk format versions:Properties
| Name | Type | Description |
|---|---|---|
| None |
Methods
| Methods defined in this Managed Object |
|---|
| PerformVsanUpgradeEx, PerformVsanUpgradePreflightAsyncCheck_Task, PerformVsanUpgradePreflightCheckEx, RetrieveSupportedVsanFormatVersion, VsanQueryUpgradeStatusEx |
It deprecates API vim.VsanUpgradeSystem.PerformVsanUpgrade, besides supporting original basic upgrade options, it also supports advanced disk format conversion spec, to convert vSAN disk format to support corresponding vSAN advanced features, such as vSAN deduplication and compression, etc.
In order to perform this on-disk format upgrade, the upgrade process will perform a rolling evacuation/remove/re-add operation to accomplish the upgrade. In other words, one disk group at a time, it will evacuate the data from the disk group, then remove the old format from the now empty disk group, then reformat the disk group with the new format. Once all disk groups have been upgraded, and if the performObjectUpgrade parameter is set, the vSAN object version is also upgraded. Before the object version is upgraded, it is possible to downgrade the cluster by passing the downgradeFormat parameter. Once objects are of the new object version however, downgrade (and thus rollback) are no longer possible. The new object version is required to allow objects to benefit from new vSAN features.
The upgrade process performs additional "preflight checks" before proceeding to upgrade the next host. The upgrade process will be halted if any of those preflight checks fail.
If the upgrade process has been halted due to a problem, or even due to a crash or other failure, it can be re-started at any point in time. The upgrade will resume where it left off and only do the parts that are still outstanding. If the upgrade process stopped after removing vSAN from a disk group, but before re-adding those disks to vSAN, the upgrade process can recover from that. The preflight check results indicate such a condition.
Combined Privileges Required (on vSphere ManagedEntity):| Privileges | Required on |
|---|---|
| Host.Config.Storage | ClusterComputeResource |
Parameters
| Name | Type | Description |
|---|---|---|
| _this | ManagedObjectReference | A reference to the VsanUpgradeSystemEx used to make the method call. |
| cluster | ManagedObjectReference
to a ClusterComputeResource |
The cluster to be upgraded
|
| performObjectUpgrade* | xsd:boolean |
After all disk groups have been updated, also
upgrade all objects. Once started, rollback
of the on disk format is no longer possible.
Object upgrade unlocks new vSAN features. The
default behavior is upgrading objects is this
parameter is not specified.
Since vSphere API 6.0 |
| downgradeFormat* | xsd:boolean |
Perform a on-disk format downgrade instead of
upgrade. Only possible if no upgraded objects exist.
Since vSphere API 6.0 |
| allowReducedRedundancy* | xsd:boolean |
Removes the need for one disk group worth of
free space, by allowing reduced redundancy
during disk upgrade.
Since vSphere API 6.0 |
| excludeHosts* | ManagedObjectReference[]
to a HostSystem[] |
Internal debug option meant for functional testing
of vSAN upgrades. Skips upgrade on certain hosts and
implies performObjectUpgrade being false. Should not
be used by customers.
Since vSphere API 6.0 |
| spec* | VsanDiskFormatConversionSpec |
The specification of advanced disk format configuration. The
spec cannot be supported in downgrade process, for now we don't
have any advanced features supported by lower disk format.
Since vSphere API 6.0 |
Return Value
| Type | Description |
|---|---|
| ManagedObjectReference
to a Task | vim.Task |
Faults
| Type | Description |
|---|---|
| RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
| VsanFault |
Events
| Type | |
|---|---|
| None |
| Privileges | Required on |
|---|---|
| Host.Config.Storage | ClusterComputeResource |
Parameters
| Name | Type | Description |
|---|---|---|
| _this | ManagedObjectReference | A reference to the VsanUpgradeSystemEx used to make the method call. |
| cluster | ManagedObjectReference
to a ClusterComputeResource |
The target cluster to process conversion.
|
| downgradeFormat* | xsd:boolean |
Intend to perform a on-disk format downgrade
instead of upgrade. Adds additional checks.
Since vSphere API 6.5 |
| spec* | VsanDiskFormatConversionSpec |
The specification of advanced disk format configuration.
Adds additional checks. The specification cannot be
supported in downgrade process, for now we don't
have any advanced features supported by lower disk format.
Since vSphere API 6.5 |
Return Value
| Type | Description |
|---|---|
| ManagedObjectReference
to a Task | A task to monitor progress. Results should be obtains by VsanQueryUpgradeStatusEx |
Faults
| Type | Description |
|---|---|
| RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
| VsanFault |
Events
| Type | |
|---|---|
| None |
It deprecates API vim.VsanUpgradeSystem.PerformVsanUpgradePreflightCheck, and helps to check following issues which would break vSAN upgrade process:
| Privileges | Required on |
|---|---|
| Host.Config.Storage | ClusterComputeResource |
Parameters
| Name | Type | Description |
|---|---|---|
| _this | ManagedObjectReference | A reference to the VsanUpgradeSystemEx used to make the method call. |
| cluster | ManagedObjectReference
to a ClusterComputeResource |
The target cluster to be converted.
|
| downgradeFormat* | xsd:boolean |
Intend to perform a on-disk format downgrade
instead of upgrade. Adds additional checks.
Since vSphere API 6.0 |
| spec* | VsanDiskFormatConversionSpec |
The specification of advanced disk format configuration.
Adds additional checks. The specification cannot be
supported in downgrade process, for now we don't
have any advanced features supported by lower disk format.
Since vSphere API 6.0 |
Return Value
| Type | Description |
|---|---|
| VsanDiskFormatConversionCheckResult | Preflight check result. |
Faults
| Type | Description |
|---|---|
| RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
| Type | |
|---|---|
| None |
| Privileges | Required on |
|---|---|
| System.Read | ClusterComputeResource |
Parameters
| Name | Type | Description |
|---|---|---|
| _this | ManagedObjectReference | A reference to the VsanUpgradeSystemEx used to make the method call. |
| cluster | ManagedObjectReference
to a ClusterComputeResource |
The target cluster to process scan.
|
Return Value
| Type | Description |
|---|---|
| xsd:int | int To present the highest supported disk format version. |
Faults
| Type | Description |
|---|---|
| RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
| Type | |
|---|---|
| None |
| Privileges | Required on |
|---|---|
| System.Read | ClusterComputeResource |
Parameters
| Name | Type | Description |
|---|---|---|
| _this | ManagedObjectReference | A reference to the VsanUpgradeSystemEx used to make the method call. |
| cluster | ManagedObjectReference
to a ClusterComputeResource |
The cluster for which to retrieve the upgrade status.
|
Return Value
| Type | Description |
|---|---|
| VsanUpgradeStatusEx | Status |
Faults
| Type | Description |
|---|---|
| RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
Events
| Type | |
|---|---|
| None |
| Top of page | Local Methods | ||
| Managed Object Types | Data Object Types | All Properties | All Methods |


Eddie Mair's Election Call with Lloyd Russell-Moyle
by LBCEddie Mair's Election Call is live at 6pm. You can watch it here.
Eddie Mair's Election Call with Lloyd Russell-Moyle, Labour candidate for Brighton Kemptown.
Eddie Mair's Election Call is live at 6pm. You can watch it here.
Eddie Mair's Election Call with Lloyd Russell-Moyle, Labour candidate for Brighton Kemptown.


Application complete
You can get some help with help costs
Your reference number is
123 456 789
Your certificate expires on 01 June 2018
- A copy of your certificate has been emailed to<EMAIL_ADDRESS>- Print my certificate
- Download my certificate
- You can download or print a copy of your certificate at any time by signing into this service.
-
I can't access my certificate
If you don't have access to a printer or this is not your own computer we can send a copy in the post
Your entitlement
- Your certificate does not entitle you to free NHS prescriptions.
- We have worked out that you will need to pay the following towards your health costs:
- Sight tests
- you pay a maximum of:
- £5
- Glasses or contact lenses
- you pay:
- £10
-
towards an optical voucher
What is an optical voucher?
Help towards the cost of glasses or contact lenses is provided through optical vouchers.
The value of your voucher depends on your prescription.Ask the person who tests your sight what the value of the voucher is for your prescription.
Your voucher will be reduced by £10.For example:
Cost of glasses = £100
Value of voucher = £59.30
You would pay £50.70.
- Travel to receive NHS treatment
- you pay:
- £5
- in any one week
- NHS dental treatment, wigs, or fabric supports
- you pay a maximum of:
- £15
- per course of treatment or prescribed item
You will need to show a copy of your certificate if you want to claim any of the above.
Your certificate covers:
- Miriam Smith


Apr 10, 2022 · 10 min read
Before talking about recurrent neural networks, let’s talk about hidden Markov models (HMM) first.
Apr 1, 2022 · 15 min read
Reinforcement Learning is the third category of big topics in machine learning after supervised learning and unsupervised learning.
Mar 28, 2022 · 9 min read
Graphs allow us to encode structural assumptions about data. Graphs are the natural language for describing all kinds of problems and data.
Mar 11, 2022 · 6 min read
In the previous post, we talked about approximation inference. We want to compute $p(\theta,z|x)$, but it’s too complicated.
Mar 7, 2022 · 5 min read
In the previous post, we talked about Gibbs sampling and posterior inference.
Mar 2, 2022 · 4 min read
Review: In the previous post, we talked about the Dirichlet process and Dirichlet process mixture, as the Dirichlet process is for CDF estimation and the Dirichlet process mixture is for density estimation (i.
Feb 25, 2022 · 6 min read
Review: In the previous post, we talked about Bayesian Inference and Gaussian processes.
Feb 19, 2022 · 5 min read
Bayesian Inference The parameter $\theta$ in Bayesian Inference is viewed as a random variable.
Feb 19, 2022 · 5 min read
Let’s start with a simple regression method. Let’s assume that we have a dataset of $n$ points ${(x_i,y_i)}_{i=1}^n$ where $y_i \in \mathbb{R}$ and $x_i \in \mathbb{R}^d$:
Feb 10, 2022 · 5 min read
In the previous post, we talked about Mercer’s theorem and defined a mercer kernel as $\int f(x) f(y) k(x,y) dx dy \geq 0$ for any function $f$.


This inspection reports logger fields on classes which are not declared static.
and final.
Ensuring that every classes logger is effectively constant and bound to that class
simplifies the task of providing a unified logging implementation for an application. Interfaces,
enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.
Use the table below to specify Logger class names.
Fields which have the type of one of the classes specified and which are not static.
and final, will be reported by this inspection.
Powered by InspectionGadgets


An overview
Military animals are trained animals that are used in warfare and other combat related activities. As working animals, different military animals serve different functions. Horses, elephants, camels, and other animals have been used for both transportation and mounted attack. Pigeons were used for communication and photographic espionage. Many other animals have been reportedly used in various specialized military functions, including rats and pigs. Dogs have long been employed in a wide variety of military purposes, more recently focusing on guarding and bomb detection, and along with dolphins and sea lions are in active use today.
Military Animals were Used:


Please check your email and confirm this account.
If you haven't receive email from us click here to send it again.


Introduction to PHP Language
The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build your base with PHP.
Why to Learn PHP?
PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.
PHP is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will list down some of the key advantages of learning PHP:
-
PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
-
PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.
-
It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
-
PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on the Unix side. The MySQL server, once started, executes even very complex queries with huge result sets in record-setting time.
-
PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4 added support for Java and distributed object architectures (COM and CORBA), making n-tier development a possibility for the first time.
-
PHP is forgiving: PHP language tries to be as forgiving as possible.
-
PHP Syntax is C-Like.
Characteristics of PHP
- Simplicity
- Efficiency
- Security
- Flexibility
- Familiarity
Applications of PHP
As mentioned before, PHP is one of the most widely used language over the web. I'm going to list few of them here:
-
PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.
-
PHP can handle forms, i.e. gather data from files, save data to a file, through email you can send data, return data to the user.
-
You add, delete, modify elements within your database through PHP.
-
Access cookies variables and set cookies.
-
Using PHP, you can restrict users to access some pages of your website.
-
It can encrypt data.
For more information click here


At vero eos et accusato odio dignissimos ducimus qui blanditiis praesentium voluptatum.
At vero eos et accusato odio dignissimos ducimus qui blanditiis praesentium voluptatum.
At vero eos et accusato odio dignissimos ducimus qui blanditiis praesentium voluptatum.
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form.
Phasellus vitae ipsum ex. Etiam eu vestibulum ante.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi libero libero, imperdiet fringilla
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.
If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet.
If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet.
Unify creative technology company providing key digital services and focused on helping our clients to build a successful business on web and mobile.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent nibh leo, cursus ut eros sit amet, fringilla vulputate diam. Fusce justo velit, venenatis at lectus in, laoreet suscipit arcu.
John Clarck Google Inc.


Democratic presidential candidate Messam drops out of 2020 race
by Jason LangeWASHINGTON (Reuters) - U.S. Democratic Party presidential candidate Wayne Messam on Wednesday signaled that he was ending his 2020 bid for the White House.
“I am suspending my 2020 presidential campaign,” Messam said in a Twitter post.
Messam, 45, defeated a 16-year incumbent in 2015 to become the first black mayor of the Miami suburb of Miramar. He was re-elected in March.
The son of Jamaican immigrants, Messam played on Florida State University’s 1993 national championship football team and then started a construction business with his wife.
As a candidate, he had pledged to focus on reducing gun violence, mitigating climate change and reducing student loan debt and the cost of healthcare. Messam has done little campaigning, however, and raised just $5 during the third quarter.


TypeScript
(can be JavaScript
)yeoman
)Command
base class for application's commandsimport { Command } from '@oclif/command'
export class MyCommand extends Command {
static description = 'description of this example command'
async run() {
console.log('running my command')
}
}
oclif
and used for documentation generationyargs
, nops
, or minimist
as alternative librariesnpm i --verbose
git log --abbrev-commit --pretty=oneline -n 50
npm install yargs
LOG_LEVEL=debug note
import { Command, flags } from '@oclif/command'
export default class MyCommand extends Command {
static flags = {
logLevel: flags.string({
description: `Environment variable 'LOG_LEVEL'.\nIt CAN NOT be passed as a flag`,
env: 'LOG_LEVEL',
})
}
async run() {
const { flags: { logLevel } } = this.parse(MyCommand)
console.log(`running my command with logLevel ${logLevel}`)
}
}
Create a new CLI project with oclif
generator
npx oclif multi my-oclif-cli
cd my-oclif-cli
npm install -g .
my-oclif-cli hello
Note - Project Management as CLI
Educational Open Source Project to practice with JavaScript, TypeScript, Node, oclif, Git, Web Components, and Project Management
slack
npm install @slack/webhook
npx oclif command slack
my-oclif-cli slack "Hello from @username"
# the message "Hello from @username" appears in the slack channel
1.
How to obtain the WebHook URL for our Slack Node-Edu Channel:
2.
Put the Webhook URL to config/.slackrc
file as SLACK_WEBHOOK_URL
environment variable
export SLACK_WEBHOOK_URL=___WEBHOOK_GOES_HERE___
# or
export SLACK_WEBHOOK_URL=$(echo "aHR0cHM6Ly9ob29rcy5zbGFjay5jb20vc2VydmljZXMvVEwwMzg2V1BOL0JRMzRWREhQVy9DTjg3d2NVYlE4YTkyMmhaZjBaeEgwMVM=" | base64 --decode)
# or
export SLACK_WEBHOOK_URL=$(workshop slack)
3.
Import .slackrc
to your shell with source
source config/.slackrc
npm i @slack/webhook
1.
Require an IncomingWebhook class from the @slack/webhook
import { IncomingWebhook } from '@slack/webhook'
2.
Set a description for your command
static description = 'Send a message to a channel in Slack'
3.
The text should be provided as an argument. So, lets define an argument
static args = [
{
name: 'text',
required: true
}
]
4.
Add a definition of the flag to flags
section. You may still keep "help" flag since it's quite useful usually
static flags = {
help: flags.help({
char: 'h'
}),
slackWebhookUrl: flags.string({
env: 'SLACK_WEBHOOK_URL',
required: true
})
}
5.
In the very beginning of the run
function lets get our flags
and args
from the input with the following line
const { flags, args } = this.parse(Slack)
6.
Next lets create a new instance of IncomingWebhook with a slackWebhookUrl
flag
const webhook = new IncomingWebhook(flags.slackWebhookUrl)
7.
Call the "send" method with an object containing "text" property with your text. Please bear in mind that this is an async function
await webhook.send({ text: args.text })
my-oclif-cli slack "Hello World!"


As with any other C# based framework CS-Script's functionality can be extended by using 'external' components. Such components are existing C# scripts (any C# code), managed libraries (assemblies), non-managed libraries (plain DLLs) and COM components (COM DLLs).
Script Engine Directives
Background information about special script engine instructions (directives), which
can be specified directly in script code. This functionality makes
possible for the CS-Script to support multi-file scripts,
seamless access to COM, WebService, Remoting and initial support for
.NET3.0.
Importing C# scripts
Read about how to prepare and execute a script that uses another script(s).
Using .NET assemblies
Information about how to use in your script the assemblies that are not registered in the
GAC.
Using COM
Read about how use COM objects in your script code.
Alternative compilers
Read about possibilities of using non-C# syntax in scripts (e.g. JScript, VB.NET).
Using Classless Scripts
Read about how write and execute the scripts, which do not require class and function declarations.


This is the type that is returned by maxBettiNumbers it is a HashTable with the following keys.
The object MaxBetti is a type, with ancestor classes HashTable < Thing.


public class GameEngine
extends java.lang.Object
implements java.lang.Runnable
IGameLogic
.
The core engine managed the main game loop, timing, window management, and game runtime.| Constructor and Description |
|---|
GameEngine(java.lang.String windowTitle,
int width,
int height,
boolean vSync,
IGameLogic gameLogic)
Deprecated.
|
GameEngine(WindowSettings windowSettings,
IGameLogic gameLogic)
Instantiate the game engine.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanUp()
Performs necessary garbage collection of resources.
|
protected void |
init()
Initializes the display/window, the game timer, mouse input, and game logic.
|
protected void |
render()
|
void |
run()
Runs the game engine.
|
void |
start()
Starts the main game loop thread.
|
protected void |
update(float interval)
Calls the
gameLogic update. |
public GameEngine(WindowSettings windowSettings, IGameLogic gameLogic) throws java.lang.Exception
windowSettings
- Configuration settings for the window.gameLogic
- The implemented game logic to run.java.lang.Exception
- If the engine initialization fails.@Deprecated public GameEngine(java.lang.String windowTitle, int width, int height, boolean vSync, IGameLogic gameLogic) throws java.lang.Exception
windowTitle
- The text to display for the window title bar.width
- The width of the window.height
- The height of the window.vSync
- Whether or not V-sync should be used for the display.gameLogic
- The implemented game logic to run.java.lang.Exception
- If the game engine initialization fails.public void start()
public void run()
start()
.
Automatically performs game engine cleanup on the termination of the engine.run
in interface java.lang.Runnable
protected void init() throws java.lang.Exception
java.lang.Exception
- If any of the initialization steps fails.protected void update(float interval)
gameLogic
update.interval
- The interval at which to update.protected void render()
protected void cleanUp()


Friend Finder
Answer a few basic questions
Then find the friend with the greatest compatibility!
Go to Survey!!


Europium
Element Name:
Europium
Latin Name:
Europium
Atomic Number:
63
Atomic Weight:
151.964 u
Is a:
Lanthanoid
State of the element:
Solid
About:
Europium is a chemical element with the symbol Eu and atomic number 63. Europium is the most reactive lanthanide by far, having to be stored under an inert fluid to protect it from atmospheric oxygen or moisture. Europium is also the softest lanthanide, as it can be dented with a finger nail and easily cut with a knife. When oxidation is removed a shiny-white metal is visible. Europium was isolated in 1901 and is named after the continent of Europe. Being a typical member of the lanthanide series, europium usually assumes the oxidation state +3, but the oxidation state +2 is also common.
Electrons
63
Protons
63
Neutrons
89
Discoverer:
Eugne-Anatole Demarcay
Discovered in:
1901


The Modular Bouldering wall brings the experience of bouldering to you. Our design is ideal for in-home use and can be placed free standing or on any flat surface.
Being able to modify the route using our system allows users to experience an infinite range of climbing problems. This will not only mean hours of fun, but it will improve your technique and ability to climb.
Bouldering is a social sport and we have tried to capture that with our product. The wall is a modular design whereby multiple walls can be used together to increase the playing space. This means you’ll easily be able to climb with friends- it’s an adventure to share.
We know that bouldering as an activity is quite expensive. Equipment, travel and entry fees are not ideal, so we have scrapped all of it. A one time payment is all you need to become a part of the bouldering community.
Create a unique domain name to use for your website. This will be used to access your site online so it must be different. Sites such as godaddy can be used to check if the domain name you want to choose is available.
The extension at the end of the domain (e.g “.com”, “.co.uk”, etc) is known as the top-level domain. Select one and register it using third party sites which allow you to purchase domains (different top-level domains have different prices and different access rights).
The domain you selected can be purchased in one-year increments up to 10 years. They can later be renewed for a fee if required.
Now that you have purchased your domain, your website should be live. However, the images, text and all related files need to be stored on a server so they can be accessed from anywhere. Choose a web-host (most domain registrars include some sort of web hosting in their services).
Lead Mechanical Manufacture
Lead Woodworks
Head of Design
Lead Electronics
Sooria Rajakanthan- Lead Mechanical Manufacture. Metal works and manufacturing techniques applied to a high precision for maximum quality results. Milling, lathing, and drilling in to steel and aluminium parts have mostly been his responsibility.
Manoj Murali- Lead Wood-work. Operated the wood-work primarily on the cnc machine as the spartan. This includes design and manufacture of all the plywood parts of the wall.
Ferhaan Malek- Head of Design. As the head of the group, determined the features and CAD of the product as well as advising manufacture and ensuring that the project was undertaken to schedule.
Arohan Subramonia- Lead Electronics, Programming and Software. Responsible for programming raspberry pi and Arduino to operate the bouldering wall. Assembled the electronic components and sourced power for the electronics.


Bernie Sanders: ‘My ideas are not far left’
by Jessica Chasmar2020 presidential candidate and self-admitted Democratic socialist Bernard Sanders said Saturday he rejects the notion that his proposals are “far left.”
“My ideas are not far left, they are the ideas that the American people want,” the Vermont senator told a crowd at the Iowa NAACP’s Economic Freedom town hall, according to a video taken at the event.
Mr. Sanders, who is polling at about 17% nationally, has proposed far-reaching policies that most moderates would consider extreme, including guaranteed housing, tuition-free college and free health care for illegal immigrants.
It’s not the first time the senator has denied being a fat-left candidate. In September, he told Cosmopolitan, “You know, the media will sometimes describe me as ‘far left,’ but honestly, I don’t accept that moniker. Because if you look at the issues that I talk about, they are supported by the American people. I have led the effort in this country with some success to raise the minimum wage to $15 an hour. Is that a radical idea? I don’t think so. Overwhelming support for that among the American people.”
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC. Click here for reprint permission.
Please read our comment policy before commenting.


47
1 Yahweh gave to the prophet Jeremiah a message about the people of Philistia. The message was given to him before the city of Gaza in Philistia was captured by the army of Egypt.
2 This is what Yahweh said:
"An army will be coming from the northeast
that will cover the land like a flood.

People will scream out for help;
and everyone in the land will wail in mourning.
3 They will hear the sound of the hooves of the enemy horses,
and they will hear the rumble of the wheels of their enemies' chariots.
Men will run away;
they will not stop to help their own children but
will be completely weak and helpless .
4 It will be the time for all the people of Philistia to be destroyed,
and the time to stop the remaining soldiers from being able to help the people living in the cities of Tyre and Sidon.
I, Yahweh, will destroy the people of Philistia,
those whose ancestors long ago came from Island of Crete.
5 The people of Gaza will be humiliated;
they will shave off all the hair on their heads to indicate that they are ashamed.
The people of the city of Ashkelon will all be silent because they will be mourning.
All you people who live along the coast of the Mediterranean Sea who are still alive,
how long will you gash yourselves because you are mourning?"
6 The people of Philistia say, "Yahweh, when will you tell our enemies to stop killing us with their swords?
Tell them to put them back into their sheaths and allow them to stay there!"
7 But it would not be right for their swords to stay there,
because Yahweh has commanded their enemies to do something more;
Yahweh intends to tell them to attack all the people living in Ashkelon and in other cities along the coast.


Dependency Graph for atmat/atdemos/trackWithImpedance
GitHub Website
at
© 2018
Generated by
m2html
© 2005


1. Introduction
WildFly 8 (nee JBoss Application Server 7) is a lightweight, flexible, Java EE 7 compliant, polyglot, and open source application server.
This self-paced hands-on lab introduces the basic administrative features of WildFly 8. A comprehensive lab that covers Java EE 7 development using WildFly is available at: https://github.com/javaee-samples/javaee7-hol.
|
Note
|
This document is a work in progress. The latest version of this document is available at http://github.com/arun-gupta/wildfly-lab. Please send pull requests to contribute or file issues. |
1.1. Getting Started
Download the WildFly 8 ‘Application Server Distribution’ zip file from http://wildfly.org/downloads/ and unzip.
Lets get familiar with the directory structure.
| Directory | Purpose |
|---|---|
appclient |
Configuration files, deployment content, log files, and writeable areas used by the application client from this installation |
bin |
Startup scripts, startup configuration files and other command line utilities |
docs |
XML Schema definition files and sample configurations |
domain |
Configuration files, deployment content, log files, and writeable areas used by the managed domain from this installation |
domain/lib/ext |
Directory for installed library jars referenced by applications using the Extension-List mechanism for this domain |
domain/servers |
Writable area for each application server instance that runs in this domain. Each server has its own directory., created when the server is started. |
modules |
Various modules used in the server |
standalone |
Configuration files, deployment content, log files, and writeable areas used by the single standalone server from this installation |
standalone/deployments |
Directory for filesystem-based automatic deployment |
standalone/lib/ext |
Directory for installed library jars referenced by applications using the Extension-List mechanism for this instance |
welcome-content |
Default welcome page content |
1.1.1. Standalone and Managed Domain
WildFly 8 can be started in two different modes:
-
A standalone server is an independent instance. It can be started using
bin/standalone.sh
launch script on Unix-variety of machines andbin/standalone.bat
on Windows. -
A managed domain that allows you to run and manage a multi-server topology and manage multiple WildFly instances from a single control point. It can be started using
bin/domain.sh
launch script on Unix-variety of machines andbin/domain.bat
on Windows.A Domain Controller is the central management control point for the collection of servers in the ‘domain’. More details about starting WildFly in managed domain mode, server topology and central management is explained in [clustering].
1.1.2. Web Profile and Full Platform
Java EE defines profiles that represent a configuration of the full platform suited to a particular class of applications. The Java EE Web Profile is defined as a separate specification in the platform, and is defined as a subset of technologies contained in the platform and targeted toward the developers of modern web applications.
WildFly supports both Web Profile and Full Platform by defining “configuration profiles” in different files. These profiles are defined in standalone/configuration/*.xml
files for standalone instance and domain/configuration/domain.xml
for managed domain.
-
Start a WildFly instance in web profile
./bin/standalone.sh
This starts WildFly standalone instance server in web profile. By default it refers to
standalone\configuration\standalone.xml
configuration file which offers more capabilities than just web profile.Access http://localhost:8080 and see the following page to make sure the server is running correctly.
Figure 1. WildFly welcome screenUse Ctrl+C to stop the running server.
-
Start WildFly in full platform by specifying the configuration as:
./bin/standalone.sh -c standalone-full.xml
The name of the configuration file, without
.xml
suffix, from ‘standalone/configuration’ directory is specified as the parameter.Use Ctrl+C to stop the running server.
1.1.3. Multiple instances on the same machine
Multiple instances of standalone server can be started on the same machine by specifying a port offset option to the standalone.sh
or standalone.bat
script.
-
Start another instance of standalone server at port 9080 using the following command:
./bin/standalone.sh -Djboss.socket.binding.port-offset=1000
This will start another standalone instance server on port 9080 (=8080 + 1000) as the default application port and 10990 (=9990 + 1000) as the default management port. These port numbers would differ if non-default ports were used.
After the server is stated the welcome page is now accessible at http://localhost:9080.
Use Ctrl+C to stop the running server.
2. Deploying Applications to WildFly
Purpose: This section explains different ways to deploy Java EE 7 applications to WildFly.
Make sure to start a WildFly standalone instance for each sub-section unless stated otherwise. A standalone instance can be started as:
standalone.sh
2.1. File system
Deploying archives such as war, ear, and rar files using file system is as simple as copying to standalone/deployments
directory. The deployment can be configured for auto-deploy or manual mode.
Any archive can be placed in standalone/deployments
directory and is automatically deployed to the server. This is the default behavior.
|
Caution
|
This deployment mode is only intended to be used during development phase. Managed domain mode is recommended if running production systems. |
-
Clone the github repo by giving the following command:
git clone https://github.com/arun-gupta/wildfly-lab.git
-
Change directory to
samples/javaee7
and build the sample as:mvn install
-
Copy the war file to
standalone/deployments
directory using the following command:cp target/javaee7-1.0-SNAPSHOT.war /Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/deployments
Make sure to change the directory name to match your filesystem.
-
Verify the deployed application by accessing the webpage http://localhost:8080/javaee7-1.0-SNAPSHOT/EmployeeList and see the output as:
Figure 2. Java EE 7 sample application output
2.2. Administration Console
The Admin Console is a web-based administration console and available at http://localhost:9990/console.
-
A new user in the management realm needs to be added before the admin console can be accessed.
A new user can be added in the management realm using
add-user.sh
script. This can be done non-interactively by giving the following command:add-user.sh -u sheldon -p bazinga
The output of the command looks like:
Added user 'sheldon' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-users.properties' Added user 'sheldon' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-users.properties'
The directory names ‘standalone’ and ‘domain’ indicate that the user is added to both standalone instance and managed domain. The file name indicates that it is added to the management realm.
TipA user can be added to application realm by including -a
switch.Alternatively, the user can be added interactively by invoking the script and entering the values on the prompt as shown:
add-user.sh What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) (a): <take default> Enter the details of the new user to add. Using realm 'ManagementRealm' as discovered from the existing property files. Username : <sheldon> Password requirements are listed below. To modify these restrictions edit the add-user.properties configuration file. - The password must not be one of the following restricted values {root, admin, administrator} - The password must contain at least 8 characters, 1 alphanumeric character(s), 1 digit(s), 1 non-alphanumeric symbol(s) - The password must be different from the username Password : <bazinga> JBAS015269: Password must have at least 8 characters! Are you sure you want to use the password entered yes/no? <yes> Re-enter Password : <bazinga> What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: About to add user 'sheldon' for realm 'ManagementRealm' Is this correct yes/no? <yes> Added user 'sheldon' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-users.properties' Added user 'sheldon' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-users.properties' Added user 'sheldon' with groups to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-groups.properties' Added user 'sheldon' with groups to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-groups.properties' Is this new user going to be used for one AS process to connect to another AS process? e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls. yes/no? <no>
Now accessing the console at http://localhost:9990/console prompts for a username and password. Enter the username ‘sheldon’ and password ‘bazinga’ and then the console is shown as:
Figure 3. Admin consoleThe added user can be disabled by giving the following command:
add-user.sh -u sheldon -d
TipUser can be deleted by deleting the corresponding line from domain/configuration/mgmt-users.properties
andstandalone/configuration/mgmt-users.properties
files. -
Click on ‘Manage Deployments’ to see the output as:
Figure 4. Admin console deployments -
Click on ‘Add’ button to see:
Figure 5. Add a deployment -
Click on ‘Choose File’ button and select the war file.
Click on ‘Next >>’ button. Take the defaults and click ‘Save’.
-
By default the application is not enabled and the console shows:
Figure 6. En/Disable buttonClick on ‘En/Disable’ button, click on ‘Confirm’ and now the app is ready to be used. Access the application http://localhost:8080/javaee7-1.0-SNAPSHOT.war/EmployeeList.
2.3. Command Line Interface (jboss-cli)
jboss-cli.sh
or jboss-cli.bat
is Command Line Interface management tool for a standalone server or a managed domain. It allows a user to connect to a standalone server or domain controller and execute management operations.
More details about using jboss-cli for managing the server are available in Management using Command Line Interface (jboss-cli).
‘jboss-cli’ can be used to deploy applications using the interactive console or in a non-interactive manner.
2.3.1. Interactive
-
Use jboss-cli to connect with the existing standalone instance by giving the following command:
jboss-cli.sh -c
The
-c
switch connects using the default host (‘localhost’) and management port (‘9990’). These values are specified in ‘jboss-cli.xml’ and can be updated.This opens up the ‘jboss-cli’ interactive console and shows the following prompt:
[standalone@localhost:9990 /]
The prompt indicates that ‘jboss-cli’ is connected to a standalone instance’s management port.
-
Deploy the application by giving the following command in console:
deploy target/javaee7-1.0-SNAPSHOT.war
The directory name of the war file in the command may be different depending upon how ‘jboss-cli’ was invoked. Verify the server log to ensure that the application was redeployed. Look for specific timestamp in the log entries.
Tip--force
switch can be included in the command to replace the existing application. -
Verify the deployment status by typing the following command
deployment-info
in the console:deployment-info
and see the output as:
NAME RUNTIME-NAME PERSISTENT ENABLED STATUS javaee7-1.0-SNAPSHOT.war javaee7-1.0-SNAPSHOT.war true true OK
Verify the server log to ensure that the application was deployed. Look for specific timestamp in the log entries.
-
Undeploy the application by giving the following command:
undeploy javaee7-1.0-SNAPSHOT.war
-
Type
exit
‘quit’ to exit ‘jboss-cli’ interactive console.
2.3.2. Non-interactive
Non-interactive mode allows to support scripts and other types of command line or batch processing.
-
Deploy the application using the following command:
jboss-cli.sh --connect --command="deploy target/javaee7-1.0-SNAPSHOT.war --force"
The directory name of the war file in the command may be different depending upon how ‘jboss-cli’ was invoked. Verify the server log to ensure that the application was redeployed. Look for specific timestamp in the log entries.
Verify the deployed application at http://localhost:8080/javaee7/EmployeeList and look for a similar output.
-
Verify the deployment status by giving the following command:
jboss-cli.sh --connect --command=deployment-info
-
Undeploy the application by giving the following command:
jboss-cli.sh --connect --command="undeploy javaee7-1.0-SNAPSHOT.war"
2.4. Curl
curl is a free and popular command line tool for transfering data using URL syntax. If you don’t have it installed on your machine then it can be downloaded from http://curl.haxx.se/download.html.
Deploying applications using curl is a two-step process.
-
Upload your archive to WildFly using the following command
curl -F<EMAIL_ADDRESS>--digest http://sheldon:bazinga@localhost:9990/management/add-content
This command:
-
Makes a POST request using form-encoded (
-F
) data with one field (file
) defining location of the WAR file -
target/javaee7-1.0-SNAPSHOT.war
is location of the WAR file -
sheldon
is a user with administrative privileges and passwordbazinga
-
localhost:9090
is the default management host and port for WildFly instance -
WildFly management port uses digest authentication and that is defined using
–digest
-
Prints the output as something like:
{“outcome” : “success”, “result” : { “BYTES_VALUE” : “+Dg9u1ALXacrndNdLrT3DQSaqjw=” }}
-
-
Deploy the uploaded archive using the following command:
curl -S -H "Content-Type: application/json" -d '{"content":[{"hash": {"BYTES_VALUE" : "+Dg9u1ALXacrndNdLrT3DQSaqjw="}}], "address": [{"deployment":"javaee7-1.0-SNAPSHOT.war"}], "operation":"add", "enabled":"true"}' --digest http://sheldon:bazinga@localhost:9990/management
This command:
-
Sends a POST request (
-d
) with JSON payload -
Value assigned to
result
name in the JSON response of previous command is assigned tohash
name in this command -
Content type of the payload is explicitly specified to be
application/json
using-H
-
add
command triggers the deployment of the archive -
Application archive is enabled as well, as opposed to not by default
-
As in previous command,
sheldon
is the administrative user with passwordbazinga
-
As in previous command,
localhost:9090
is the default management host and port for WildFly instance -
As in previous command, WildFly management port uses digest authentication and that is defined using
–digest
-
2.5. Maven plugin
The wildfly-maven-plugin is used to deploy, redeploy, undeploy or run your application. You can also deploy or undeploy artifacts, such as JDBC drivers, and add or remove resources. There is also the ability to execute CLI commands.
-
Note that
samples/javaee7/pom.xml
contains the following fragment:<plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.0.0.Beta1</version> <executions> <execution> <phase>install</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin>
This specifies the ‘wildfly-maven-plugin’ description to ‘pom.xml’. It also invokes the plugin ‘deploy’ target during the standard maven ‘install’ phase.
-
Start a WildFly instance as:
standalone.sh
-
Deploy the application by giving the command:
mvn wildfly:deploy
or
mvn install
-
Access the web page at http://localhost:8080/javaee7/EmployeeList and see the output as:
Figure 7. Java EE 7 sample application output
2.6. Java
A standalone WildFly process or a managed domain can be configured to listen for remote management requests using its “native management interface”. This interface uses an open protocol based on the JBoss Remoting library. JBoss Remoting is used to establish a communication channel from the client to the process being managed. Once the communication channel is established the primary traffic over the channel is management requests initiated by the client and asynchronous responses from the target process.
Deployment using a custom Java class is a two-step process:
-
First step is to build a deployment plan that describe the steps of uploading the archive to the content repository and deploying it.
-
Second step involves executing the deployment plan on the application server instance.
Lets create an application that will allow us to deploy a Java EE 7 application using a Java-based class.
-
Create a maven project as:
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=org.wildfly.samples -DartifactId=deployment -DinteractiveMode=false
-
Open the created Maven project in NetBeans, Eclipse, IntelliJ or any other editor of your choice. The custom client must have maven artifact ‘org.jboss.as:jboss-as-controller-client’ and its dependencies on the classpath. ‘org.jboss:jboss-dmr’ is maven artifact for detyped representation of the management model and must be added to the list of maven dependencies as well.
This can be achieved by adding the following dependencies in
pom.xml
:<dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-controller-client</artifactId> <version>7.2.0.Final</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss</groupId> <artifactId>jboss-dmr</artifactId> <version>1.2.0.Final</version> <scope>test</scope> </dependency>
Note that both the dependencies are added in ‘test’ scope.
-
Edit the
src/test/java/org/wildfly/samples/AppTest.java
file and add a method as shown:ModelControllerClient createClient(final InetAddress host, final int port, final String username, final String password) { final CallbackHandler callbackHandler = new CallbackHandler() { @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (Callback current : callbacks) { if (current instanceof NameCallback) { NameCallback ncb = (NameCallback) current; ncb.setName(username); } else if (current instanceof PasswordCallback) { PasswordCallback pcb = (PasswordCallback) current; pcb.setPassword(password.toCharArray()); } else { throw new UnsupportedCallbackException(current); } } } }; return ModelControllerClient.Factory.create(host, port, callbackHandler); }
In this code:
-
ModelControllerClient
is used to manage a WildFly server instance or a Domain Controller or slave Host Controller. -
A new instance is created by specifying host, port, and a Callback handler to obtain authentication information for the call. Typically these credentials are obtained from a dialog box, such as a GUI-base client. In our case the credentials will be passed when this method is invoked.
-
-
Update
testApp
method such that it looks like:public void testApp() throws IOException, InterruptedException, ExecutionException { // create client ModelControllerClient client = createClient(InetAddress.getByName("localhost"), 9999, "sheldon", "bazinga"); // connect ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client); // build a deployment plan DeploymentPlan plan = manager .newDeploymentPlan() .add(new File("/Users/arungupta/workspaces/wildfly-lab/samples/javaee7/target/javaee7-1.0-SNAPSHOT.war")) .andDeploy() .build(); // run it ServerDeploymentPlanResult result = manager.execute(plan).get(); }
Make sure to resolve imports from
org.jboss.as.controller.client.helpers.standalone.*
package. Also change the directory name to match your filesystem.In this code:
-
A new instance of client for controlling application server management model is created by specifying the correct host, port, username, and password. Note that the username and password are the ones specified earlier.
-
ServerDeploymentManager
is the primary deployment interface for a standalone instance. A new instance is created by using the previously createdModelControllerClient
. -
newDeploymentPlan
initiates the creation of a newDeploymentPlan
. Archive is added to the repository usingadd
method and deployed usingandDeploy
method. Finally the deployment plan is built usingbuild
method. Note the location of archive may be different in your environment. -
Finally the deployment plan is executed using
execute
method.
-
-
Perform the deployment by running the test as:
mvn test
-
Check the server log to ensure that the application is deployed. The following server log entries should be visible:
14:08:57,052 INFO [org.wildfly.extension.undertow] (MSC service thread 1-9) JBAS017534: Register web context: /javaee7-1.0-SNAPSHOT 14:08:57,063 INFO [org.jboss.as.server] (management-handler-thread - 17) JBAS018559: Deployed "javaee7-1.0-SNAPSHOT.war" (runtime-name : "javaee7-1.0-SNAPSHOT.war")
You may see the error message as:
JBAS014616: Operation ("add") failed - address: ([("deployment" => "javaee7-1.0-SNAPSHOT.war")]) - failure description: "JBAS014803: Duplicate resource [(\"deployment\" => \"javaee7-1.0-SNAPSHOT.war\")]"
This occurs if the archive has been previously deployed.
|
Tip
|
addDeploy method may be replaced with andReplace("javaee7-1.0-SNAPSHOT.war") to replace a previously deployed archive.
|
2.7. Ruby (TBD)
Send a pull request ?
2.8. Perl (TBD)
Send a pull request ?
3. Management using Command Line Interface (jboss-cli)
Purpose: This section explains how to manage WildFly using jboss-cli.
WildFly comes with a Command Line Interface management tool for a standalone server or a managed domain. This script is in the bin
directory of WildFly distrbution and can be invoked by calling jboss-cli.sh
for Mac/Linux based systems or jboss-cli.bat
for Windows. It allows a user to connect to a standalone server or domain controller and execute management operations available through the management model.
3.1. Connecting to a server
-
Start a WildFly standalone server, if not already running, using the following command:
standalone.sh
-
Use ‘jboss-cli’ to connect with this instance by giving the following command:
jboss-cli.sh -c
The
-c
switch connects using the default host (‘localhost’) and management port (‘9990’). These values are specified in ‘bin/jboss-cli.xml’ and can be updated.This opens up the ‘jboss-cli’ interactive console and shows the following prompt:
[standalone@localhost:9990 /]
The prompt indicates that ‘jboss-cli’ is connected to a standalone instance’s default management port.
-
If WildFly instance is running on a different host and/or port, then
--controller
switch can be used to specify that information.-
In another shell, start another WildFly instance on a different port using the following command:
./bin/standalone.sh -Djboss.socket.binding.port-offset=10000
This will start another WildFly standalone instance on application port 18080 and management port 19090.
-
Use ‘jboss-cli’ to connect with this instance by giving the following command:
jboss-cli.sh -c --controller=localhost:19990
This opens up the ‘jboss-cli’ interactive console and shows the following prompt:
[standalone@localhost:19990 /]
The prompt indicates that ‘jboss-cli’ is connected to a standalone instance on port ‘19990’.
-
Type ‘exit’ or ‘quit’ in the console to exit.
-
3.2. Resources, Operations, and Commands
WildFly internal management model consists of management resources that that are added, removed, or modified by using operations and commands. Operations are low level but a comprehensive way to manage the server. Commands are more user-friendly, although most of them still translate into operation requests and some of them even into a few composite operation requests.
All resources are organized in a tree. The path to the node in the tree for a particular resource is its address and is identified by /
.
Each resource expose information about their state as attributes.
Each resource may support child resources.
All resources expose metadata that describes their attributes, operations, and child types. This metadata can be queried by invoking one or more of the global operations supported by the resource.
Command and operation request history is enabled by default. While in the command line session, you can use the arrow keys to go back and forth in the history of commands and operations.
3.2.1. Operations
-
The operations require one of the following prefixes:
-
:
to execute against the current nodeType
:
at the prompt and press tab key to see a complete list of operations. This will show the following output:[standalone@localhost:9990 /] : add-namespace read-operation-names take-snapshot add-schema-location read-resource undefine-attribute delete-snapshot read-resource-description upload-deployment-bytes full-replace-deployment reload upload-deployment-stream list-snapshots remove-namespace upload-deployment-url read-attribute remove-schema-location validate-address read-children-names replace-deployment validate-operation read-children-resources resolve-expression whoami read-children-types resolve-internet-address write-attribute read-config-as-xml server-set-restart-required read-operation-description shutdown
TipOperations can be auto completed by using the tab key. For example, type :r
at the prompt and press tab key to see the list of operations beginning with that letter.Read a simple attribute using
read-attribute
operation as shown:[standalone@localhost:9990 /] :read-attribute(name=release-version)
This will show the output as:
{ "outcome" => "success", "result" => "8.0.0.Final-SNAPSHOT" }
-
./
to execute against a child node of the current path[standalone@localhost:9990 deployment] ./javaee7-1.0-SNAPSHOT.war:read-resource
This command reads resource’s attribute, the deployed war file in this case, values along with either basic (default) or complete information about any child resources. Detailed information about the resource can be obtained by adding
recursive=true
parameters as:[standalone@localhost:9990 /deployment] ./javaee7-1.0-SNAPSHOT.war:read-resource(recursive=true)
-
/
to execute an operation against the root node[standalone@localhost:9990 /] /socket-binding-group=standard-sockets/socket-binding=http:read-attribute(name=bound-port)
This command traverses a path and reads an attribute on the leaf node. In this case it reads the port and displays the output as:
{ "outcome" => "success", "result" => 8080 }
-
-
Read the complete list of operations supported by a resource by typing
read-operation-names
at the prompt and see the output as:[standalone@localhost:9990 /] :read-operation-names { "outcome" => "success", "result" => [ "add-namespace", "add-schema-location", "delete-snapshot", "full-replace-deployment", "list-snapshots", "read-attribute", "read-children-names", "read-children-resources", "read-children-types", "read-config-as-xml", "read-operation-description", "read-operation-names", "read-resource", "read-resource-description", "reload", "remove-namespace", "remove-schema-location", "replace-deployment", "resolve-expression", "resolve-internet-address", "server-set-restart-required", "shutdown", "take-snapshot", "undefine-attribute", "upload-deployment-bytes", "upload-deployment-stream", "upload-deployment-url", "validate-address", "validate-operation", "whoami", "write-attribute" ] }
-
A number of operations can be applied to every resource. Such operations are called global operations.
read-operation-names
is one such global operation. Another commonly used global operation isread-resource
that reads resource’s attribute values along with either basic or complete information about any child resources. -
Read complete detail about
read-operation-description
operation by giving the command:[standalone@localhost:9990 /] :read-operation-description(name=read-operation-names)
and see the output as:
{ "outcome" => "success", "result" => { "operation-name" => "read-operation-names", "description" => "Gets the names of all the operations for the given resource", "request-properties" => {"access-control" => { "type" => BOOLEAN, "description" => "If 'true' only operations the user is allowed to see are returned, and filtered operations are listed in the 'access-control' response header.", "expressions-allowed" => false, "required" => false, "nillable" => true, "default" => false }}, "reply-properties" => { "type" => LIST, "value-type" => STRING, "description" => "The operation names" }, "read-only" => true } }
Try this operation for some other operations and read the output.
3.2.2. Commands
-
Type
help --commands
at the jboss-cli prompt to see a complete list of commands available in current context. This will show the following output:[standalone@localhost:9990 /] help --commands alias deploy if read-attribute undeploy batch deployment-info jdbc-driver-info read-operation unset cd deployment-overlay ls reload version clear echo module run-batch xa-data-source command echo-dmr patch set : connect help pwd shutdown data-source history quit try
This can also be achieved by pressing the tab key at the prompt. The list of commands depends upon the current context, i.e. it may change based upon the node address in the domain management model.
TipCommands can be auto completed by using the tab key. For example, type letter d
at the prompt and press tab key to see the list of commands beginning with that letter. Enter space after choosing the command and press tab key again to see the list of arguments to the command. -
Help for any command is available by typing the command name and using
--help
option. For example:[standalone@localhost:9990 /] deploy --help
will show the following output:
SYNOPSIS deploy ((file_path | --url=deployment_url) [--script=script_name] [--name=deployment_name] [--runtime-name=deployment_runtime_name] [--force | --disabled] [--unmanaged]) | --name=deployment_name [--server-groups=group_name (,group_name)* | --all-server-groups] [--headers={operation_header (;operation_header)*}] DESCRIPTION Deploys the application designated by the file_path or enables an already existing but disabled in the repository deployment designated by the name . . .
-
ls
command list the contents of a node path including node types and attributes. Giving this command on the root node shows the following output:[standalone@localhost:9990 /] ls core-service management-minor-version=0 deployment name=aruns-macbook-pro deployment-overlay namespaces=[] extension process-type=Server interface product-name=undefined path product-version=undefined socket-binding-group profile-name=undefined subsystem release-codename=WildFly system-property release-version=8.0.0.Final-SNAPSHOT launch-type=STANDALONE running-mode=NORMAL management-major-version=2 schema-locations=[] management-micro-version=0 server-state=running
All entries with name/value pairs are attributes and every thing else is a node.
-
cd
command changes the current node path to the specified argument.Change the path to ‘management’ node by typing the command:
[standalone@localhost:9990 /] cd core-service=management [standalone@localhost:9990 core-service=management]
The command line prompt in the first line shows that the command was issued from the root node. The prompt in the second line shows the updated node name.
-
Deploy an application and check its status by typing the following commands:
[standalone@localhost:9990 /] deploy ~/workspaces/wildfly-lab/samples/javaee7/target/javaee7-1.0-SNAPSHOT.war --force [standalone@localhost:9990 /] deployment-info NAME RUNTIME-NAME PERSISTENT ENABLED STATUS javaee7-1.0-SNAPSHOT.war javaee7-1.0-SNAPSHOT.war true true OK
-
Change the HTTP application port from a default value of 8080 to 8090 by giving the following command:
[standalone@localhost:9990 /] /socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=port,value=8090)
and see the output as:
{ "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } }
The command output indicates that the server should be reloaded. This can be achieved by typing
reload
command at the prompt. Now the application is accessible at http://8090/javaee7-1.0-SNAPSHOT/EmployeeList instead of the port 8080.Any change to the management model is persisted to the configuration file. Lets change the port back to 8080 by giving the following command:
[standalone@localhost:9990 /] /socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=port,value=8080)
3.3. Batch
The batch mode allows one to group commands and operations and execute them together as an atomic unit, i.e., if at least one of the commands or operations fails, all the other successfully executed commands and operations in the batch are rolled back.
Only the commands that translate into operation requests are allowed in the batch. The batch, actually, translates into a composite operation request.
Batch mode can be composed interactively using jboss-cli prompt or non-interactively where the set of commands and operations are saved in a file and loaded at the prompt.
3.3.1. Interactive Batch
-
Start batch mode by typing the
batch
command:[standalone@localhost:9990 /] batch [standalone@localhost:9990 / #]
The prompt changes to
#
indicating that the CLI is in batch mode. -
Enter the operations and commands that need to be included in batch:
[standalone@localhost:9990 / #] data-source add --name=myDataSource --jndi-name=java:jboss/datasources/MyDataSource --user-name=sa --password=sa --driver-name=h2 --connection-url=jdbc:h2:mem:myData [standalone@localhost:9990 / #] deploy ~/workspaces/wildfly-lab/samples/javaee7/javaee7-1.0-SNAPSHOT.war
This command is creating a JDBC resource and deploys an application that uses it.
-
Finally run the commands entered in the batch by giving the following command:
[standalone@localhost:9990 / #] run-batch
If the command is executed successfully then it is discarded and the CLI leaves the batch mode. If any of the command or operation in the batch fails then the CLI gives an error and all steps executed so far are rolled back.
3.3.2. Non-interactive Batch
Non-interactive batch is useful for set of commands and operations that are executed frequently. Such commands and operations can be saved to a file and later used as argument to ‘batch’ command.
-
Save the following commands in a text file:
/subsystem=datasources/data-source="java:jboss/datasources/MyDataSource":add(jndi-name="java:jboss/datasources/MyDataSource", driver-name="h2", connection-url="jdbc:h2:mem:myData", user-name="sa", password="sa") deploy ~/workspaces/wildfly-lab/samples/javaee7/target/javaee7-1.0-SNAPSHOT.war
and save the file as ‘myScript.txt’.
-
Run the interactive CLI as:
standalone.sh
-
Load the script file using
batch
command:[standalone@localhost:9990 /] batch --file=myScript.txt
+ Run the batch using the
run-job
command.Alternatively, the file may be loaded and executed in one command:
[standalone@localhost:9990 /] run-batch --file=myScript.txt
3.4. Environment variables
CLI supports variables and are resolved during command line parsing phase. They are useful to store frequently used nodepaths, complex commands or operations, or any other text that needs a shorter and easy to use name.
Variables set during a CLI session are not persisted when the session is terminated. The variables may be stored in .jbossclirc
in which case they are persisted across different sessions.
3.4.1. Non-persistent Variables
-
Set a new variable as:
[standalone@localhost:9990 /] set default_port=/socket-binding-group=standard-sockets/socket-binding=http:read-attribute(name=bound-port)
This code defines a new variable
default_port
and sets its value to the defined operation. Variable names are expected to follow Java identifier format. -
Use this variable in CLI to execute the command:
[standalone@localhost:9990 /] $default_port
to see the output as:
{ "outcome" => "success", "result" => 8090, "response-headers" => {"process-state" => "reload-required"} }
3.4.2. Persistent Variables
Persistent variables are stored in .jbossclirc
file. The location of this file is checked in the following order:
-
value of system property
jboss.cli.rc
-
user’s working directory (as defined by
user.dir
system property) -
bin
directory
A default .jbossclirc
is already included in the bin
directory and can be used as a template for user-specific environment setup.
The file contains ‘set’ commands to define the variables, such as:
set default_port=/socket-binding-group=standard-sockets/socket-binding=http:read-attribute(name=bound-port)
3.5. GUI
CLI can be started with a GUI instead of a command line. It allows you to browse through different nodes and commands and operations supported on a node. Commands are automatically created and can be submitted to the server. Applications can be deployed and undeployed as well.
-
Type the following command to start CLI with GUI:
standalone.sh --gui
The complete domain model is shown in a separate window as:
Figure 8. jboss-cli GUI -
Right-click on any node to see the list of supported operations as shown:
Figure 9. Operations on nodesThe command is dynamically created and populated in the ‘cmd>’ text box.
-
This command can be submitted to the server by clicking on ‘Submit’ button. Command output is shown:
Figure 10. jboss-cli GUI output -
Type ‘serv’ in ‘Filter’ box to search for any nodes and attributes that contains this phrase. The output is shown as:
Figure 11. Filter on GUI
4. Role Based Access Control
Role Based Access Control (RBAC) is the ability to restrict access to system or certain portions of it to authorized users. For JBoss AS 7.x, the web-based administrative console had an all-or-nothing approach. This means user authenticated with management security realm will have all the privileges. This may not be appropriate for mission-critical deployments and a finer-grained control may be required. WildFly 8 introduces RBAC using different roles.
Purpose: This section explains how to configure and use RBAC for WildFly.
There are seven pre-defined roles in two different categories. First four roles are where users are locked out of sensitive data and the next three level roles where users are allowed to deal with sensitive data.
The pre-defined roles are explained below:
| Role | Permissions |
|---|---|
Monitor |
|
Operator |
|
Maintainer |
|
Deployer |
|
Administrator |
|
Auditor |
|
Super User |
|
4.1. Default super user
By default, any user added to the management realm and not belonging to a group is in “Super User” role.
-
Start the server as standalone instance if not already running:
./bin/standalone.sh
-
Access Admin Console at http://localhost:9990/console. This prompts for authentication as shown:
Figure 12. Authentication for Admin ConsoleEnter the user name ‘sheldon’ and password ‘bazinga’ (as created earlier). Admin console should look like:
Figure 13. Super user default viewThis view shows:
-
A new ‘Administration’ tab that allows to map users to roles. This will be done in a later section.
-
Information about the logged in user is shown on top-right as:
Figure 14. Super user menuNotice the logged in user name is shown.
-
A user in ‘Super User’' role can act to run in any role by clicking on ‘Run as’. Click on ‘Run as’ and select drop-down list box to see the list of available roles as:
Figure 15. Run as roles -
Select the ‘Monitor’ role and click on ‘Run As’.
The application has to be reloaded for changes to take effect. Click on ‘Confirm’ to reload the application. After the reload, clicking on the user on top-right in admin console will display the selected role as ‘Run as Monitor’ as shown:
Figure 16. Run as monitor-
Click on ‘Manage Deployments’ and check that ‘Add’, ‘Remove’, and similar buttons are not present as shown:
Figure 17. Manage deployments as monitor -
Click on ‘Profile’, ‘Data Sources’ and check that all data sources are visible but not editable. This is identified by the fact that ‘Add’, ‘Remove’, and ‘Disable’ buttons are not available as shown.
Figure 18. Data sources as monitor -
Click on ‘Administration’ tab and make sure the user does not have access to it as shown:
Figure 19. Administration as monitor
-
-
Feel free to select other roles and observe how different options are enabled/disabled.
-
4.2. Configure ‘rbac’ access control provider
WildFly 8 comes with two access control providers:
-
‘simple’ provider, the default one, gives all privileges to any authenticated administrator. This provides compatibility with older releases.
-
‘rbac’ provider allows you to setup configuration that will map users to different roles.
-
Configure ‘rbac’ access control provider by giving the following command:
jboss-cli.sh -c --command="/core-service=management/access=authorization:write-attribute(name=provider,value=rbac)"
This command will change authorization provider to “rbac” and will produce the output as:
{ "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } }
-
The server needs to be restarted as the authorization provider is changed. Give the following command to restart the server:
./bin/jboss-cli.sh -c --command="reload"
TipIf the server is running in managed domain then it can be restarted by additionally specifying --host=master
in the command.Check the server log to confirm server restarted, look for specific time stamps.
-
Any existing roles need to be explicitly mapped after the access control provider is changed. Map the user ‘sheldon’ to the role ‘Super User’ by giving the following command:
jboss-cli.sh -c --command="/core-service=management/access=authorization/role-mapping=SuperUser/include=user-sheldon:add(name=sheldon,type=USER)"
-
On top-right in admin console, click on the username and click on ‘Logout’ and then ‘Confirm’.
-
Enter the login credentials again (username is ‘sheldon’ and password is ‘bazinga’) to login back into the admin console.
-
4.3. Map users, groups, and roles
WildFly introduces the concept of “groups” in security realms. Users can be directly associated with a role, or can belong to a group and then a group can be associated with a role.
-
Add two users in different groups using
bin/adduser.sh
script-
Add first user in a group by giving the following command:
add-user.sh -u penny -p penny1 -g just4fun Added user 'penny' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-users.properties' Added user 'penny' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-users.properties' Added user 'penny' with groups just4fun to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-groups.properties' Added user 'penny' with groups just4fun to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-groups.properties'
-
Add another user in a different group by giving the following command:
add-user.sh -u leonard -p leonard1 -g geek Added user 'leonard' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-users.properties' Added user 'leonard' to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-users.properties' Added user 'leonard' with groups geek to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/standalone/configuration/mgmt-groups.properties' Added user 'leonard' with groups geek to file '/Users/arungupta/workspaces/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT/domain/configuration/mgmt-groups.properties'
These commands creates the following users:
User Password Group penny
penny1
just4fun
leonard
leonard1
geek
Both users are added for standalone instance and managed domain.
-
-
Click on ‘Administration’ tab to see an output as:
Figure 20. Administration tab in admin consolePreviously assigned user/role mapping is already shown here.
-
Click on ‘Add’ to assign a new role to user mapping. Type ‘penny’ in ‘User’ textbox and select ‘Monitor’ role as shown:
Figure 21. Assigning role to PennyClick on ‘Save’.
NoteMultiple roles may be assigned to each user. -
Assign ‘Administrator’ role to user ‘leonard’. The updated admin console looks like as shown:
Figure 22. Roles assigned to usersTipGroups, and thus all users in that group, can be assigned one or more roles by clicking on ‘GROUPS’ tab.
4.4. Logging in as different users
-
Click on top-right and select ‘Logout’ to log out of admin console. Login again by using the username ‘penny’ and password ‘penny1’. Note that this user was assigned ‘Monitor’ role.
-
Top-right of admin console shows the logged in user name.
Figure 23. Information about PennyNote that ‘Run as’ is not available any more.
-
Click on ‘Manage Deployments’ to see the output as shown:
Figure 24. Deployments for user PennyThis role permits only monitoring and ‘Add’, ‘Remove’, ‘En/Disable’, and ‘Replace’ buttons are not available.
-
Click on ‘Administration’ tab to see a permissiond denied output as:
Figure 25. Administration for user Penny -
Click on top-right and select ‘Logout’ to log out of admin console. Login again by using the username ‘leonard’ and password ‘leonard1’. Note that this user was assigned ‘Administrator’ role.
-
Top-right of admin console shows the logged in user name.
Figure 26. Information about LeonardNote that ‘Run as’ is not available any more.
-
Click on ‘Deployments’ and confirm that new deployments can be added or existing can be replace, removed, enabled or disabled by the presence of buttons.
-
Click on ‘Administration’ tab and confirm that all information is visible and editable.
4.5. Filtering out commands in ‘jboss-cli’
CLI or ‘jboss-cli’ can authenticate against local WildFly without prompting the user for a username and password. This mechanism only works if the user running the CLI has read access to the “standalone/tmp/auth” directory or “domain/tmp/auth” folder under the respective WildFly installation. If the local mechanism fails then the CLI will fallback to prompting for a username and password.
Alternatively authentication can be forced by explicitly specifying user
and password
options.
-
Connect using ‘jboss-cli’ using the following command:
jboss-cli.sh --user=penny --password=penny1 -c
Note that the user ‘penny’ is in Monitor role.
-
Type
data-source
on the CLI console and TAB to see the following output:[standalone@localhost:9990 /] data-source --help flush-gracefully-connection-in-pool --name= flush-idle-connection-in-pool add flush-invalid-connection-in-pool disable read-resource enable remove flush-all-connection-in-pool test-connection-in-pool
Note that all commands and attributes, even those not permitted for Monitor role, are shown.
-
Try to add a new data source using the following command:
[standalone@localhost:9990 /] data-source add --name=testDataSource
This command gives the following error:
JBAS013456: Unauthorized to execute operation 'add' for resource '[ ("subsystem" => "datasources"), ("data-source" => "testDataSource") ]' -- "JBAS013475: Permission denied"
This is because ‘Monitor’ role does not have permission to add data sources.
-
Type
exit
orquit
to exit out of CLI console. -
Edit
bin/jboss-cli.xml
and change the following element:<access-control>false</access-control>
to
<access-control>true</access-control>
This element filter out the command and attribute suggestions displayed based on user’s permissions.
-
Connect using ‘jboss-cli’ using the following command:
./bin/jboss-cli.sh --user=penny --password=penny1 -c
-
Type
data-source
on the CLI console and TAB to see the following output:[standalone@localhost:9990 /] data-source --help --name= read-resource
Note that only permitted commands and attributes are shown.
TipTry some other commands and see which ones are accessible or not.
5. Audit Logging
WildFly comes with audit logging built in for management operations affecting the management model. The audit log records can be logged to a file on the server or to syslog. Syslog is a better choice for audit logging since you can log to a remote syslog server, and secure the authentication to happen over TLS with client certificate authentication. This section will only cover default logging in file.
5.1.
-
Connect using ‘jboss-cli’ using the following command:
jboss-cli.sh --user=sheldon --password=bazinga -c
Note you need to provide user and password credentials of a user in Auditor or Super User role.
-
Enable audit logging by giving the following command:
[standalone@localhost:9990 /] /core-service=management/access=audit/logger=audit-log:write-attribute(name=enabled,value=true)
This will display the output as:
{"outcome" => "success"}
If the user is not in Auditor or Super User role then the following error message will be displayed:
{ "outcome" => "failed", "failure-description" => "JBAS013456: Unauthorized to execute operation 'write-attribute' for resource '[ (\"core-service\" => \"management\"), (\"access\" => \"audit\"), (\"logger\" => \"audit-log\") ]' -- \"JBAS013475: Permission denied\"", "rolled-back" => true }
5.2. Logging JSON records to file
By default audit log records are formatted using JSON and are generated in standalone/data/audit-log.log
. This file is generated after audit log is enabled and looks like:
{
"type" : "core",
"r/o" : false,
"booting" : false,
"version" : "8.0.0.Final-SNAPSHOT",
"user" : "sheldon",
"domainUUID" : null,
"access" : "NATIVE",
"remote-address" : "<IP_ADDRESS>/<IP_ADDRESS>",
"success" : true,
"ops" : [{
"address" : [
{
"core-service" : "management"
},
{
"access" : "audit"
},
{
"logger" : "audit-log"
}
],
"operation" : "write-attribute",
"name" : "enabled",
"value" : true,
"operation-headers" : {
"caller-type" : "user",
"access-mechanism" : "NATIVE"
}
}]
}
The main fields in this JSON record are explained below:
| Field Name | Possible Values |
|---|---|
|
|
|
|
|
|
|
The username of the authenticated user. If the operation is logged via the CLI on the same machine as the running server, then the special $local user is used |
|
|
|
List of operations being executed serialized to JSON |
Try a few other management operations and notice how audit-log.log
is updated.  Acknowledgements
The following JBoss community members graciously reviewed and contributed to this hands-on lab:
-
Jorge Solórzano (twitter handle ?)
Thank you very much for providing the valuable feedback!
Please send pull requests at http://github.com/arun-gupta/wildfly-lab to contribute or file issues.


| ::com::sun::star::lang::XComponent |
- (referenced interface's summary:)
- allows to exclicitly free resources and break cyclic references.
|
| XCellRange |
- (referenced interface's summary:)
- provides access to the cells or to sub-ranges of a cell range.
|
| XColumnRowRange |
- (referenced interface's summary:)
- provides methods to access the collections of columns and rows
of a cell range.
|
| ::com::sun::star::util::XModifiable |
- Description
- interface to make the modify state of the table accessible.
Additionally, it makes it possible to register listener objects, which
get notification whenever the content of the table changes.
|
| ::com::sun::star::beans::XPropertySet |
- (referenced interface's summary:)
- provides information about and access to the
properties from an implementation.
|
| ::com::sun::star::beans::XFastPropertySet |
- (referenced interface's summary:)
- provides a fast way of accessing and changing property values.
|