/** * Retrieves the {@link Class} type to which the {@link StackTraceElement} * belongs. * * @param aStackTraceElement The {@link StackTraceElement} for which to get * the according {@link Class}. * * @return The type ({@link Class}) of the according * {@link StackTraceElement}. */ public static Class<?> toClass( StackTraceElement aStackTraceElement ) { try { return Class.forName( aStackTraceElement.getClassName() ); } catch ( ClassNotFoundException e ) { throw new HiddenException( e ); } }
@Override public void run() { try { close(); } catch ( CloseException e ) { throw new HiddenException( e ); } finally { theTimer.cancel(); } } }, aCloseInMillis );
/** * Opens the component by calling {@link #open(Object)} without you to * require catching an {@link OpenException}. * * @param aConnection The connection used for opening the connection. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void openUnchecked( CON aConnection ) { try { open( aConnection ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Initialize the component by calling {@link #initialize(Object)} without * you to require catching an {@link InitializeException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link InitializeException} exception */ default void initializeUnchecked( H aHandle ) { try { initialize( aHandle ); } catch ( InitializeException e ) { throw new HiddenException( e ); } }
/** * Initializes the component by calling {@link #initialize(Object)} without * you to require catching an {@link ConfigureException}. * * @param aContext The context to be passed to the implementing instance. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ConfigureException} exception */ default void initializeUnchecked( CTX aContext ) { try { initialize( aContext ); } catch ( InitializeException e ) { throw new HiddenException( e ); } }
/** * Resumes the component by calling {@link #resume(Object)} without you to * require catching an {@link ResumeException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ResumeException} exception */ default void resumeUnchecked( H aHandle ) { try { resume( aHandle ); } catch ( ResumeException e ) { throw new HiddenException( e ); } }
/** * Flushes the component by calling {@link #flush(Object)} without you to * require catching a {@link OpenException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void flushUnchecked( H aHandle ) { try { flush( aHandle ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Closes the component by calling {@link #close(Object)} without you to * require catching an {@link CloseException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link CloseException} exception */ default void closeUnchecked( H aHandle ) { try { close( aHandle ); } catch ( CloseException e ) { throw new HiddenException( e ); } }
/** * Starts the component by calling {@link #start(Object)} without you to * require catching an {@link StartException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link StartException} exception */ default void startUnchecked( H aHandle ) { try { start( aHandle ); } catch ( StartException e ) { throw new HiddenException( e ); } }
/** * Stops the component by calling {@link #stop(Object)} without you to * require catching an {@link StopException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link StopException} exception */ default void stopUnchecked( H aHandle ) { try { stop( aHandle ); } catch ( StopException e ) { throw new HiddenException( e ); } }
/** * Opens the component by calling {@link #open(Object)} without you to * require catching an {@link OpenException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void openUnchecked( H aHandle ) { try { open( aHandle ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Digests the job by calling {@link #digest(Object)} without you to require * catching a {@link DigestException}. * * @param aJob The job to be digested. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link DigestException} exception */ default void digestUnchecked( J aJob ) { try { digest( aJob ); } catch ( DigestException e ) { throw new HiddenException( e ); } } }
/** * Pauses the component by calling {@link #pause(Object)} without you to * require catching an {@link PauseException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link PauseException} exception */ default void pauseUnchecked( H aHandle ) { try { pause( aHandle ); } catch ( PauseException e ) { throw new HiddenException( e ); } }
/** * Reloads the (state of the) component by calling {@link #reload(Object)} * without you to require catching a {@link OpenException}. * * @param aHandle The handle identifying the component. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link OpenException} exception */ default void reloadUnchecked( H aHandle ) { try { reload( aHandle ); } catch ( OpenException e ) { throw new HiddenException( e ); } }
/** * Initializes the component by calling {@link #initialize(Object, Object)} * without you to require catching an {@link ConfigureException}. * * @param aHandle The handle identifying the component. * * @param aContext The context to be passed to the implementing instance. * * @throws HiddenException encapsulates the cause and is thrown upon * encountering a {@link ConfigureException} exception */ default void initializeUnchecked( H aHandle, CTX aContext ) { try { initialize( aHandle, aContext ); } catch ( ConfigureException e ) { throw new HiddenException( e ); } }
/** * {@inheritDoc} */ @Override protected String toSignature( String aMessage ) { LOGGER.debug( "Using private key \"" + _privateKeyPath + "\" for signing a message used to identify a public key ..." ); try { return _signatureAlgorithm.sign( aMessage.getBytes(), _base64Converter ); } catch ( CryptException e ) { throw new HiddenException( e ); } }
/** * {@inheritDoc} */ @Override public String toString() { try { return toString( _encoding ); } catch ( IOException e ) { throw new HiddenException( ExceptionUtility.toMessage( e ), e ); } }
/** * To decrypted cipher version. * * @param <CV> the generic type * @param aEncyrptedCipherVersion the encyrpted cipher version * @return the cv */ @SuppressWarnings("unchecked") @Override protected <CV extends CipherVersion> CV toDecryptedCipherVersion( CV aEncyrptedCipherVersion ) { LOGGER.debug( "Using private key \"" + _privateKeyPath + "\" for decrypting a cipher ..." ); try { return (CV) _cipherVersionFactory.createInstance( aEncyrptedCipherVersion.getUniversalId(), new String( _decryptAlgorithm.decrypt( aEncyrptedCipherVersion.getCipher(), _base64Converter ) ) ); } catch ( CryptException e ) { throw new HiddenException( e ); } } }
/** * To encrypted cipher version. * * @param <CV> the generic type * @param aDecryptedCipherVersion the decrypted cipher version * @return the cv */ @SuppressWarnings("unchecked") @Override protected <CV extends CipherVersion> CV toEncryptedCipherVersion( CV aDecryptedCipherVersion ) { LOGGER.debug( "Using public key \"" + _publicKeyPath + "\" for encrypting ..." ); try { return (CV) _cipherVersionFactory.createInstance( aDecryptedCipherVersion.getUniversalId(), _encryptAlgorithm.encrypt( aDecryptedCipherVersion.getCipher().getBytes(), _base64Converter ) ); } catch ( CryptException e ) { throw new HiddenException( e ); } } }
/** * {@inheritDoc} */ @Override public boolean signOffSubject( Object aSubject, int aTimeoutInMs ) throws OpenException { ControlFlowUtility.throwIllegalStateException( isDestroyed() ); String theSubjectId = toSubjectId( aSubject ); if ( theSubjectId == null ) { return false; } try { return signoffInstanceDescriptor( new InstanceDescriptorImpl( theSubjectId ), aTimeoutInMs ); } catch ( VetoException aException ) { throw new HiddenException( aException ); } }