Package com.adito.policyframework

Examples of com.adito.policyframework.ResourceChangeEvent


              newNetworkPlace = NetworkPlaceDatabaseFactory.getInstance().createNetworkPlace(scheme, shortName, description, host,
                                path, port, username, password, readOnly, allowRecursive, noDelete, showHidden, autoStart,
                                getSessionInfo(request).getUser().getRealm().getRealmID());

                CoreServlet.getServlet().fireCoreEvent(
                                NetworkPlaceResourceType.addNetworkPlaceAttributes(new ResourceChangeEvent(this,
                                                NetworkPlacesEventConstants.CREATE_NETWORK_PLACE, newNetworkPlace,
                                                getSessionInfo(request), CoreEvent.STATE_SUCCESSFUL), newNetworkPlace));
            } catch (Exception e) {
                CoreServlet.getServlet().fireCoreEvent(
                                new ResourceChangeEvent(this, NetworkPlacesEventConstants.CREATE_NETWORK_PLACE,
                                                getSessionInfo(request), e));
                throw e;
            }
            actionStatus.add(new WizardActionStatus(WizardActionStatus.COMPLETED_OK,
                            "networkPlaceWizard.networkPlaceFinish.status.profileCreated"));
View Full Code Here


            NetworkPlaceDatabaseFactory.getInstance().updateNetworkPlace(np.getResourceId(), np.getScheme(), np.getResourceName(),
                            np.getResourceDescription(), np.getHost(), np.getPath(), np.getPort(), np.getUsername(),
                            np.getPassword(), np.isReadOnly(), np.isAllowRecursive(), np.isNoDelete(), np.isShowHidden(), np.isAutoStart());
            CoreServlet.getServlet().fireCoreEvent(
                            NetworkPlaceResourceType.addNetworkPlaceAttributes(
                                            new ResourceChangeEvent(this, NetworkPlacesEventConstants.UPDATE_NETWORK_PLACE, resource,
                                                            session, CoreEvent.STATE_SUCCESSFUL), np));
        } catch (Exception e) {
            CoreServlet.getServlet().fireCoreEvent(
                            new ResourceChangeEvent(this, NetworkPlacesEventConstants.UPDATE_NETWORK_PLACE, session, e));
            throw e;
        }
    }
View Full Code Here

        try {
            try {
                // TODO get the creating resource permission
                newProfile = ProfilesFactory.getInstance().createPropertyProfile(username, shortName, description, baseOn, realmId);
                CoreServlet.getServlet().fireCoreEvent(
                    new ResourceChangeEvent(this, CoreEventConstants.CREATE_PROPERTY_PROFILE, newProfile, info,
                                    CoreEvent.STATE_SUCCESSFUL));
            } catch (Exception e) {
                CoreServlet.getServlet().fireCoreEvent(
                    new ResourceChangeEvent(this, CoreEventConstants.CREATE_PROPERTY_PROFILE, info, e));
                throw e;
            }
            actionStatus.add(new WizardActionStatus(WizardActionStatus.COMPLETED_OK,
                            "profileWizard.profileFinish.status.profileCreated"));
        } catch (Exception e) {
View Full Code Here

            try {
                int priority = AuthenticationSchemeResourceType.getAuthenticationSchemePriority(getSessionInfo(request));
                defaultAuthenticationScheme = SystemDatabaseFactory.getInstance().createAuthenticationSchemeSequence(
                                getSessionInfo(request).getUser().getRealm().getRealmID(), name, description,
                                selectedModules.asArray(), true, priority);
                CoreEvent evt = new ResourceChangeEvent(this, CoreEventConstants.CREATE_AUTHENTICATION_SCHEME, defaultAuthenticationScheme, getSessionInfo(request), CoreEvent.STATE_SUCCESSFUL);
                int authCounter = 1;
                for (Iterator i = selectedModules.iterator(); i.hasNext();) {
                    AuthenticationSchemeResourceType.addAuthenticationModule(evt, (String) i.next(), authCounter);
                    authCounter++;
                }
                CoreServlet.getServlet().fireCoreEvent(evt);
            } catch (Exception e) {
                CoreServlet.getServlet().fireCoreEvent(
                    new ResourceChangeEvent(this, CoreEventConstants.CREATE_AUTHENTICATION_SCHEME, getSessionInfo(request), e));
                throw e;
            }
            actionStatus.add(new WizardActionStatus(WizardActionStatus.COMPLETED_OK,
                            "authwizard.athenticationSchemeFinish.status.authenticationSchemeCreated"));
        } catch (Exception e) {
View Full Code Here

                    baseOn, realmId);

                PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(newProfile, profileForm.getSelectedPoliciesList(),
                    getSessionInfo(request));
                CoreServlet.getServlet().fireCoreEvent(
                    new ResourceChangeEvent(this, CoreEventConstants.CREATE_PROPERTY_PROFILE, newProfile, getSessionInfo(request),
                                    ResourceChangeEvent.STATE_SUCCESSFUL));
                profileForm.setResource(newProfile);
            } catch (Exception e) {
                CoreServlet.getServlet().fireCoreEvent(
                    new ResourceChangeEvent(this, CoreEventConstants.CREATE_PROPERTY_PROFILE, getSessionInfo(request), e));
                throw e;
            }
        }
        messages.add(Globals.MESSAGES_KEY, new ActionMessage("message.profileSaved"));
        saveMessages(request, messages);
