Partizan Access Control Management SDK User Manual: Version 1.0.2, 09 February 2016

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Partizan Access Control Management

SDK User Manual


Version 1.0.2, 09 February 2016
Abstract

This document is the Software User Manual (SUM) for the Partizan Access
Control Management SDK project and was made according to the software
engineering standard described in ISO/IEC JTC 1/SC 7. The Software User Manual
(SUM) instructs how to install and use the Partizan ACM SDK software.

Partizan ACM SDK User Manual Page 2


Contents

Chapter 1 Introduction ............................................................................................................................................. 5


1.1 Intended readership .................................................................................................................................. 5
1.2 Applicability ................................................................................................................................................ 5
1.3 Purpose ........................................................................................................................................................ 5
1.4 How to use this document ...................................................................................................................... 5
1.5 Problem reporting ..................................................................................................................................... 6
Chapter 2 Overview ................................................................................................................................................... 7
Chapter 3 Tutorial ...................................................................................................................................................... 8
3.1 Installing the software .............................................................................................................................. 8
3.1.1 System requirements .......................................................................................................................... 8
3.1.2 Installing Java SE Runtime Environment version 7 or above ....................................................... 8
3.1.3 Partizan ACM SDK Installation .......................................................................................................... 8
3.2 Uninstalling the software ......................................................................................................................... 9
3.3 Software running ....................................................................................................................................... 9
3.4 Database .................................................................................................................................................... 11
Chapter 4 Reference ............................................................................................................................................... 12
4.1 Controllers ................................................................................................................................................. 12
4.1.1 Get all controllers ............................................................................................................................... 12
4.1.2 Get specific controller ........................................................................................................................ 12
4.1.3 Add controller .................................................................................................................................... 13
4.1.4 Delete controller ............................................................................................................................... 13
4.1.5 Update the controller parameters .................................................................................................... 14
4.2 Groups ........................................................................................................................................................ 14
4.2.1 Get all device groups......................................................................................................................... 14

Partizan ACM SDK User Manual Page 3


4.2.2 Add a group ........................................................................................................................................ 15
4.2.3 Delete a group .................................................................................................................................... 15
4.3 Doors management ................................................................................................................................. 16
4.3.1 Add a door........................................................................................................................................... 16
4.3.2 Get door info ....................................................................................................................................... 16
4.3.3 Edit door info....................................................................................................................................... 16
4.3.4 Open the door..................................................................................................................................... 17
4.3.5 Close the door .................................................................................................................................... 17
4.3.6 Open the door for a long time .......................................................................................................... 18
4.3.7 Lock the door ...................................................................................................................................... 18
4.3.8 Unlock the door .................................................................................................................................. 18
4.4 Operations with cards ............................................................................................................................ 19
4.4.1 Get all cards ........................................................................................................................................ 19
4.4.2 Add card .............................................................................................................................................. 19
4.4.3 Delete card .......................................................................................................................................... 19
4.4.4 Edit card .............................................................................................................................................. 20
4.4.5 Delete all cards in interval ................................................................................................................ 20
4.5 Timezones ................................................................................................................................................. 21
4.5.1 Get all timezones ............................................................................................................................... 21
4.5.2 Get one time zone.............................................................................................................................. 21
4.5.3 Edit the timezone ............................................................................................................................... 21
4.6 Holidays ..................................................................................................................................................... 23
4.6.1 Get all device holidays ...................................................................................................................... 23
4.6.2 Get one holiday .................................................................................................................................. 23
4.6.3 Add holiday ......................................................................................................................................... 23
4.6.4 Edit holiday ......................................................................................................................................... 24
4.7 Events ......................................................................................................................................................... 25
4.7.1 Get all events in specified time interval .......................................................................................... 25
4.7.2 Get all device events in specified time interval ............................................................................. 25
Appendix A.................................................................................................................................................................. 28

Partizan ACM SDK User Manual Page 4


Chapter 1 Introduction

