public static final Token restore ( java . io . DataInputStream dataInputStream , ObjectManagerState objectManagerState ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( cclass , "restore" , new Object [ ] { dataInputStream , objectManagerState } ) ; int objectStoreIdentifier ; long storedObjectIdentifier ; try { byte version = dataInputStream . readByte ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( cclass , "restore" , new Object [ ] { new Byte ( version ) } ) ; objectStoreIdentifier = dataInputStream . readInt ( ) ; storedObjectIdentifier = dataInputStream . readLong ( ) ; } catch ( java . io . IOException exception ) { // No FFDC Code Needed. ObjectManager . ffdc . processException ( cclass , "restore" , exception , "1:400:1.14" ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "restore" , "via PermanentIOException" ) ; throw new PermanentIOException ( cclass , exception ) ; } // catch (java.io.IOException exception). Token tokenToReturn = new Token ( objectManagerState . getObjectStore ( objectStoreIdentifier ) , storedObjectIdentifier ) ; // Swap for the definitive Token. // TODO should have a smarter version of like() which takes a storedObjectIdentifier, // instead of requiring a new Token(). tokenToReturn = tokenToReturn . current ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "restore" , "returns token=" + tokenToReturn + "(Token)" ) ; return tokenToReturn ; }
Recover the token described by a dataInputStream and resolve it ot the definitive token .