View Full Code Here

     *      com.adito.security.SessionInfo)
     */
    public void updateResource(AuthenticationScheme resource, SessionInfo session) throws Exception {
        try {
            SystemDatabaseFactory.getInstance().updateAuthenticationSchemeSequence((AuthenticationScheme) resource);
            CoreEvent evt = new ResourceChangeEvent(this, CoreEventConstants.UPDATE_AUTHENTICATION_SCHEME, resource, session,
                            CoreEvent.STATE_SUCCESSFUL);
            int authCounter = 1;
            for (Iterator i = ((AuthenticationScheme) resource).modules(); i.hasNext();) {
                String s = (String) i.next();
                AuthenticationSchemeResourceType.addAuthenticationModule(evt, s, authCounter);
                authCounter++;
            }
            CoreServlet.getServlet().fireCoreEvent(evt);
        } catch (Exception e) {
            CoreServlet.getServlet().fireCoreEvent(
                new ResourceChangeEvent(this, CoreEventConstants.UPDATE_AUTHENTICATION_SCHEME, session, e));
            throw e;
        }
    }
View Full Code Here

     */
    public PropertyProfile removeResource(int resourceId, SessionInfo session) throws Exception {
        try {
            PropertyProfile resource = ProfilesFactory.getInstance().deletePropertyProfile(resourceId);
            CoreServlet.getServlet().fireCoreEvent(
                new ResourceChangeEvent(this, CoreEventConstants.DELETE_PROPERTY_PROFILE, resource, session,
                                CoreEvent.STATE_SUCCESSFUL));
            return resource;
        } catch (Exception e) {
            CoreServlet.getServlet().fireCoreEvent(
                new ResourceChangeEvent(this, CoreEventConstants.DELETE_PROPERTY_PROFILE, null, session,
                                CoreEvent.STATE_UNSUCCESSFUL));
            throw e;
        }
    }
View Full Code Here

        try {
            PropertyProfile profile = (PropertyProfile) resource;
            ProfilesFactory.getInstance().updatePropertyProfile(profile.getResourceId(), profile.getResourceName(),
                profile.getResourceDescription());
            CoreServlet.getServlet().fireCoreEvent(
                new ResourceChangeEvent(this, CoreEventConstants.UPDATE_PROPERTY_PROFILE, resource, session,
                                CoreEvent.STATE_SUCCESSFUL));
        } catch (Exception e) {
            CoreServlet.getServlet().fireCoreEvent(
                new ResourceChangeEvent(this, CoreEventConstants.UPDATE_PROPERTY_PROFILE, session, e));
            throw e;
        }
    }
View Full Code Here

            t = (Tunnel) resource;
            TunnelDatabaseFactory.getInstance().updateTunnel(t.getResourceId(), t.getResourceName(), t.getResourceDescription(),
                            t.getType(), t.isAutoStart(), t.getTransport(), t.getUsername(), t.getSourcePort(), t.getDestination(),
                            t.getSourceInterface());
            CoreServlet.getServlet().fireCoreEvent(
                            addTunnelAttributes(new ResourceChangeEvent(this, TunnelsEventConstants.UPDATE_TUNNEL, resource, session,
                                            CoreEvent.STATE_SUCCESSFUL), t));
        } catch (Exception e) {
            CoreServlet.getServlet().fireCoreEvent(
                            addTunnelAttributes(new ResourceChangeEvent(this, TunnelsEventConstants.UPDATE_TUNNEL, null, session,
                                            CoreEvent.STATE_UNSUCCESSFUL), t));
            throw e;
        }
    }
View Full Code Here

TOP

Related Classes of com.adito.policyframework.ResourceChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.