1.1 Intended readership

This document covers the use for the following users of the Partizan ACM
system:

 the system administrator


 the project administrators
 the application providers
 the resource providers
 the programmers

1.2 Applicability

This Software User Manual (SUM) applies to the Partizan Access Control
Management SDK version 1.0.

1.3 Purpose

The purpose of the SUM is to assist the user in installing and using the Partizan
ACM SDK software.

1.4 How to use this document


 Chapter 2 gives an overview of the Partizan ACM SDK software
 Chapter 3 contains tutorials for common tasks that enable users to get
started quickly

Partizan ACM SDK User Manual Page 5


 Chapter 4 gives a reference of the complete Partizan ACM SDK software
 Appendix A includes a list of all server states

1.5 Problem reporting

For all problems please contact our support:

E-mail: [email protected]

Skype: partizan-support

Tel: +44 207 048-32-05.

Partizan ACM SDK User Manual Page 6


Chapter 2 Overview

This software is created for Partizan PAC-XX.NET device integration with


third party softwares. By using application/json for data transfer makes system
easy to use. JSON is a language-independent data format. Code for parsing and
generating JSON data is readily available in many programming languages.

Partizan ACM SDK User Manual Page 7


Chapter 3 Tutorial

3.1 Installing the software


3.1.1 System requirements
 CPU Pentium II 800M
 DDR 1Gb
 Operating systems:
o Windows 98
o Windows XP
o Windows Vista
o Windows 7
o Windows 8
o Windows 2003 Server and above

3.1.2 Installing Java SE Runtime Environment version 7 or above

Before Partizan ACM SDK can be installed, Java SE Runtime Environment


must be installed at PC. If this software is installed in the system, this step can be
skipped. Otherwise, please visit

http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-
1880261.html a and download software according to operating system installed at
PC. After the download is completed, install the software using the instructions
provided by the installer.

3.1.3 Partizan ACM SDK Installation

Please run Partizan ACM SDK.exe and install software using the instructions.
Default installation path is C:\\Program files(x86)\Partizan\Partizan ACM SDK\

Partizan ACM SDK User Manual Page 8


3.2 Uninstalling the software
All the applications can be easily uninstalled by using uninstall.exe.

3.3 Software running

The application can be started by using server.bat file. On first tab “Status”
the server information is described (Pic. 1)

Pic. 1 Server information

On second tab “Server” port parameters can be configured (Pic. 2). By default
service is running at http://localhost:8089/acm-rest/. Demo application can be found
at http://localhost:8089/acm-rest/test (Pic.3)

Partizan ACM SDK User Manual Page 9


Pic. 2 Port configuring

Pic. 3 Demo application

Partizan ACM SDK User Manual Page 10


3.4 Database

The software uses H2 database. H2 is a relational database management


system written in Java. It can be embedded in Java applications or run in the client-
server mode. Web console can be opened at http://localhost:8082/ .

Partizan ACM SDK User Manual Page 11


Chapter 4 Reference

In this chapter ACM-rest service description is made.

Request Content-Type: application/json

Response Content-Type: application/json

4.1 Controllers
4.1.1 Get all controllers

Functional description: this operation gets a list of all controllers from the
database.

Formal description

 Syntax: GET /acm-rest/device


 Returns:
o { controllers_list_with_info }
o Empty string if there are no controllers in the database
4.1.2 Get specific controller

Functional description: this operation gets a specific controller from the database.

Formal description

 Syntax: GET /acm-rest/device/{controllerId}


 Returns:
o { controller _info }

Partizan ACM SDK User Manual Page 12


o Empty string if there are no controllers in the database
4.1.3 Add controller

Functional description: this operation adds a controller to the system.

Formal description

 Syntax: POST /acm-rest/device


 Request body:
o int id - Controller id
o String type - Controller type (See appendix 1 below)
o String name - Controller name
o String ip - IP-address
o int port - IP-address port
o String address - Domain name
o int addressPort - Domain name port
o String group - Group name
o int timeAlarm - Alarm time (1-65535. 99 means no limitations)
o int timeFire - Fire alarm time (1-65535. 99 means no limitations)
o int interlock -
 0: no inter-lock,
 1: 1-2 door inter-lock
 2: 3-4 door inter-lock
o int hijackPassword - Hijack password
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of
server error
4.1.4 Delete controller

Functional description: this operation deletes the controller from the system.

Formal description

 Syntax: DELETE /acm-rest/device/{deviceID}


Partizan ACM SDK User Manual Page 13
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of
server error
4.1.5 Update the controller parameters

Functional description: this operation updates the controller information in the


system.

Formal description

 Syntax: PUT /acm-rest/device


 Request body:
o int id - Controller id
o String name - Controller name
o String ip - IP-address
o int port - IP-address port
o String address - Domain name
o int addressPort - Domain name port
o String group - Group name
o int timeAlarm - Alarm time (1-65535. 99 means no limitations)
o int timeFire - Fire alarm time (1-65535. 99 means no limitations)
o int interlock -
 0: no inter-lock,
 1: 1-2 door inter-lock
 2: 3-4 door inter-lock
o int hijackPassword - Hijack password
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.2 Groups
4.2.1 Get all device groups

Partizan ACM SDK User Manual Page 14


Functional description: this operation gets a list of all controller groups from the
database.

Formal description

 Syntax: POST /acm-rest/dev-group


 Returns:
 { list_of_device_groups }
 Empty string if there are no controller groups in the database
4.2.2 Add a group

Functional description: this operation adds a group of controllers in the system.

Formal description

 Syntax: POST /acm-rest/dev-group


 Request body:
o String name - Group name
o String description - Group description
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.2.3 Delete a group

Functional description: this operation deletes a group of controllers from the


system.

Formal description

 DELETE /acm-rest/dev-group/{name}
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error

Partizan ACM SDK User Manual Page 15


4.3 Doors management
4.3.1 Add a door

Functional description: Doors are added automatically to the software while


controller is added. Depending of controllers type following amount of doors are
added:

 PAC12 – one door


 PAC21 – two doors
 PAC22 – two doors
 PAC41 – 4 doors
 PAC42 – 4 doors
4.3.2 Get door info

Functional description: this operation gets door parameters from the database.

Formal description

 Syntax: GET /acm-rest/door/{controllerID}/{doorNumber}


 Returns:
 { door_info }
 Empty string if there are no doors with such parameters in the database
4.3.3 Edit door info

Functional description: this operation modifies door parameters in the database.

Formal description

 Syntax: PUT /acm-rest/door/{currentControllerID}/{currentDoorNumber}


 Request body:
o int idDev - Controller id
o String name - Door name name
o int openTime - Door open time
o int openDoorOverTime - Door open overtime

Partizan ACM SDK User Manual Page 16


o boolean longTimeAlarm - Door is open overtime alarm
o boolean invCardAlarm - Invalid card alarm
o boolean invTimeAlarm - Card is used during invalid timezone alarm
o boolean crashDoorAlarm - Door Alarm
o boolean doubleDirection - Double direction
o int alarmTime - Alarm output time
o int person - Multi-person (2...6)
o int password - Password
o int doorNumber - Door number in controller
o String group - Door group
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.3.4 Open the door

Functional description: this operation opens the door.

Formal description

 Syntax: PUT /acm-rest/door/{controllerID}/{doorNumber}/open


 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.3.5 Close the door

Functional description: this operation closes the door.

Formal description

 Syntax: PUT /acm-rest/door/{controllerID}/{doorNumber}/close


 Returns:
o JSON: { "response" : state } (see appendix A for list of states)

Partizan ACM SDK User Manual Page 17


o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.3.6 Open the door for a long time

Functional description: this operation opens the door for a long time.

