<tdclass="colFirst"><code><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></code></td>
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#login(com.plannaplan.entities.User)">login</a></span>​(<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a> authority)</code></th>
<tdclass="colLast">
<divclass="block">generates token for user and if user don't have name in database it will
attemp to obtain these from usos api and saves changes in database</div>
</td>
</tr>
<trclass="rowColor"id="i11">
<tdclass="colFirst"><code><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></code></td>
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#save(com.plannaplan.entities.User)">save</a></span>​(<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a> user)</code></th>
<tdclass="colLast">
<divclass="block">sacves user to databse and return instatnce with id</div>
</td>
</tr>
<trclass="altColor"id="i12">
<tdclass="colFirst"><code>void</code></td>
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#saveAll(java.util.List)">saveAll</a></span>​(java.util.List<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>> users)</code></th>
<tdclass="colLast"> </td>
</tr>
<trclass="rowColor"id="i13">
<tdclass="colFirst"><code>java.util.List<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></code></td>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></span> <spanclass="memberName">checkForUser</span>​(<spanclass="arguments">java.lang.String email,
java.lang.String usosId)</span></div>
<divclass="block">checks if user exist and return him or creates new one with student role
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></span> <spanclass="memberName">checkForUser</span>​(<spanclass="arguments">java.lang.String email,
java.lang.String usosId,
<ahref="../types/UserRoles.html"title="enum in com.plannaplan.types">UserRoles</a> roleIfNotExist)</span></div>
<divclass="block">checks if user exist and creates new one if doesn't</div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></span> <spanclass="memberName">login</span>​(<spanclass="arguments"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a> authority)</span>
throws <spanclass="exceptions"><ahref="../exceptions/UserNotFoundException.html"title="class in com.plannaplan.exceptions">UserNotFoundException</a></span></div>
<divclass="block">generates token for user and if user don't have name in database it will
attemp to obtain these from usos api and saves changes in database</div>
<dd><code>authority</code> - user we want to login</dd>
<dt><spanclass="returnLabel">Returns:</span></dt>
<dd>user with changed values after save in db</dd>
<dt><spanclass="throwsLabel">Throws:</span></dt>
<dd><code><ahref="../exceptions/UserNotFoundException.html"title="class in com.plannaplan.exceptions">UserNotFoundException</a></code> - throwed if user doesn't exist</dd>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></span> <spanclass="memberName">save</span>​(<spanclass="arguments"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a> user)</span></div>
<divclass="block">sacves user to databse and return instatnce with id</div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType"><ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a></span> <spanclass="memberName">getUserByEmail</span>​(<spanclass="arguments">java.lang.String email)</span>
throws <spanclass="exceptions"><ahref="../exceptions/UserNotFoundException.html"title="class in com.plannaplan.exceptions">UserNotFoundException</a></span></div>
<dd><code><ahref="../exceptions/UserNotFoundException.html"title="class in com.plannaplan.exceptions">UserNotFoundException</a></code> - throwed if user doesn't exist</dd>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.Optional<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">getByAuthority</span>​(<spanclass="arguments">java.lang.String authority)</span></div>
<divclass="block">return user by given authority</div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.Optional<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">getByToken</span>​(<spanclass="arguments">java.lang.String token)</span></div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.List<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">searchForStudents</span>​(<spanclass="arguments">java.lang.String query)</span></div>
<divclass="block">search for user with given query</div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.Optional<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">getById</span>​(<spanclass="arguments">java.lang.Long userId)</span></div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.List<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">getAllStudents</span>()</div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.Optional<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">getUserByRefreshToken</span>​(<spanclass="arguments">java.lang.String refreshToken)</span></div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">void</span> <spanclass="memberName">saveAll</span>​(<spanclass="arguments">java.util.List<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>> users)</span></div>
<divclass="memberSignature"><spanclass="modifiers">public</span> <spanclass="returnType">java.util.List<<ahref="../entities/User.html"title="class in com.plannaplan.entities">User</a>></span> <spanclass="memberName">getStudentsSortedByRanking</span>()</div>
<divclass="block">get students sorted by their ranking</div>