use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.
the class TicketServiceImpl method findAll.
@Override
public List<DataGridTicket> findAll() throws DataGridConnectionRefusedException {
logger.info("Find all tickets");
TicketAdminService tas = irodsServices.getTicketAdminService();
List<DataGridTicket> dgTickets;
List<Ticket> tickets;
try {
tickets = tas.listAllTickets(OFFSET);
} catch (JargonException e) {
logger.info("Could not list all tickets in the grid: {}.", e.getMessage());
tickets = new ArrayList<>();
}
dgTickets = convertListOfTickets(tickets);
return dgTickets;
}
use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.
the class TestFindTicket method testFindTicket.
@Test
public void testFindTicket() throws DataGridConnectionRefusedException, DataGridTicketNotFoundException {
DataGridTicket dgt = ticketService.find(ticketString);
assertNotNull(dgt);
assertFalse(dgt.getTicketString().isEmpty());
assertTrue(dgt.getPath().equals(targetPath));
assertTrue(dgt.getOwner().equals(username));
assertDate(EXPIRATION_DATE, dgt.getExpirationDate());
assertEquals(USES_LIMIT, dgt.getUsesLimit());
assertEquals(USES_COUNT, dgt.getUsesCount());
assertEquals(WRITE_BYTE_LIMIT, dgt.getWriteByteLimit());
assertEquals(WRITE_BYTE_COUNT, dgt.getWriteByteCount());
assertEquals(WRITE_FILE_LIMIT, dgt.getWriteFileLimit());
assertEquals(WRITE_FILE_COUNT, dgt.getWriteFileCount());
assertEquals(1, dgt.getHosts().size());
assertEquals(1, dgt.getUsers().size());
assertTrue(dgt.getUsers().contains(username));
assertTrue(dgt.getGroups().contains(PUBLIC_GROUP));
}
use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.
the class TestTicketService method testListingAllTickets.
@Test
public void testListingAllTickets() throws DataGridConnectionRefusedException {
List<DataGridTicket> tickets = ticketService.findAll();
assertNotNull(tickets);
assertFalse(tickets.isEmpty());
for (DataGridTicket t : tickets) {
assertNotNull(t.getPath());
assertFalse(t.getTicketString().isEmpty());
assertFalse(t.getOwner().isEmpty());
assertFalse(t.getTicketString().isEmpty());
}
}
use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.
the class TestCreateTicketWithExpirationDate method setUp.
@Before
public void setUp() throws DataGridException, JargonException {
String parentPath = String.format("/%s/home", zone);
targetPath = String.format("%s/%s", parentPath, username);
ticketUtils = new TestTicketUtils(irodsServices);
date = new Date();
dgt = new DataGridTicket(targetPath);
dgt.setExpirationDate(date);
}
use of com.emc.metalnx.core.domain.entity.DataGridTicket in project metalnx-web by irods-contrib.
the class TestCreateTicketWithGroupRestriction method setUp.
@Before
public void setUp() throws DataGridException, JargonException {
String parentPath = String.format("/%s/home", zone);
targetPath = String.format("%s/%s", parentPath, username);
ticketUtils = new TestTicketUtils(irodsServices);
dgt = new DataGridTicket(targetPath);
dgt.addGroup(PUBLIC_GROUP);
}
Aggregations