Formal description

 PUT /acm-rest/door/{controllerID}/{doorNumber}/longopen
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.3.7 Lock the door

Functional description: this operation locks door.

Formal description

 PUT /acm-rest/door/{controllerID}/{doorNumber}/lock
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.3.8 Unlock the door

Functional description: this operation locks door.

Formal description

 PUT /acm-rest/door/{controllerID}/{doorNumber}/unlock
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error

Partizan ACM SDK User Manual Page 18


4.4 Operations with cards
4.4.1 Get all cards

Functional description: this operation gets all cards from the database.

Formal description

 GET /acm-rest/cards
 Returns:
o { cards_list_with_info }
o Empty string if there are no cards in the database
4.4.2 Add card

Functional description: this operation adds card to the database.

Formal description

 Syntax: POST /acm-rest/cards


 Request body:
o nt cardID - Card ID
o int cardNumber - Card Number
o String name - Card name
o int status - Status. 1 - enabled, 0 - disabled
o int password - Password
o String expireDate - Expire date. DD/MM/YYYY
o int idTimez - Timezone id
o int idDevice - Device id
o int nDoor - Door number
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.4.3 Delete card

Functional description: this operation deletes card.

Partizan ACM SDK User Manual Page 19


Formal description

 DELETE /acm-rest/cards/{deviceID}/{doorNumber}/{cardNumber}
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.4.4 Edit card

Functional description: this operation modifies card in the controller.

Formal description

 Syntax: PUT /acm-rest/cards/{currentDeviceID}/{currentDoorNumber}/


{currentCardNumber}
 Request body:
o int cardID - Card ID
o int cardNumber - Card Number
o String name - Card name
o int status - Status. 1 - enabled, 0 - disabled
o int password - Password
o expireDate - Expire date
 expireDate.day
 expireDate.month
 expireDate.year
o int idTimez - Timezone id
o int idDevice - Device id
o int nDoor - Door number
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.4.5 Delete all cards in interval

Partizan ACM SDK User Manual Page 20


Functional description: this operation deletes card in interval.

Formal description

 DELETE /acm-rest/cards/deleteInRange/{firstId}/{lastId}
 Request body:
o int firstId – first card id
o int lastId – last card id
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.5 Timezones
4.5.1 Get all timezones

Functional description: this operation gets all timezones from the controller.

Formal description

 GET /acm-rest/timezones/{controllerID}/{doorNumber}
 Returns:
o { timezones_list_with_info }
o Empty string if there are no such controller or door
4.5.2 Get one time zone

Functional description: this operation gets one timezone from the controller.

Formal description

 GET /acm-rest/timezones/{controllerID}/{doorNumber}/{timezoneNumber}
 Returns:
o { timezones_info }
o Empty string if there are no such controller or door
4.5.3 Edit the timezone

Functional description: this operation modifies timezone in the controller.

Partizan ACM SDK User Manual Page 21


Formal description

 Syntax: PUT /acm-rest/timezones


 Request body:
o int idDevice - Controller id
o int numDoor - Door number
o int numTimez - Time zone number
o boolean status - Status. Enabled/Disabled
//Timezone date scope
 boolean sun
 boolean mon
 boolean tue
 boolean wen
 boolean thu
 boolean fri
 boolean sat
 boolean holiday
o boolean apb - Antipassback
o IdentType indentify
o expireDate - Expire date
 expireDate.day
 expireDate.month
 expireDate.year
o int group - Timezone group
o timeworkStart
 timeworkStart.hour
 timeworkStart.minute
 timeworkStart.second
o timeworkEnd
 timeworkEnd.hour
 timeworkEnd.minute
 timeworkEnd.second

Partizan ACM SDK User Manual Page 22


Returns:

o JSON: { "response" : state } (see appendix A for list of states)


o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.6 Holidays
4.6.1 Get all device holidays

Functional description: this operation gets all holidays from the controllers.

Formal description

 GET /acm-rest/holidays/{deviceID}
 Returns:
