Package com.adito.core

Examples of com.adito.core.CoreEvent


                    + "] authentication failed", ex);

                LogonForm logonForm = (LogonForm) form;

                CoreServlet.getServlet().fireCoreEvent(
                    new CoreEvent(this, CoreEventConstants.LOGON, null, null, ex).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_IP_ADDRESS, request.getRemoteAddr()).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_HOST, request.getRemoteHost()).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_SCHEME, scheme.getSchemeName()).addAttribute(
                        CoreAttributeConstants.EVENT_ATTR_ACCOUNT, logonForm.getUsername()));
View Full Code Here


        try {
            try {
              AttributeDefinition def = createDefinition(seq);               
                ProfilesFactory.getInstance().createAttributeDefinition(def);
                def.getPropertyClass().registerPropertyDefinition(def);
                CoreServlet.getServlet().fireCoreEvent(new CoreEvent(this,
                                CoreEventConstants.ATTRIBUTE_DEFINITION_CREATED,
                                def,
                                getSessionInfo(request),
                                CoreEvent.STATE_SUCCESSFUL));
            } catch (Exception e) {
                CoreServlet.getServlet().fireCoreEvent(new CoreEvent(this,
                                CoreEventConstants.ATTRIBUTE_DEFINITION_CREATED,
                                null,
                                getSessionInfo(request),
                                e));
                throw e;
View Full Code Here

     * @throws Exception on any error
     */
    public static void setEnabled(User user, boolean enabled, AccountLock lock, SessionInfo session) throws Exception {
        CoreServlet servlet = CoreServlet.getServlet();
        try {
            servlet.fireCoreEvent(new CoreEvent(servlet, CoreEventConstants.ACCOUNT_LOCKED, lock, session));
            Property.setProperty(new UserAttributeKey(user, User.USER_ATTR_ENABLED), enabled, session);
            servlet.fireCoreEvent(new CoreEvent(CoreServlet.getServlet(), enabled ? CoreEventConstants.GRANT_ACCESS
                            : CoreEventConstants.REVOKE_ACCESS, null, session, CoreEvent.STATE_SUCCESSFUL).addAttribute(
                CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName()));
        } catch (Exception e) {
            servlet.fireCoreEvent(new CoreEvent(servlet, enabled ? CoreEventConstants.GRANT_ACCESS
                            : CoreEventConstants.REVOKE_ACCESS, null, session, CoreEvent.STATE_UNSUCCESSFUL).addAttribute(
                CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName()));
            throw e;
        }

View Full Code Here

     *      com.adito.security.SessionInfo)
     */
    public void updateResource(Policy resource, SessionInfo session) throws Exception {
        try {
            PolicyDatabaseFactory.getInstance().updatePolicy((Policy) resource);
            CoreEvent coreEvent = addPolicyAttributes(new ResourceChangeEvent(this, CoreEventConstants.UPDATE_POLICY, resource,
                            session, CoreEvent.STATE_SUCCESSFUL), ((Policy) resource));

            CoreServlet.getServlet().fireCoreEvent(coreEvent);

        } 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++;
                }
View Full Code Here

            uris,
            new ActionForward("/fileSystem.do?actionTarget=list&path=" + fileSystemForm.getPath() + "&" + LaunchSession.LAUNCH_ID + "=" + fileSystemForm.getLaunchId()),
            "downloadZip.message",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY));

    CoreEvent evt = NetworkPlaceResourceType.getResourceAccessZipEvent(this,
      fileSystemForm.getLaunchSession(),
      request,
      fileSystemForm.getPath(),
      fileSystemForm.getFullURI(),
      null);
