Package step.grid
Class GridImpl
- java.lang.Object
-
- step.grid.GridImpl
-
- All Implemented Interfaces:
Grid,GridFileService
public class GridImpl extends Object implements Grid
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridImpl.GridImplConfig
-
Field Summary
-
Fields inherited from interface step.grid.Grid
LOCAL_AGENT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<AgentRef>getAgents()FileVersiongetRegisteredFile(FileVersionId fileVersionId)intgetServerPort()List<TokenWrapper>getTokens()protected voidhandleRegistrationMessage(RegistrationMessage message)voidmarkTokenAsFailing(String tokenId, String errorMessage, Exception e)FileVersionregisterFile(File file)FileVersionregisterFile(InputStream inputStream, String fileName, boolean isDirectory)voidremoveTokenError(String tokenId)voidreturnToken(String tokenId)TokenWrapperselectToken(Map<String,String> attributes, Map<String,Interest> interests, long matchTimeout, long noMatchTimeout, TokenWrapperOwner tokenOwner)voidstart()voidstartTokenMaintenance(String tokenId)voidstop()voidstopTokenMaintenance(String tokenId)voidunregisterFile(FileVersionId fileVersionId)
-
-
-
Constructor Detail
-
GridImpl
public GridImpl(Integer port) throws IOException
- Throws:
IOException
-
GridImpl
public GridImpl(File fileManagerFolder, Integer port, GridImpl.GridImplConfig gridConfig)
-
-
Method Detail
-
handleRegistrationMessage
protected void handleRegistrationMessage(RegistrationMessage message)
-
selectToken
public TokenWrapper selectToken(Map<String,String> attributes, Map<String,Interest> interests, long matchTimeout, long noMatchTimeout, TokenWrapperOwner tokenOwner) throws TimeoutException, InterruptedException
- Specified by:
selectTokenin interfaceGrid- Throws:
TimeoutExceptionInterruptedException
-
returnToken
public void returnToken(String tokenId)
- Specified by:
returnTokenin interfaceGrid
-
markTokenAsFailing
public void markTokenAsFailing(String tokenId, String errorMessage, Exception e)
- Specified by:
markTokenAsFailingin interfaceGrid
-
removeTokenError
public void removeTokenError(String tokenId)
-
startTokenMaintenance
public void startTokenMaintenance(String tokenId)
-
stopTokenMaintenance
public void stopTokenMaintenance(String tokenId)
-
getTokens
public List<TokenWrapper> getTokens()
-
getAgents
public Collection<AgentRef> getAgents()
-
getServerPort
public int getServerPort()
-
registerFile
public FileVersion registerFile(InputStream inputStream, String fileName, boolean isDirectory) throws FileManagerException
- Specified by:
registerFilein interfaceGridFileService- Throws:
FileManagerException
-
registerFile
public FileVersion registerFile(File file) throws FileManagerException
- Specified by:
registerFilein interfaceGridFileService- Throws:
FileManagerException
-
getRegisteredFile
public FileVersion getRegisteredFile(FileVersionId fileVersionId) throws FileManagerException
- Specified by:
getRegisteredFilein interfaceGridFileService- Throws:
FileManagerException
-
unregisterFile
public void unregisterFile(FileVersionId fileVersionId)
- Specified by:
unregisterFilein interfaceGridFileService
-
-