{"id":302939,"date":"2020-05-03T15:00:20","date_gmt":"2020-05-03T15:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302939"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302939","title":{"rendered":"(Spring) State in the (Spring) Shell: \u043d\u0435 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u043e\u043c \u0435\u0434\u0438\u043d\u044b\u043c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500108\/\">\n<p><em>\u042d\u0439, \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u0441 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c, \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438 \u043f\u0440\u043e\u0447\u0438\u043c? \u0418 \u0431\u0435\u0437 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043d\u0430 JVM?<\/em><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pb\/xm\/lv\/pbxmlvw53tndaougujmxrcj-eea.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u0413\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b <a href=\"https:\/\/postman.com\" rel=\"nofollow\">Postman<\/a>. \u0425\u043e\u0442\u044f \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0445 \u043c\u044b \u0432\u0441\u0435 TDD \u0438 \u043f\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u043c\u0443 \u043e\u0433\u043e\u043d\u044c\u043a\u0443 Cucumber \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u0441\u043b\u0430\u0442\u044c REST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Postman. \u041f\u0440\u0438 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435), \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043a\u0430\u043a\u0430\u0442\u044c \u043f\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0430\u043c, \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a. \u0412 \u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0423\u0436 \u044f \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441 cURL \u043f\u0438\u0441\u0430\u043b, \u0438 \u0432 IDEA \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u043b \u2014 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0442\u0438\u0432\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0438, \u043c\u0435\u0439\u043d\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0437\u0430 \u043d\u0438\u043c, \u043f\u043e\u0433\u043e\u0434\u044b \u0432 \u0434\u043e\u043c\u0435 \u0438 \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438. \u041a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a \u0441\u0442\u0430\u043b \u0441\u044a\u0435\u0434\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043d\u0430\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043b \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u0430\u0436 \u043c\u044b\u0448\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0418 \u0442\u0443\u0442 \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/projects.spring.io\/spring-shell\/\" rel=\"nofollow\">Spring Shell<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 shell \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 Spring. \u0414\u0430\u0432\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u0437\u044f\u043b\u0441\u044f \u0437\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0421\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u044f \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u2014 \u044d\u0442\u043e \u043f\u0440\u0435\u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 shell, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0432\u0435\u044f\u043d \u043c\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043b\u044e\u0448\u0435\u043a \u0441 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u2014 <em>Spring State Machine<\/em>. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b \u2014 \u044d\u0442\u043e \u0434\u043b\u044f \u0441\u0435\u0434\u044b\u0445 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u043d\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0432\u0430 \u2014 \u043d\u0430 \u043d\u0438\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432 Kotlin, \u0430 \u0432\u0441\u044f\u043a\u0438\u0435 <em>Akka<\/em> \u0438\u0445 \u043d\u0435\u0441\u0443\u0442 \u0432 &quot;\u043c\u0430\u0441\u0441\u044b&quot; \u0435\u0449\u0435 \u0434\u043e\u043b\u044c\u0448\u0435. \u042f \u043a\u043e\u0441\u043d\u0443\u0441\u044c <em>State Machine<\/em> \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0433\u0440\u0435\u0442\u044c \u0430\u043f\u043f\u0435\u0442\u0438\u0442.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"nastroyka-sredy\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0440\u0435\u0434\u044b<\/h3>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u044f \u043f\u043e\u0448\u0435\u043b \u043d\u0430 <a href=\"https:\/\/start.spring.io\/\" rel=\"nofollow\">Spring Initializr<\/a> \u0438 \u0441\u043e\u0437\u0434\u0430\u043b \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Gradle \u0441 Kotlin. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">curl 'https:\/\/start.spring.io\/starter.zip?type=gradle-project&amp;language=kotlin&amp;bootVersion=2.2.6.RELEASE&amp;baseDir=shell-state&amp;groupId=me.votez.spring&amp;artifactId=shell-state&amp;name=shell-state&amp;description=Demo%20project%20for%20Spring%20State%20Machine%20and%20Shell&amp;packageName=me.votez.spring.shellstate&amp;packaging=jar&amp;javaVersion=1.8' --compressed --output shellstate.zip &amp;&amp; unzip shellstate.zip<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0440\u0435\u043c\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 <em>Spring Shell<\/em> \u0432 gradle<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">    implementation(&quot;org.springframework.shell:spring-shell-starter:2.0.0.RELEASE&quot;)<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"opisanie-komand-dlya-obolochki\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>\u0412\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 (shell). \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u043c \u043a\u0430\u043a <em>ShellComponent<\/em> (\u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e) \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0435\u0442\u043e\u0434, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 <em>ShellMethod<\/em> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u0435\u043b\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f <em>ShellOption<\/em>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0438\u043b\u0438 \u043f\u043e \u0438\u043c\u0435\u043d\u0438, \u0434\u043b\u044f \u043d\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f Bean Validation. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043c\u0435\u043d\u044f \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Enum \u0438 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0434\u0430\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432 <em>help<\/em>).<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0434\u0432\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u044f\u043a\u043e\u0431\u044b \u043e\u043f\u0440\u043e\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u043e\u043f\u0440\u043e\u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 actuator \u0438 \u0442.\u0434\u2026<br \/>  (\u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0435 <em>runBlocking<\/em> \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u0434\u043b\u044f \u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0446\u0430 \u0442\u0430\u043c)<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">package me.votez.spring.shellstate  import org.springframework.shell.standard.ShellComponent import org.springframework.shell.standard.ShellMethod import org.springframework.shell.standard.ShellOption import kotlinx.coroutines.* import org.springframework.shell.standard.ShellMethodAvailability import java.util.* import kotlin.random.Random  @ShellComponent class ServerCommands {     private var token: String? = null      @ShellMethod(&quot;Authenticate and obtain token&quot;)     fun login(            @ShellOption name:String,             @ShellOption password:String,             @ShellOption(defaultValue = &quot;admin&quot;) scope: String) = runBlocking {             token = UUID.randomUUID().toString()             delay(2_000)             &quot;Connected&quot;         }     }      @ShellMethod(&quot;List projects regstered on server&quot;)     fun list(         @ShellOption(defaultValue = &quot;PROJECT&quot;, help = &quot;Possible values are PROJECT and USER&quot;) type:EntityType) = when(type) {         EntityType.PROJECT -&gt; listOf(&quot;Roga i Kopita&quot;, &quot;Svetliy Put&quot;, &quot;NIICHAVO&quot;)         EntityType.USER -&gt; listOf( &quot;Ivanov&quot;, &quot;Petrov&quot;, &quot;Sidorov&quot;)     } }  enum class EntityType {     PROJECT,     USER }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u0432 IntelliJ IDEA, \u0442\u0430\u043a \u043a\u0430\u043a Spring Shell \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/jline\/jline3\" rel=\"nofollow\">JLine<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 Linux, MacOS \u0438 Windows, \u0430 \u0432\u043e\u0442 \u0441 IDE \u2014 \u043d\u0435\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ bash .\/gradlew build $ java -jar build\/libs\/shell-state-0.0.1-SNAPSHOT.jar <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <strong>help<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0438 \u0432\u0430\u0448\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434. \u0422\u0430\u043a\u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b <strong>clear, exit, quit, script, stacktrace<\/strong>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u043d\u0441\u043e\u043b\u044c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">2020-05-03 12:49:35.442  INFO 23211 --- [           main] m.v.s.s.ShellStateApplicationKt          : Started ShellStateApplicationKt in 1.036 seconds (JVM running for 0.936) shell:&gt;help AVAILABLE COMMANDS  Built-In Commands         clear: Clear the shell screen.         exit, quit: Exit the shell.         help: Display help about available commands.         script: Read and execute commands from a file.         stacktrace: Display the full stacktrace of the last error.  Server Commands         list: List projects registered on server         login: Authenticate and obtain token  shell:&gt;help list  NAME         list - List projects registered on server  SYNOPSYS         list [[--type] entity-type]    OPTIONS         --type  entity-type                 Possible values are PROJECT and USER                 [Optional, default = PROJECT]<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u041e\u0431\u0435 <em>login<\/em> \u0438 <em>list<\/em> \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 <em>L<\/em>, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e. \u041d\u0430\u0436\u0430\u0432 <em>l<\/em> \u0438 <em>TAB<\/em> \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043d\u0438\u0437\u0443 \u044d\u043a\u0440\u0430\u043d\u0430, \u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0432 <em>o<\/em> \u0438 \u043d\u0430\u0436\u0430\u0432 <em>TAB<\/em>, \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <em>login<\/em>. \u0422\u043e\u0442 \u0436\u0435 \u0444\u043e\u043a\u0443\u0441 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0438 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041c\u043d\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0434\u0435\u043b\u0430\u044e <em>&gt; login root 123456<\/em> \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0432\u044b\u0432\u0435\u0434\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>Connected<\/em>. \u0422\u043e \u0436\u0435 \u0438 \u0441 <em>list<\/em> .<\/p>\n<p>  <\/p>\n<h3 id=\"upravlenie-dostupnostyu-komandy\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0437\u043e\u0432 <em>list<\/em> \u0431\u0435\u0437 \u0442\u043e\u043a\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u044f \u0445\u043e\u0447\u0443 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432 <em>list<\/em> \u0431\u0435\u0437 \u0442\u043e\u043a\u0435\u043d\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u0431\u043e\u0433\u043e\u043c\u0435\u0440\u0437\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">     @ShellMethodAvailability(&quot;list&quot;)     fun listAvailable() = if (token != null) Availability.available()  else Availability.unavailable(&quot;cannot run without auth token&quot;) <\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 shell, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0435\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c, \u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <em>help<\/em> \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u0441\u0442 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">2020-05-02 13:30:12.593  INFO 4443 --- [           main] m.v.s.s.ShellStateApplicationKt          : Started ShellStateApplicationKt in 1.525 seconds (JVM running for 1.252) shell:&gt;list Command 'list' exists but is not currently available because cannot run without auth token Details of the error have been omitted. You can use the stacktrace command to print the full stacktrace. shell:&gt;help AVAILABLE COMMANDS  Built-In Commands         clear: Clear the shell screen.         exit, quit: Exit the shell.         help: Display help about available commands.         script: Read and execute commands from a file.         stacktrace: Display the full stacktrace of the last error.  Server Commands       * list: List projects regstered on server         login: Authenticate and obtain token  Commands marked with (*) are currently unavailable. Type `help &lt;command&gt;` to learn more.  shell:&gt;help list  NAME         list - List projects registered on server  SYNOPSYS         list [[--type] entity-type]    OPTIONS         --type  entity-type                 Possible values are PROJECT and USER                 [Optional, default = PROJECT]  CURRENTLY UNAVAILABLE         This command is currently not available because cannot run without auth token. <\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"nemnogo-krasoty\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0440\u0430\u0441\u043e\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043b\u044e\u0448\u0435\u043a \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0442 \u0436\u0438\u0437\u043d\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438 \u0441 \u043d\u0438\u043c\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0438\u043b\u0438 \u0432\u0435\u0440\u0442\u044f\u0449\u0438\u0439\u0441\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0446\u0432\u0435\u0442\u0430\u043c\u0438, \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0447\u0435\u043a. \u041c\u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u0432 command prompt, \u0441 \u043a\u0430\u043a\u0438\u043c \u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u043f\u043e\u0434 \u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0442\u043e\u043a\u0435\u043d \u0432\u044b\u0434\u0430\u043d. \u0421 \u0438\u043c\u0435\u043d\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u0430 \u0432\u043e\u0442 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0442\u0430\u0449\u0443 \u0438\u0437 application.properties \u2014 \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u044f\u043a\u0438\u0435 \u0448\u0442\u0443\u043a\u0438 Spring Framework \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e (\u0447\u0442\u043e \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c). \u041f\u043b\u044e\u0441 \u0431\u0443\u0434\u0443 \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442 prompt \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d \u043b\u0438 \u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0434\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c PrompProvider, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e JLine.<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">@ConfigurationProperties(prefix=&quot;shell&quot;) class ServerCommands : PromptProvider      lateinit var env: String \/\/ \u043f\u0440\u0438\u0434\u0435\u0442 \u0438\u0437 application.properties      override fun getPrompt(): AttributedString =             AttributedString(&quot;${env}:&gt;&quot;,                     AttributedStyle.DEFAULT.foreground(                             if (token == null) AttributedStyle.YELLOW else AttributedStyle.GREEN))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u0446\u0432\u0435\u0442\u043d\u043e\u0435. \u0423\u0434\u043e\u0431\u043d\u043e. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043a\u043e\u0434 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 (soap, protobuf \u0438\u043b\u0438 \u0435\u0449\u0435 \u0447\u0435\u0433\u043e) \u2014 \u0438 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0431\u044b\u0441\u0442\u0440\u043e. \u0414\u0430, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0442\u0443\u0434\u0430 \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<h2 id=\"i-o-spring-state-machine\">\u0418 \u043e Spring State Machine<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043d\u043e \u0443\u0436 \u0431\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0435\u0434\u043a\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0438\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0442\u0435\u043b, \u043d\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c, \u044b\u043d\u0442\u044b\u0440\u043f\u0440\u0430\u0439\u0437\u043e\u0432\u044b\u043c \u0438\u043b\u0438 \u0441 \u0432\u0435\u0431. \u041d\u043e \u0432\u043e\u0442 \u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0430\u043a\u0442\u043e\u0440\u043e\u0432, \u0430 \u0432\u0435\u0434\u044c \u043e\u043d\u0438 \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u044e\u0442 \u0438\u0434\u0435\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0438 \u0435\u0449\u0435 \u0432 \u044b\u043d\u0442\u044b\u0440\u043f\u0440\u0430\u0439\u0437 \u043b\u0435\u0437\u0443\u0442\u2026 \u041d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u044f\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"moi-pyat-kopeek-v-rassuzhdenie-ob-avtomatah-v-kontekste-spring-state-machine\">\u041c\u043e\u0438 \u043f\u044f\u0442\u044c \u043a\u043e\u043f\u0435\u0435\u043a \u0432 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u0431 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 Spring State Machine.<\/h3>\n<p>  <\/p>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439), \u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u041f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0438\u0433\u0440\u0430 <a href=\"https:\/\/ncase.me\/trust\/\" rel=\"nofollow\">The Evolution of Trust<\/a>. \u041c\u043e\u0436\u043d\u043e \u043e\u0431\u043c\u0430\u043d\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043d\u043e \u0442\u043e\u0442 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e (\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435) \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0438\u043d\u0430\u0447\u0435 \u043d\u0430 \u0442\u0435 \u0436\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041c\u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 xml \u0432 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u2014 \u0442\u0435 \u0436\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u043d\u0443\u0436\u0434\u0430\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0430 \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u043b\u043e\u0441\u044c \u0438\u0437-\u0437\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043f\u043b\u043e\u0445\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e &quot;\u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f&quot; \u0441\u043a\u0432\u043e\u0437\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043d\u043e\u0432\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043f\u043e\u043f\u043e\u0437\u0436\u0435. \u042d\u0442\u043e \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 Spring State Machine \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0441\u0435\u0431\u044f \u043e\u043a\u0443\u043f\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u0445\u043e\u0442\u0438\u043c \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0438\u0445. \u0410\u0432\u0442\u043e\u043c\u0430\u0442 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e \u0441\u0435\u0431\u044f, \u0430 \u043d\u0435 \u043f\u0440\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 Spring SM \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u043d\u043e \u044d\u0442\u043e \u043d\u0435\u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0435\u0433\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043e\u0449\u0440\u044f\u0442\u044c. \u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0445\u0435\u043c\u0430 &quot;\u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u043b \u0438 \u0437\u0430\u0431\u044b\u043b&quot;, \u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438, \u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0442\u044c \u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e \u0442\u043e.<\/p>\n<p>  <\/p>\n<p>\u041d\u0443, \u044d\u0442\u043e \u043c\u043e\u0435 \u043b\u0438\u0447\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043d\u0430 \u043b\u0438\u0447\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u0438 \u0438\u043b\u0438 \u043f\u044b\u043b\u0435\u0441\u043e\u0441\u044b \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430\u0445 \u0438 \u0438\u043c\u0435\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u2014 \u043c\u0438\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f, \u0430 \u043d\u0435 \u0441\u043f\u043e\u0440\u0438\u0442\u044c. <\/p>\n<p>  <\/p>\n<h3 id=\"tak-kuda-ego-zasunut-v-moem-primere\">\u0422\u0430\u043a \u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435?<\/h3>\n<p>  <\/p>\n<p>\u0425\u043e\u0447\u0443 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435, \u043f\u0440\u043e\u0441\u0442\u043e\u0435.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s_\/ab\/k6\/s_abk6dkgs-vfqurcdpenok33v8.png\"><br \/>  \u0412 \u0440\u0435\u0430\u043b\u0438\u044f\u0445 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0430\u0441\u044c \u0432 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0435 \u0438 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0435 &quot;\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d&quot; \u0432 \u0444\u043e\u043d\u0435. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0443. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0430\u043a \u0436\u0435 \u0431\u044b\u043b \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 (\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f) \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430, \u043d\u043e \u044d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 Thread Pool, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0438 \u0433\u0430\u0441\u0438\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 shell, \u0442\u0430\u043a \u043a\u0430\u043a SSM \u044d\u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u2014 \u044d\u0442\u043e \u043b\u0438\u0448\u043d\u0435\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 command prompt \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u0438 &quot;\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430&quot;, \u0430 \u043d\u0435 \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u042f \u043e\u043f\u0443\u0449\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u0430 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043b\u0438\u0448\u044c \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b. \u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u0432\u044b\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 <a href=\"https:\/\/projects.spring.io\/spring-statemachine\/\" rel=\"nofollow\">Quick Start<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, <del>\u043c\u043e\u044f \u0432\u0438\u043d\u0442\u043e\u0432\u043a\u0430<\/del> \u043c\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0433\u043b\u0443\u043f\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438. \u0421\u0430\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u043c\u043e\u043b\u043e\u0442\u043e\u043a \u0434\u043b\u044f \u0437\u0430\u0431\u0438\u0432\u0430\u043d\u0438\u044f \u0433\u0432\u043e\u0437\u0434\u0435\u0439 \u2014 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u0430\u0441\u043a\u0438 command prompt. \u041c\u0438\u043a\u0440\u043e\u0441\u043a\u043e\u043f \u0438\u043b\u0438 \u043d\u0435\u0442, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>token<\/em>. \u0415\u0433\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <em>null-safe<\/em> \u0438 <em>lateinit<\/em>.<br \/>  \u041d\u0430\u0441\u0442\u0440\u043e\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">override fun configure(transitions: StateMachineTransitionConfigurer&lt;State, Event&gt;) {         transitions                 .withExternal()                 .source(State.INIT).target(State.CONNECTING)                 .event(Event.LOGIN)                 .and()                 .withExternal()                 .source(State.CONNECTING).target(State.READY).event(Event.CONNECTED)                 .action { context -&gt; context.extendedState.variables[&quot;token&quot;] = context.messageHeaders[&quot;token&quot;] }.and()                 .withExternal()                 .source(State.CONNECTING).target(State.INIT).event(Event.FAILED).and()                 .withInternal()                 .source(State.READY).event(Event.COMMAND).and()                 .withExternal()                 .source(State.READY).target(State.CONNECTING).event(Event.LOGIN)     }  .... enum class State {    INIT, CONNECTING, READY } enum class Event {  LOGIN, CONNECTED, FAILED, COMMAND }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u2014 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 Spring. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u0445. \u0418\u043b\u0438 \u0440\u0430\u0437\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 <em>login<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">    @Autowired     lateinit var stateMachine: StateMachine&lt;State, Event&gt;     \/\/ \u0413\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435 \u0431\u0435\u0437 null     lateinit var token: String      @ShellMethod(&quot;Authenticate and obtain token&quot;)     fun login(             @ShellOption name: String,             @ShellOption password: String,             @ShellOption(defaultValue = &quot;admin&quot;) scope: String) =             runBlocking {                 stateMachine.sendEvent(                         MessageBuilder.createMessage(Event.LOGIN, MessageHeaders(mapOf(&quot;login&quot; to name))))                 delay(1_000)                 token = UUID.randomUUID().toString()                 stateMachine.sendEvent(                         MessageBuilder.createMessage(Event.CONNECTED, MessageHeaders(mapOf(&quot;token&quot; to token))))                 &quot;Connected&quot;             } ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043e\u043f\u0438\u0448\u0435\u043c \u043d\u043e\u0432\u044b\u0439 command prompt:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">    private val colors = mapOf(State.READY to AttributedStyle.DEFAULT.foreground(AttributedStyle.GREEN))             .withDefault { AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW) }      override fun getPrompt(): AttributedString =             AttributedString(&quot;${env}:&gt;&quot;, colors.getValue(stateMachine.state.id)) <\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"kotlin\">    @ShellMethodAvailability(&quot;list&quot;)     fun listAvailable() =             if (stateMachine.state.id == State.READY) Availability.available()             else Availability.unavailable(&quot;requires authentication performed first&quot;)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 Spring State Machine \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u0445 (guards), \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b, \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. <\/p>\n<p>  <\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>Spring Shell \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442 \u043f\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 <strong>\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/strong> \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>  <\/p>\n<p>Spring State Machine \u2014 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u0440\u0430\u0441\u0441\u0443\u0434\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/votez\/spring-shell-state\" rel=\"nofollow\">GitHub<\/a> .<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dv\/c9\/44\/dvc944kcgfhqoczcee-0upljwvq.png\"><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/500108\/\"> https:\/\/habr.com\/ru\/post\/500108\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/500108\/\">\n<p><em>\u042d\u0439, \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u0441 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c, \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438 \u043f\u0440\u043e\u0447\u0438\u043c? \u0418 \u0431\u0435\u0437 \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0435\u043a \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043d\u0430 JVM?<\/em><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pb\/xm\/lv\/pbxmlvw53tndaougujmxrcj-eea.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u0413\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b <a href=\"https:\/\/postman.com\" rel=\"nofollow\">Postman<\/a>. \u0425\u043e\u0442\u044f \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0445 \u043c\u044b \u0432\u0441\u0435 TDD \u0438 \u043f\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u043c\u0443 \u043e\u0433\u043e\u043d\u044c\u043a\u0443 Cucumber \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u0441\u043b\u0430\u0442\u044c REST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Postman. \u041f\u0440\u0438 \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (\u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435), \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043a\u0430\u043a\u0430\u0442\u044c \u043f\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0430\u043c, \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a. \u0412 \u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0423\u0436 \u044f \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441 cURL \u043f\u0438\u0441\u0430\u043b, \u0438 \u0432 IDEA \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u043b \u2014 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0442\u0438\u0432\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u0432\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0438, \u043c\u0435\u0439\u043d\u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0437\u0430 \u043d\u0438\u043c, \u043f\u043e\u0433\u043e\u0434\u044b \u0432 \u0434\u043e\u043c\u0435 \u0438 \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0434 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438. \u041a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a-\u043a\u043b\u0438\u043a \u0441\u0442\u0430\u043b \u0441\u044a\u0435\u0434\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043d\u0430\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043b \u043a\u0438\u043b\u043e\u043c\u0435\u0442\u0440\u0430\u0436 \u043c\u044b\u0448\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0418 \u0442\u0443\u0442 \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/projects.spring.io\/spring-shell\/\" rel=\"nofollow\">Spring Shell<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 shell \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 Spring. \u0414\u0430\u0432\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u0437\u044f\u043b\u0441\u044f \u0437\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0421\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u044f \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u2014 \u044d\u0442\u043e \u043f\u0440\u0435\u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 shell, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0432\u0435\u044f\u043d \u043c\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u043e, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u043b\u044e\u0448\u0435\u043a \u0441 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u2014 <em>Spring State Machine<\/em>. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b \u2014 \u044d\u0442\u043e \u0434\u043b\u044f \u0441\u0435\u0434\u044b\u0445 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u043d\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0432\u0430 \u2014 \u043d\u0430 \u043d\u0438\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b \u0432 Kotlin, \u0430 \u0432\u0441\u044f\u043a\u0438\u0435 <em>Akka<\/em> \u0438\u0445 \u043d\u0435\u0441\u0443\u0442 \u0432 &quot;\u043c\u0430\u0441\u0441\u044b&quot; \u0435\u0449\u0435 \u0434\u043e\u043b\u044c\u0448\u0435. \u042f \u043a\u043e\u0441\u043d\u0443\u0441\u044c <em>State Machine<\/em> \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0433\u0440\u0435\u0442\u044c \u0430\u043f\u043f\u0435\u0442\u0438\u0442.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302939","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302939"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302939\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}