View Full Code Here

                String allFiles = "";
                if (log.isDebugEnabled())
                    log.debug("Pasting from clipboard to " + destinationPath);
                Iterator clipboardIterator = cb.getContent().iterator();

                CoreEvent evt = NetworkPlaceResourceType.getResourceAccessPasteEvent(this,
                    fileSystemForm.getLaunchSession(),
                    request,
                    fileSystemForm.getPath(),
                    fileSystemForm.getFullURI(),
                    null);

                while (clipboardIterator.hasNext()) {
                    String divider = allFiles.equals("") ? "" : ", ";
                    NetworkPlaceClipboardContent element = (NetworkPlaceClipboardContent) clipboardIterator.next();
                    try {
                        VFSResource sourceResource = getResourceForPath(fileSystemForm.getLaunchSession(),
                            request,
                            response,
                            element.getPath());
                        if (log.isDebugEnabled())
                            log.debug("  Source. = " + sourceResource
                                + " (display name = "
                                + sourceResource.getDisplayName()
                                + ", mount = "
                                + sourceResource.isMount()
                                + ")");
                        VFSResource destinationResource = null;
                        if (log.isDebugEnabled())
                            log.debug("Paste");
                        destinationResource = getResourceForPath(fileSystemForm.getLaunchSession(),
                            request,
                            response,
                            DAVUtilities.concatenatePaths(destinationPath, sourceResource.getDisplayName()));

                        if (log.isDebugEnabled())
                            log.debug("  Dest. = " + destinationResource);                 
                       
                        if (sourceResource.getFullPath().equals(destinationResource.getFullPath())) {
                            throw new NetworkPlacesException(NetworkPlacesException.ERR_VFS_CANNOT_PASTE_TO_SOURCE);
                        }
                       
                        allFiles = allFiles + divider + sourceResource.getDisplayName();
                        sourceResource.copy(destinationResource, true, true);
                       
                        if (sourceResource.isCollection()) {
                            NetworkPlaceResourceType.addDirectoryAttribute(evt, sourceResource.getFullPath(), directorieCounter);
                            directorieCounter++;
                        } else {
                            NetworkPlaceResourceType.addDirectoryAttribute(evt, sourceResource.getFullPath(), fileCounter);
                            fileCounter++;
                        }
                        NetworkPlaceResourceType.addOperationType(evt, element.deleteOnPaste());
                        CoreServlet.getServlet().fireCoreEvent(evt);

                        if (element.deleteOnPaste()) {
                            if (log.isDebugEnabled())
                                log.debug("      Deleting source");
                            sourceResource.delete();
                        }
                        msgs.add(Globals.MESSAGE_KEY, new ActionMessage("vfs.paste.from.clipboard", allFiles));
                    } catch (CoreException e) {
                        errs.add(Globals.ERROR_KEY, e.getBundleActionMessage());
                    }
                }
                // The void entries cannot be removed untill the iterator is
                // finished with.
                cb.clearClipboard();

                this.saveErrors(request, errs);
                this.saveMessages(request, msgs);
            } catch (Exception e) {
                CoreEvent evt = NetworkPlaceResourceType.getResourceAccessPasteEvent(this,
                    fileSystemForm.getLaunchSession(),
                    request,
                    fileSystemForm.getPath(),
                    fileSystemForm.getFullURI(),
                    e);
View Full Code Here

        KeyStoreManager mgr = KeyStoreManager.getInstance(KeyStoreManager.SERVER_AUTHENTICATION_CERTIFICATES_KEY_STORE);
        alias = mgr.importPKCS12Key(file, passphrase, alias, alias);
        mgr.reloadKeystore();
        Certificate certif = mgr.getCertificate(alias);

        CoreEvent coreEvent = new CoreEvent(this, CoreEventConstants.KEYSTORE_SERVER_AUTHENTICATION_CERTIFICATE_IMPORTED, KeyStoreManager.SERVER_AUTHENTICATION_CERTIFICATES_KEY_STORE, seq.getSession())
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_ALIAS, alias)
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_TYPE, certif.getType())
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_HOSTNAME, KeyStoreManager.getX509CertificateEntity((X509Certificate)certif, "cn"))
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_ORGANISATIONAL_UNIT, KeyStoreManager.getX509CertificateEntity((X509Certificate)certif, "ou"))
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_COMPANY, KeyStoreManager.getX509CertificateEntity((X509Certificate)certif, "o"))
View Full Code Here

        KeyStoreManager mgr = KeyStoreManager.getInstance(KeyStoreManager.DEFAULT_KEY_STORE);
        String pw = Property.getProperty(new ContextKey("webServer.keystore.sslCertificate.password"));
        mgr.importCert(alias, file, pw);
        Certificate certif = mgr.getCertificate(alias);

        CoreEvent coreEvent = new CoreEvent(this, CoreEventConstants.KEYSTORE_ROOT_CERTIFICATE_IMPORTED, KeyStoreManager.DEFAULT_KEY_STORE, seq.getSession())
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_ALIAS, alias)
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_TYPE, certif.getType())
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_HOSTNAME, KeyStoreManager.getX509CertificateEntity((X509Certificate)certif, "cn"))
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_ORGANISATIONAL_UNIT, KeyStoreManager.getX509CertificateEntity((X509Certificate)certif, "ou"))
                        .addAttribute(CoreAttributeConstants.EVENT_ATTR_CERTIFICATE_COMPANY, KeyStoreManager.getX509CertificateEntity((X509Certificate)certif, "o"))
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);
View Full Code Here

TOP

Related Classes of com.adito.core.CoreEvent

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.