it.sistematica.isharedoc.service
Class PartitionServiceImpl

java.lang.Object
  extended by it.sistematica.isharedoc.service.PartitionServiceImpl
All Implemented Interfaces:
PartitionService

@Service(value="partitionService")
public class PartitionServiceImpl
extends java.lang.Object
implements PartitionService


Field Summary
(package private)  it.neverworks.util.Configuration configuration
           
(package private)  DocumentManager documentManager
           
(package private)  it.neverworks.data.EntityManager entities
           
(package private)  IsharedocSystemService isharedocSystemService
           
(package private)  MessageboxService messageboxService
           
(package private)  NotificationService notificationService
           
protected static java.lang.ThreadLocal<java.util.Stack<Partition>> partitionStack
           
(package private)  WorkProcessManager processManager
           
(package private)  org.hibernate.SessionFactory sessionFactory
           
(package private)  it.neverworks.jasper.ConfigurableFileResolver setupTemplateFileResolver
           
(package private)  StoryboardService storyboardService
           
(package private)  WorkTaskManager taskManager
           
(package private)  it.neverworks.application.service.UserInfo userInfo
           
 
Constructor Summary
PartitionServiceImpl()
           
 
Method Summary
 void broadcastFile(File file, boolean createLinkInUserHome, java.lang.String group, java.lang.String title, java.lang.String message)
          Broadcast file.
 void broadcastMessage(java.lang.String group, java.lang.String title, java.lang.String message)
          Broadcast message.
 Partition create(java.lang.String userId, java.lang.String userPassword, java.lang.String name, java.lang.String code, java.lang.String description)
          Creates the partition.
 void deleteLicense(License contract)
          Delete license.
 void deleteLicenseService(LicenseService service)
          Delete license service.
 void drop(Partition partition, boolean debug)
          Attenzione!!!
 java.util.List<License> getAllLicenses(Partition partition)
          Gets the all licenses.
 java.util.List<Partition> getAllPartitions()
          Gets the all partitions.
 java.util.List<Partition> getApplicationPartitions()
          Gets the application partitions.
 Partition getPartition()
          Gets the partition.
 java.util.List<it.neverworks.security.User> getUsers(Partition... partitions)
          Gets the users.
 java.util.List<it.neverworks.security.User> getUsers(java.lang.String order, Partition... partitions)
          Gets the users.
 java.util.List<it.neverworks.security.User> getUsers(it.neverworks.security.User example, Partition... partitions)
          Gets the users.
 java.util.List<it.neverworks.security.User> getUsers(it.neverworks.security.User example, java.lang.String order, Partition... partitions)
          Gets the users.
 java.util.List<it.neverworks.security.User> getUsersCurrentPartition()
          Gets the users current partition.
 void moveUserData(it.neverworks.security.User from, it.neverworks.security.User to, boolean debug)
          Attenzione!!!
 Partition pop()
          Pop.
 void push(java.lang.Long partitionId)
          Push.
 void push(Partition partition)
          Push.
 void repair()
          Repair the partition.
 void repair(Partition partition)
          Repair.
 void repairAllPartitions()
          Repair all partitions.
 void saveLicense(Server server, License license)
          Save license.
 void saveLicenseService(License contract, LicenseService service)
          Save license service.
 it.neverworks.security.User sudo(java.lang.Long partitionId)
          Sudo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userInfo

it.neverworks.application.service.UserInfo userInfo

entities

it.neverworks.data.EntityManager entities

documentManager

DocumentManager documentManager

messageboxService

MessageboxService messageboxService

storyboardService

StoryboardService storyboardService

processManager

WorkProcessManager processManager

taskManager

WorkTaskManager taskManager

sessionFactory

org.hibernate.SessionFactory sessionFactory

configuration

it.neverworks.util.Configuration configuration

setupTemplateFileResolver

it.neverworks.jasper.ConfigurableFileResolver setupTemplateFileResolver

isharedocSystemService

IsharedocSystemService isharedocSystemService

notificationService

NotificationService notificationService

partitionStack

protected static java.lang.ThreadLocal<java.util.Stack<Partition>> partitionStack
Constructor Detail

PartitionServiceImpl

public PartitionServiceImpl()
Method Detail

getPartition

public Partition getPartition()
Description copied from interface: PartitionService
Gets the partition.

Specified by:
getPartition in interface PartitionService
Returns:
the partition

push

@Transactional
public void push(java.lang.Long partitionId)
Description copied from interface: PartitionService
Push.

Specified by:
push in interface PartitionService
Parameters:
partitionId - the partition id

push

public void push(Partition partition)
Description copied from interface: PartitionService
Push.

Specified by:
push in interface PartitionService
Parameters:
partition - the partition

pop

public Partition pop()
Description copied from interface: PartitionService
Pop.

Specified by:
pop in interface PartitionService
Returns:
the partition

sudo

@Transactional
public it.neverworks.security.User sudo(java.lang.Long partitionId)
                                 throws java.lang.Exception
Description copied from interface: PartitionService
Sudo.

Specified by:
sudo in interface PartitionService
Parameters:
partitionId - the partition id
Returns:
the user
Throws:
java.lang.Exception - the exception

create

@Transactional
public Partition create(java.lang.String userId,
                                      java.lang.String userPassword,
                                      java.lang.String name,
                                      java.lang.String code,
                                      java.lang.String description)
Description copied from interface: PartitionService
Creates the partition.