o { device_holidays_list }
o Empty string if there are no such controller or no holidays
4.6.2 Get one holiday

Functional description: this operation gets one holiday from the controller.

Formal description

 GET /acm-rest/holidays/{deviceID}/{holidayIndex}
 Returns:
o { device_holiday }
o Empty string if there are no such controller or controller have no holiday
with such index
4.6.3 Add holiday

Functional description: this operation adds a holiday in the controller.

Formal description

 Syntax: POST /acm-rest/holidays


 Request body:
o int idDevice - Controller ID
o int index - Holiday index, 1 – 59
Partizan ACM SDK User Manual Page 23
o startDate
 startDate.day
 startDate.month
 startDate.year
o endDate
 endDate.day
 endDate.month
 endDate.year
 boolean disable - Disable holiday

Returns:

o JSON: { "response" : state } (see appendix A for list of states)


o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.6.4 Edit holiday

Functional description: this operation modifies a holiday in the controller.

Formal description

 Syntax: PUT /acm-rest/holidays


 Request body:
o int idDevice - Controller ID
o int index - Holiday index, 1 – 59
o startDate
 startDate.day
 startDate.month
 startDate.year
o endDate
 endDate.day
 endDate.month
 endDate.year
 boolean disable - Disable holiday

Partizan ACM SDK User Manual Page 24


Returns:

o JSON: { "response" : state } (see appendix A for list of states)


o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.7 Events
4.7.1 Get all events in specified time interval

Functional description: this operation gets all events from the database.

Formal description

 Syntax: POST /acm-rest/events


 Request body:
o start - Time interval starting point
 start.minute
 start.hour
 start.day
 start.month
 start.year
o end - Time interval ending point
 end.second
 end.minute
 end.hour
 end.day
 end.month
 end.year
 Returns:
o JSON: { "response" : state } (see appendix A for list of states)
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.7.2 Get all device events in specified time interval

Functional description: this operation gets all events from specified controller
from the database.
Partizan ACM SDK User Manual Page 25
Formal description

 Syntax: POST /acm-rest/events/{controllerID}


 Request body:
o start - Time interval starting point
 start.minute
 start.hour
 start.day
 start.month
 start.year
o end - Time interval ending point
 end.second
 end.minute
 end.hour
 end.day
 end.month
 end.year
 Returns:
o { list_of_events }
o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.7.3 Gets device events in specified id interval

Functional description: this operation gets events from all controllers from the
database.

Formal description

 Syntax: POST /acm-rest/events/idInterval


 Request body:
o firstEventId - first id of range
o lastEventId - last id of range
 Returns:
o { list_of_events }

Partizan ACM SDK User Manual Page 26


o HTTP status code 500, { "response" : RMI_ERROR } - in case of server
error
4.7.4 Gets device events in specified id interval

Functional description: this operation gets events from specified controller from
the database.

Formal description

 Syntax: POST /acm-rest/events/{controllerID}/idInterval


 Request body:
o firstEventId - first id of range
o lastEventId - last id of range
 Returns:
o { list_of_events }

HTTP status code 500, { "response" : RMI_ERROR } - in case of server error

Partizan ACM SDK User Manual Page 27


Appendix A

List of all server states:

 OK
 NOT_CONNECTED - Device is not connected right now. Changes will take
effect after device will be connected.
 INTERNAL_ERROR - Device is not responding on commands
 SOCKET_ERROR - Socket error
 NOT_OK - Unknown response from device
 CS_ERROR - Bad packet from device
 START_ERROR - Bad packet from device
 NO_DEVICE - No such device
 RMI_ERROR - RMI error
 DUPLICATE - Item is already in the database
 DB_ERROR - Database error
 NO_DOOR - No such door
 JSON_ERROR - JSON parsing error
 NOT_FOUND - Item not found
 ERROR_LOAD_SET - Unable to load settings to device

Partizan ACM SDK User Manual Page 28

You might also like