@Override public IRuntimeElement answer( final InvocationOnMock invocation ) throws Throwable { Object[] args = invocation.getArguments(); final String parentId = (String) args[0]; final String parentType = (String) args[1]; return new SimpleRuntimeElement( UUIDUtil.getUUIDAsString(), parentId, parentType, "sol1" ); } }
public static String getUUIDAsString() { return UUIDUtil.getUUID().toString(); }
private static String getInterfaceInfo( NetworkInterface nif ) throws Exception { return getInterfaceInfo( nif, ":" ); }
public RepositoryFile( final String fileName, final RepositoryFile parent, final byte[] data, final long lastModified ) { this(); this.fileId = UUIDUtil.getUUIDAsString(); this.fileName = fileName; if ( parent != null ) { parent.addChildFile( this ); } setParent( parent ); setData( data ); setLastModified( lastModified ); directory = data == null; }
protected String uploadFile( InputStream is ) throws Exception { StringWriter fileNameWriter = new StringWriter(); UploadFileUtils utils = new UploadFileUtils( PentahoSessionHolder.getSession() ); utils.setShouldUnzip( false ); utils.setTemporary( true ); utils.setFileName( UUIDUtil.getUUID().toString() ); utils.setWriter( fileNameWriter ); utils.process( is ); return fileNameWriter.toString(); }
public static String getActiveNetworkMacAddress() throws Exception { Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); while ( interfaces.hasMoreElements() ) { NetworkInterface nif = interfaces.nextElement(); // Obvious what the next IF is doing, but it must be connected, non-PPP, non-loopback, and non-virtual if ( ( nif.isUp() ) && ( !nif.isPointToPoint() ) && ( !nif.isLoopback() ) && ( !nif.isVirtual() ) ) { return getInterfaceInfo( nif ); } } return null; }
/** * Use this constructor when you wish to create a new unique job key. * * @param jobName * the user-provided job name * @param username * the user who is executing this job * @throws SchedulerException */ public QuartzJobKey( String jobName, String username ) throws SchedulerException { if ( StringUtils.isEmpty( jobName ) ) { throw new SchedulerException( Messages.getInstance().getErrorString( "QuartzJobKey.ERROR_0000" ) ); //$NON-NLS-1$ } if ( StringUtils.isEmpty( username ) ) { throw new SchedulerException( Messages.getInstance().getErrorString( "QuartzJobKey.ERROR_0001" ) ); //$NON-NLS-1$ } userName = username; this.jobName = jobName; randomUuid = UUIDUtil.getUUIDAsString(); }
filename = UUIDUtil.getUUID().toString();
String strUuid = UUIDUtil.getUUIDAsString().replaceAll( "-", "_" ); //$NON-NLS-1$ //$NON-NLS-2$
private IRuntimeElement makeRuntimeData( final IPentahoSession session ) { return new SimpleRuntimeElement( UUIDUtil.getUUIDAsString(), session.getId( ), IParameterProvider.SCOPE_SESSION ); }
private IRuntimeElement makeRuntimeData( final IPentahoSession session ) { return new SimpleRuntimeElement( UUIDUtil.getUUIDAsString(), session.getId( ), IParameterProvider.SCOPE_SESSION ); } }
@Override public void run() { try { String s = null; String enc = null; String dec = null; for ( int i = 0; i < 50; i++ ) { s = UUIDUtil.getUUIDAsString(); enc = service.encrypt( s ); dec = service.decrypt( enc ); Assert.assertEquals( s, dec ); } } catch ( Exception ex ) { ex.printStackTrace(); Assert.fail( ex.toString() ); } } } );
/** * * Creates a new RuntimeElement * * @param parId * Parent ID of this instance * @param parType * Parent type of the instance * @return the created runtime element */ public IRuntimeElement newRuntimeElement( final String parId, final String parType, final boolean transientOnly ) { if ( SimpleRuntimeRepository.debug ) { debug( Messages.getInstance().getString( "RTREPO.DEBUG_NEW_ELEMENT_PARENT", parId, parType ) ); //$NON-NLS-1$ } String instanceId = UUIDUtil.getUUIDAsString(); if ( SimpleRuntimeRepository.debug ) { debug( Messages.getInstance().getString( "RTREPO.DEBUG_CREATE_INSTANCE", instanceId ) ); //$NON-NLS-1$ } SimpleRuntimeElement re = new SimpleRuntimeElement( instanceId, parId, parType ); return re; }
/** * * Creates a new RuntimeElement * * @param parId * Parent Id of the runtime element * @param parType * Parent type of the runtime element * @param solnId * Solution Id of the element * @return The created runtime element */ public IRuntimeElement newRuntimeElement( final String parId, final String parType, final String solnId, final boolean transientOnly ) { if ( SimpleRuntimeRepository.debug ) { debug( Messages.getInstance().getString( "RTREPO.DEBUG_NEW_ELEMENT_PARENT_SOLN", parId, parType, solnId ) ); //$NON-NLS-1$ } String instanceId = UUIDUtil.getUUIDAsString(); if ( SimpleRuntimeRepository.debug ) { debug( Messages.getInstance().getString( "RTREPO.DEBUG_CREATE_INSTANCE", instanceId ) ); //$NON-NLS-1$ } SimpleRuntimeElement re = new SimpleRuntimeElement( instanceId, parId, parType, solnId ); return re; }
final IRuntimeElement elem = new SimpleRuntimeElement( UUIDUtil.getUUIDAsString(), "parentId", "parentType", "sol1" );
setInstanceId( UUIDUtil.getUUIDAsString() );
String instanceId = UUIDUtil.getUUIDAsString(); if ( RuntimeRepository.debug ) { debug( Messages.getInstance().getString( "RTREPO.DEBUG_CREATE_INSTANCE", instanceId ) ); //$NON-NLS-1$
String instanceId = UUIDUtil.getUUIDAsString(); if ( RuntimeRepository.debug ) { debug( Messages.getInstance().getString( "RTREPO.DEBUG_CREATE_INSTANCE", instanceId ) ); //$NON-NLS-1$
public void testTempFileDeleter() throws Exception { StandaloneSession session = new StandaloneSession( "tempfiledeleter", UUIDUtil.getUUIDAsString() ); // get one with an id. //$NON-NLS-1$ StandaloneTempFileDeleter deleter = new StandaloneTempFileDeleter();
String id = UUIDUtil.getUUIDAsString(); runtimeData = new SimpleRuntimeElement( id, session.getId(), IParameterProvider.SCOPE_SESSION ); } else {