Specified by:
create in interface PartitionService
Parameters:
userId - the user id
userPassword - the user password
name - the name
code - the code
description - the description
Returns:
the partition

drop

@Transactional
public void drop(Partition partition,
                               boolean debug)
Attenzione!!! Questo metodo distrugge tutti i dati di una partizione. UTILIZZARE CON CAUTELA

Specified by:
drop in interface PartitionService
Parameters:
partition - the partition
debug - the debug

moveUserData

@Transactional
public void moveUserData(it.neverworks.security.User from,
                                       it.neverworks.security.User to,
                                       boolean debug)
Attenzione!!! Questo metodo sposta tutti i dati da un utente ad un'altro Prerequisiti: L'utente di destinazione deve esistere Vincoli: L'utente di destinazione deve essere senza dati (appena creato), altrimenti potrebbero verificarsi degli errori di chiavi duplicate UTILIZZARE CON CAUTELA

Specified by:
moveUserData in interface PartitionService
Parameters:
from - the from
to - the to
debug - the debug

repair

@Transactional
public void repair()
Description copied from interface: PartitionService
Repair the partition.

Specified by:
repair in interface PartitionService

repair

@Transactional
public void repair(Partition partition)
Description copied from interface: PartitionService
Repair.

Specified by:
repair in interface PartitionService
Parameters:
partition - the partition

repairAllPartitions

@Transactional
public void repairAllPartitions()
Description copied from interface: PartitionService
Repair all partitions.

Specified by:
repairAllPartitions in interface PartitionService

getUsers

public java.util.List<it.neverworks.security.User> getUsers(Partition... partitions)
Description copied from interface: PartitionService
Gets the users.

Specified by:
getUsers in interface PartitionService
Parameters:
partitions - the partitions
Returns:
the users

getUsers

public java.util.List<it.neverworks.security.User> getUsers(it.neverworks.security.User example,
                                                            Partition... partitions)
Description copied from interface: PartitionService
Gets the users.

Specified by:
getUsers in interface PartitionService
Parameters:
example - the example
partitions - the partitions
Returns:
the users

getUsers

public java.util.List<it.neverworks.security.User> getUsers(java.lang.String order,
                                                            Partition... partitions)
Description copied from interface: PartitionService
Gets the users.

Specified by:
getUsers in interface PartitionService
Parameters:
order - the order
partitions - the partitions
Returns:
the users

getUsers

public java.util.List<it.neverworks.security.User> getUsers(it.neverworks.security.User example,
                                                            java.lang.String order,
                                                            Partition... partitions)
Description copied from interface: PartitionService
Gets the users.

Specified by:
getUsers in interface PartitionService
Parameters:
example - the example
order - the order
partitions - the partitions
Returns:
the users

getUsersCurrentPartition

public java.util.List<it.neverworks.security.User> getUsersCurrentPartition()
Description copied from interface: PartitionService
Gets the users current partition.

Specified by:
getUsersCurrentPartition in interface PartitionService
Returns:
the users current partition

getAllPartitions

@Transactional(propagation=REQUIRES_NEW,
               readOnly=true)
public java.util.List<Partition> getAllPartitions()
Description copied from interface: PartitionService
Gets the all partitions.

Specified by:
getAllPartitions in interface PartitionService
Returns:
the all partitions

getApplicationPartitions

@Transactional(propagation=REQUIRES_NEW,
               readOnly=true)
public java.util.List<Partition> getApplicationPartitions()
Description copied from interface: PartitionService
Gets the application partitions.

Specified by:
getApplicationPartitions in interface PartitionService
Returns:
the application partitions

getAllLicenses

@Transactional
public java.util.List<License> getAllLicenses(Partition partition)
Description copied from interface: PartitionService
Gets the all licenses.

Specified by:
getAllLicenses in interface PartitionService
Parameters:
partition - the partition
Returns:
the all licenses

saveLicense

@Transactional
public void saveLicense(Server server,
                                      License license)
Description copied from interface: PartitionService
Save license.

Specified by:
saveLicense in interface PartitionService
Parameters:
server - the server
license - the license

deleteLicense

@Transactional
public void deleteLicense(License contract)
Description copied from interface: PartitionService
Delete license.

Specified by:
deleteLicense in interface PartitionService
Parameters:
contract - the license

saveLicenseService

@Transactional
public void saveLicenseService(License contract,
                                             LicenseService service)
Description copied from interface: PartitionService
Save license service.

Specified by:
saveLicenseService in interface PartitionService
Parameters:
contract - the license
service - the service

deleteLicenseService

@Transactional
public void deleteLicenseService(LicenseService service)
Description copied from interface: PartitionService
Delete license service.

Specified by:
deleteLicenseService in interface PartitionService
Parameters:
service - the service

broadcastFile

@Transactional
public void broadcastFile(File file,
                                        boolean createLinkInUserHome,
                                        java.lang.String group,
                                        java.lang.String title,
                                        java.lang.String message)
Description copied from interface: PartitionService
Broadcast file.

Specified by:
broadcastFile in interface PartitionService
Parameters:
file - the file
createLinkInUserHome - the create link in user home
group - the group
title - the title
message - the message

broadcastMessage

@Transactional
public void broadcastMessage(java.lang.String group,
                                           java.lang.String title,
                                           java.lang.String message)
Description copied from interface: PartitionService
Broadcast message.

Specified by:
broadcastMessage in interface PartitionService
Parameters:
group - the group
title - the title
message - the message